General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Reading a VFP table in VB
I have written a program which creates an Access database dynamically and creates and adds various tables to the database. I want to read a VFP table and populate my access tables from it. I have the following code:
Dim tblLink As TableDef
vfpTable = "FoxProTable"
vfpConnect = "FoxPro 2.6;DATABASE="C:\temp" ' directory of table
vfpSource = "total_rank.dbf" ' vfp table
Set tblLink = dbs.CreateTableDef(vfpTable)
tblLink.Connect = vfpConnect
tblLink.SourceTableName = vfpSource
dbs.TableDefs.Append tblLink
Set rst = dbs.OpenRecordset(vfpTable)
I have previously dimensioned the vfp variables, opened my database as dbs and defined by recordset variable. I believe my problem is that my vfp table is not part of a database. I am not sure how to code this. The program seems to work until it reaches the Set rst statement. Can anyone help me?
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only