Information générale
Catégorie:
Codage, syntaxe et commandes
>Is there a reasonable way to copy data from a VFP table to an Access MDB?
I use SQL Passthrough...
first you connect to the Access database this way
lcConnect = "DBQ=" + m.AccessDB + ";" + ;
"DEFAULTDIR=" + m.AccessDir + ";" + ;
"Driver={Microsoft Access Driver (*.mdb)};DriverId=281;" + ;
"FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"
m.lnConnect = SQLSTRINGCONNECT(lcConnect)
Where m.AccessDB is the full path of the Access database.
m.AccessDir is the directory of the Access database.
m.lnConnect hold the connection handle for the access database..
When m.lnConnect > 0 you have a valid connection to the Access database.
then issue a series of commands to add records to the relavent tables
via
m.result=SQLEXEC(lnConnect,lcQuery)
Where m.lcQuery is the Access MDB command for adding a new record.
The cool thing is that once you've established a connection to the Access MDB you are passing Access SQL commands DIRECTLY via the SQLEXEC command.
Thus, you are using Access/JET SQL language to add records.
then issue
= SQLDISCONNECT(lnConnect) to release the connection with the AccessMDB
good luck
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement