Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import Access
Message
De
14/06/2006 04:23:31
 
 
À
14/06/2006 04:17:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01128911
Message ID:
01128912
Vues:
24
>Hi all,
>
>I need to import the contents of an Access table into an existing FoxPro table. What is the best way to do this? I'm new to FoxPro so don't know much about setting up ODBC links - are there any good examples out there?
>
>Thanks

An example how to connect to Access DB and get data from one of its tables:
lcOBDCh = SQLSTRINGCONNECT([Driver={Microsoft Access Driver (*.mdb)};Dbq=FULL PATH TO ACCESS DATABASE HERE;Uid=USERNAME;Pwd=PASSWORD;])
IF lcOBDCh < 1
   AERROR(laError)
   MessageBox([Cannot connect to AccessDB ]+laError[1,2])
   RETURN .f.
ENDIF
IF SQLEXEC(lcOBDCh, [SELECT * FROM MyAccessTable],[VFPCursor]) < 1
   AERROR(laError)
   MessageBox([Cannot get data from MyAccessTable ]+laError[1,2])
   SQLDISCONNECT(lcOBDCh)
   RETURN .f.
ENDIF
SELECT VFPCursor
GO TOP
BROWSE NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform