Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC() Not Consistent with Data Types
Message
From
28/06/2011 12:59:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/06/2011 14:24:34
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01516317
Message ID:
01516535
Views:
46
>I am gathering data from an Excel 2010 workbook into VFP 9 SP2 using ODBC via SQLSTRINGCONNECT(). The cursor created by SQLEXEC() creates two columns of data (among many other columns) that should be of the same data type, but one is coming into VFP as data type "B" (double) and the other as data type "M" (Memo). The double field is causing me to loose the character data that also resides in the column.

You're letting the ODBC driver decide the type of data for each column. You can't really know what it will do. I've seen Excel do weird things (search my blog for Excel), and I expect the driver comes from the same kitchen.

The only sure-fire way that I've found for retrieving data from Excel is automation, using .cell(nRow, nCol).text, and sometimes .cell(nRow, nCol).value (but .value is often buggy - Excel may interpret some cells as numbers, even though most of the column contains strings).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform