Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing Access Table
Message
 
To
07/03/2005 07:27:55
Ashish Patel
Hindustan Petroleum
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP3
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
00993235
Message ID:
00993240
Views:
14
>Hi,
>
>How to access an Access Database from VFP6 Form ?
>
>
>Regards
>
>Ashish Patel

Try this code:
constring = "DBQ=path\your.mdb;Driver={Driver do Microsoft Access (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;"
sqlHandler = SQLSTRINGCONNECT(constring)
IF sqlhandler < 1
   MESSAGEBOX("No made connection")
   RETURN
ENDIF

sqlselect = "SELECT table_mdb.*  FROM table_mdb  WHERE your_choice INTO ...."

IF SQLEXEC(sqlHandler,sqlselect,"MyCursor") <0
      MESSAGEBOX("Error.....")
ENDIF

The data are in MyCursor
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform