Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel 2010/Access Data from Web
Message
From
25/01/2013 17:07:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/01/2013 15:33:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01564147
Message ID:
01564161
Views:
58
>***ALSO POSTED TO COM/DCOM/OLE Automation - Not sure which category best fit this situation.
>Hello All,
>
>Following is part of a program that used to successfully retrieve Access data from a website and convert it to an Excel file which is later converted to a .dbf for manipulation within VFP. The user is now using Excel 2010.
>
>
>**OPEN WEBSITE FILE
>m.xlsfile="http://www.gmrofgr.com/fpdb/ReservFORM.mdb"
>
>oExcel = Createobject("excel.application")
>oExcel.Visible = .F.
>oExcel.DisplayAlerts=.F. 
>llFound = .F.
>WAIT clear
>oExWorkbook = oExcel.Workbooks.Open(xlsfile) &&OPENS DATA FROM WEBSITE IN EXCEL
>
>***Excel 2010 brings up promp "Text Import Wizard", since this is happening in the background, we have a problem
>***Below is what used to happen correctly once the .mdb was opened in Excel.
>
>WAIT WINDOW "Retrieving reservations from the internet... Please wait" NOWAIT NOCLEAR AT 25,100
>m.newfile=m.DIR+'data\LunchReserve.xls'
>
>**SAVE DATA FILE AS EXCEL FILE -- I suspect the following will likely have problems as well?
>oExWorkbook = oExcel.activeworkbook.SaveAs(m.newfile)
>**CLOSE FILE AND EXCEL
>oExWorkbook = oExcel.activeworkbook.Close
>oExcel.DisplayAlerts=.T. 
>oExcel.Quit 
>
>
>Maybe there's a simpler way to convert the Access file (without use of Access) to a .dbf? Or, some sort of code to check the version of Excel and adjust the code accordingly?
>
>Any help or suggestions is greatly appreciated!

Your excel is already using an odbc driver to access (pardon the poor pun, don't execute it!) the mdb - so why not cut the middleman and use the ODBC driver from Fox? You get a handle, and you do everything in sqlexec() calls, get the results in neat Fox cursors and from that point you know what to do.

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