|
-
Aug 26th, 1999, 03:46 PM
#1
Thread Starter
Lively Member
I am working on a program that reads information from a number of FoxPro tables via ODBC and places results into a Access database. I am able to pull the needed records from the FoxPro tables into either a recordset or query object, but I am not sure the best way to then insert these records into the second database. Any code ideas? Thanks.
Jay D Zimmerman
-
Aug 26th, 1999, 06:53 PM
#2
Frenzied Member
Use ODBC for the FoxPro database and DAO for the Access (if you can swing it, use DAO for both). Simply put, you're gonna have two database objects in your code...
If you're using DAO for Access create a data control, then, you should then do something like:
Code:
qry= "select * from odbc_table"
set recordset= odbcDB.OpenRecordset (qry, dbOpenSnapshot)
if recordset.EOF = false then
Do While Not recordset.EOF
With form.datacontrol.recordset
.AddNew
!Field0 = Recordset.Fields(0)
!Field1 = Recordset.Fields(1)
' [...]
'FieldX = Recordset.Fields(x)
.Update
.Bookmark = .LastModified
End With
recordset.MoveNext
loop
end if
recordset.close
[This message has been edited by JHausmann (edited 08-27-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|