Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Access Table
Message
 
To
12/02/2002 23:17:14
Ashish Patel
Hindustan Petroleum
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00619273
Message ID:
01204158
Views:
20
Hi

You can try the code below, just change the exact database file path, user id & password. This is a DSN less connection, means you dont have to creat any connections at the DATA SOURCES(ODBC). If your Access DB was located from a remote computer on your LAN, just replace "LOCALHOST" and put in the IP address.
lcServer="LOCALHOST"
lcDatabase = "C:\Dev\myAccess.mdb"
lcUser = "admin" *// Default user 
lcPassword = "" *// if you have password, key-in here
lcStringConn = "Driver={Microsoft Access Driver (*.mdb)}"+;
               ";Server="+lcServer+;
               ";Dbq="+lcDatabase+;
               ";Uid="+lcUser+;
               ";Pwd="+lcPassword
SQLSETPROP(0,"Displogin",3)
lnHandle = SQLSTRINGCONNECT(lcStringConn)

IF lnHandle > 0
	=SQLEXEC(lnHandle,"Select * from TABLE1","myTABLE")
        *// do whatever you want with the result set...
        SQLDISCONECT(lnHandle)
ELSE
	=AERROR(laError)
	Messagebox("Error at Connecting "+CHR(13)+;
	           "Description:"+laError[2],0+16,"DSN")
ENDIF
Regards...


>Hi John
>
>Thanks for reply
>
>I am new to all these ODBC things.
>
>Can you tell me step by step for using access table.
>
>It will be great help.
>
>Thanks once again
>
>Ashish Patel
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Reply
Map
View

Click here to load this message in the networking platform