Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP to ACCESS
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
VFP to ACCESS
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01314154
Message ID:
01314154
Views:
114
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
Next
Reply
Map
View

Click here to load this message in the networking platform