Problem reading DATEs from Excel via OLE2 [message #287563] |
Wed, 12 December 2007 12:33 |
mtm1701
Messages: 2 Registered: December 2007 Location: Long Island, NY
|
Junior Member |
|
|
We have a legacy 6i form which use OLE2 to upload data from excel into the form, which it does flawlessly.
I need to modify the form to read a new DATE column and I am running into problems.
Heretofore, to read numeric and character cells I used the following (respectively) within a loop that went through each cell on each row of the spreadsheet:
cell_value_num := ole2.get_num_property (cell, 'Value');
cell_value_char := ole2.get_char_property(cell, 'Value');
where cell_value_num is defined as NUMBER and cell_value_char is defined as varchar2(4000).
The test spreadsheet has 2 rows.
The date columns in excel have the values 12/25/2007 for row 1 and 2/27/2007 for row 2.
When I use
"cell_value_char := ole2.get_char_property(cell, 'Value');"
to read the cell, CELL_VALUE_CHAR is "1", not "12/25/2007". Similarly, reading 2/27/2007 yields "2" instead of "2/27/2007".
Even if the column is defined in Excel as TEXT, I still only gets only the first character.
If the dates in the spreadsheet are enclosed in single-quotes (e.g. '12/25/2007') then it works perfectly, but I do not want to require the users to do that.
Any insights??
Thanks
|
|
|
|
|