Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Connection Problem (With OLEDB)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00565686
Message ID:
00565770
Views:
26
>Uh oh. I finally found a reference at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fox7help/html/dglrfunsupportedvisualfoxprocommandsfunctions.asp that says "Create Connection" is not supported with the VFP7 OLEDB provider. This is a bad thing.
>
>Maybe if I say what I am doing someone can give me a better way. I am trying to create a local DBC version of several tables that lie on different MSSQL servers. This all has to get done in ADO (forced to use VBScript for this exercise).
>
>Originally I queried the MSSQL table for its columns, created the proper string, and fed that string to the VFP OLEDB provider and made a table with the same structure as the MSSQL table. Then I used the GetRows method on the MSSQL table to put the result set into an array, but I got stuck because I never know what kind of data will be in the array, so I can't tell the provider
Insert into table (col1,col2,col3) values (array(0,0),array(1,0),array(2,0))
because of the data typing.
>
>Then I thought I could use the VFP OLEDB provider to create an ODBC connection in the DBC, then a Remote View, then I could copy that to a table and add it to the database. No go on that one.
>
>So what kind of method can I use to automatedly(sp) copy MSSQL tables into VFP tables?
>
>Thanks.

You can use any of the available ADO recordset to VFP cursor conversion tools for this. In such case you would only need the SQL provider and not the VFP one. May I suggest you use the following UT download (that I posted) : http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,54,Forum=5,28,1454 , after you have the cursor just save it as a DBF. Half of the work is done for you in this download which has a test program that can open the specified SQL Server database and loops through all the tables to perform the conversion. Just change and use the connection string for a SQL Server database.

Alternatively you could use the VFPCOM utility from MS.
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform