Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLEXEC() Not Consistent with Data Types
Message
De
28/06/2011 12:59:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
27/06/2011 14:24:34
Steve Ritter
Rockwell Collins, Inc.
Cedar Rapids, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01516317
Message ID:
01516535
Vues:
47
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform