Results 1 to 2 of 2

Thread: Dual database interaction

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Location
    Atlanta, GA
    Posts
    75

    Post

    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

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    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
  •  



Click Here to Expand Forum to Full Width