I have the code below which opens an access database and a FoxPro table. I want to populate the access table from the fox data. When I execute the INSERT statement foxpro popups a box asking me for the accounts table.
Any help on how I can add the record to the access table would be great. I am missing something somewhere.
***** Code ******
cMDB ="H:\Source Code\Access Test\db1.mdb" && sample Access database
cItem="accounts" && sample database table
USE table1 &&& Fox Table with same stucture
SELECT table1
oAcc=CREATE("Access.Application")
oAcc.OpenCurrentDatabase(cMDB)
oMDB=oAcc.CurrentDB
oRS=oMDB.OpenRecordSet(cItem)
DO WHILE !EOF('Table1')
cAccid=table1.accid
cAccountnum=table1.accountnum
cAccountNam=table1.accountnam
cPswd=table1.pswd
INSERT INTO accounts (accid, accountnum, accountnam, pswd) ;
VALUES (cAccid, cAccountnum, cAccountNam, cPswd)
SKIP +1
ENDDO
CLOSE TABLE
oAcc.CloseCurrentDatabase
oAcc.Quit(1)
Jules