Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Office 2007 compatibility issues
Message
From
05/02/2007 05:40:05
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01191826
Message ID:
01192312
Views:
26
YESSSSS!
that works. For big sheets this might have the edge over COM.
But I think I'll stick with COM anyway.
But having learned something new is always thrilling for this old brain...

Thanks Boris.
Maybe within a year, I'll visit Sofia then I'll take you for a few beers...

Peter


>>>>(Yes I had used my own filename and folder :-) )
>>>>But:
>>>>
>>>>Sorry I still get a table with the structure in it and a million records with all NULLS
>>>>just like before.
>>>>What am I supposed to get??
>>>>
>>>>
>>>>Peter
>>>
>>>Cursor aaaa must have all columns and rows from Excel sheet.
>>>Strange, it works like a charm here.
>>can you use the file i sent you by email
>>and tell me how to use odbc to get at the data in it. I had never used odbc for that just COM
>
>Strangest thing is that I have an exported from VFP Excel file, opened and Saved in new Excel format and the code I posted works with it. for your file:
>
>lcFile = GETFILE([XLSX])
>IF EMPTY(lcFile)
>   RETURN
>ENDIF
>lcFoder = JUSTPATH(lcFile)
>
>TEXT TO lcConnString NOSHOW PRETEXT 15 TEXTMERGE
>     DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb);
>     UID=admin;
>     FIL=excel 12.0;
>     DriverId=1046;
>     DefaultDir=<<lcFoder >>;
>     DBQ=<<lcFile>>
>ENDTEXT
>
>lnSQL = SQLSTRINGCONNECT(lcConnString)
>SQLEXEC(lnSQL,"SELECT * FROM [sheet1$]",[aaaa])
>SQLDISCONNECT(0)
>SELECT aaaa
>BROWSE NORMAL
>
>works, it must give you a cursor Aaaa with the same structure as Excel Sheet1
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform