Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement