Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access
Message
From
12/01/2001 00:49:24
Tom Gahagan
Alliance Computer Solutions
Thomaston, Georgia, United States
 
 
To
12/01/2001 00:33:00
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Access
Miscellaneous
Thread ID:
00462791
Message ID:
00462794
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform