Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Export a Table To an Access Database?
Message
De
15/01/2001 11:59:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00463763
Message ID:
00463817
Vues:
21
Dave,

There are different ways to do this. The following code uses SQL-passthrough:

*-- build connection string
lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
"Dbq=c:\temp\bidon.mdb;" +;
"Uid=Admin;" +;
"Pwd=;"

*-- connect to MS Access
lnAccess = SQLSTRINGCONNECT(lcConnectionStr)

*-- create the table
*-- Note that we need to use Access SQL dialect (char(12) vs. C(12))
SQLEXEC(lnAccess, "CREATE TABLE test (Type char(12), id char(12))")

*-- select some data
SELECT type, id FROM HOME()+"foxuser" INTO CURSOR test

*-- insert the result set into MS Access
WAIT WINDOW NOWAIT "Inserting data into MS Access..."
SCAN
SQLEXEC(lnAccess, "INSERT INTO test VALUES('" + Type + "', '"+id+"')")
ENDSCAN
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform