Copying Table

  • Thread starter Thread starter muleherd
  • Start date Start date
M

muleherd

Guest
I am able to connect to a foxpro table using ADO and this code . . .

rs.Open "momcusts", "Driver=Microsoft Visual Foxpro Driver; UID=;SourceType=DBF;SourceDB=C:\", adOpenForwardOnly, adLockReadOnly, adCmdTableDirect

Is there any easy way to copy the entire table into a local Access 2000 table?
 
That depends on your interpitation of easy.

You already have an ado recordset with the foxpro data. You can open an dao recordset of a new access table and copy the records.

dim db as dao.database
dim rsB as dao.recordset

set db = currentdb()
set rsB = db.openrecordset("new_table",dbopendynaset)

' rs is the recordset name of your ADO recordset

rs.movefirst
do until rs.eof
rsB.AddNew
rsB!FieldX = rs!FieldX
rsB!FieldY = rs!FieldY
rsB.Update
rs.Movenext
loop

close rsB
close db

p.
 

Users who are viewing this thread

Back
Top Bottom