Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC Excel Driver no SQL update
Message
From
10/10/1997 18:32:02
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/09/1997 13:02:50
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00051245
Message ID:
00054114
Views:
25
>I am having too much fun with 32bit ODBC Excel 97 Driver and maybe someone >can halp me to understand that I am doing wrong. >I have a spreadsheet in Excel 97 format with range name excMyRange and in >VFP 5.0 I have a database container with connection based on ODBC Excel 97 >and updateble View called MyView. I can query the data in view but if I try >to change it I get ODBC error (or I think it is ODBC error) saying "This >operation requires Updatable query". I think my query is updateble then why >ODBC thinks it is not ? >Please share any expirience with ODBC VFP and Excel spreadsheets. I would >like to be able to update data in spreadsheets using VFp and ODBC. > >Thank you. I'm playing around with filling up an Excel 97 workbook with values entered via VFP forms (I simply hate entering data in Excel - no incremental search, date format is not configurable the way I like it...). I've discovered some things by now: - most of the columns appear to be of Memo type, and should best be left that way. The ODBC driver is leaning heavily on the sheet column format, but once there's some data of other type in some cell in a column, it reverts from defaulting to Double numbers to Memo again. A slightest change in sheet structure makes the view unusable, and the only way to get it up and going is to Modi View again, reselect all the fields, accept the default data types and hope for the best. Yes, there must be a primary key column - I've defined it as 8-digit integer in Excel, and it works. I've been trying to reconstruct the view programmatically, taking what GenDbc generated, but as soon as I've left the constant strings it made and replaced them with vars (there are six workbooks with the same structure, so I wanted to replicate behavior and achieve consistency), the views I got that way were complaining a lot and either wouldn't update, or would report some cryptical ODBC errors or just required DbSetProp("Tables", ---). Well, DbGetProp said it was ok, the table was the proper one, though it was surrounded with quotes; I've removed the quotes but no good either. The next obstacle was that there was a lot of interpunction in Excel sheet (blanks, for one) which got translated into underscores for view field names. The killer combination had only R/N which did get into R_n, but remained unqouted in the SQL statement (visible) and the update statement (invisible - and it's quite a phantom). So finally I've ended up with just three sheets (I'll derive other five from the third one, for which I've clicked my way through), and the remaining problem is Unicode. There's no decent way to persuade Excel to accept the data entered in the view as CP 1250 (though Fox marks it internally as 1250), so they end up as CP 1252 in Excel's Unicode. If everything else fails, I might just write a macro in Excel, and call it via DDE or OLE after transfer, but I feel like a bad failure if I can't do it from Fox. Anyone tried that?

back to same old

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

Click here to load this message in the networking platform