Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access
Message
De
12/01/2001 00:49:24
Tom Gahagan
Alliance Computer Solutions
Thomaston, Georgie, États-Unis
 
 
À
12/01/2001 00:33:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Access
Divers
Thread ID:
00462791
Message ID:
00462794
Vues:
12
Hello Mohammed.....

Here is some code I cut from a program. This block is executed when the user indicates that they want to browse an Access Database file. It has been tested some and seems to work ok and should be enough to get you started.

Notes you need to consider:
ma_mdbfile is the name and path etc of the access database file.
m_mdbtable is the name of the table they wish to browse.
   mdbq="Dbq="+alltrim(ma_mdbfile)
   
   && make connection string
   lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
   "&mdbq" + ";" +"UID=admin" + ";" + "PWD="
   
   && connect
   nAccess = SQLSTRINGCONNECT(lcConnectionStr)

   && get data
   msql="Select * from "+alltrim(m_mdbtable)
   mtbl=alltrim(m_mdbtable)
   
   SQLEX(nAccess, "&msql", "&mtbl")
   
   && view data allow no data manipulation
   
   browse noappend noedit nodelete
Hope it helps
Tom Gahagan
Alliance
Computer Solutions

"Music, like sex, is much too important to be left to professionals."
Robert Shaw
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform