Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP to ACCESS
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
VFP to ACCESS
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01314154
Message ID:
01314154
Vues:
115
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform