Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec syntax?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
SQLExec syntax?
Miscellaneous
Thread ID:
00222232
Message ID:
00222232
Views:
38
I cannot seem to get my Access data into a VFP cursor! Everything up to my SQLEXEC statement returns a valid integer (1) but the SQLExec statement always returns a -1:

declare integer SQLConfigDataSource in odbccp32 Integer, Integer, String, String
settings="DSN=Employees"+chr(0)+"Description=Temporary Employee Data"+chr(0)+"FileType=Microsoft Access Driver (*.mdb)"+chr(0)+"DBQ=F:\projects\accountg\data\printing\infortext.mdb"+chr(0)+"MaxScanRows=16"
= SQLConfigDataSource(0,1,"Microsoft Access Driver (*.mdb)",settings)
* SQL Data Settings are created
STORE SQLConnect('Employees') TO gnConnHandle
IF gnConnHandle<=0
=MessageBox('Cannot Make Connection', 16, 'SQL Connect Error')
ENDIF
= SQLSETPROP(gnConnHandle, 'asynchronous', .F.)
WAIT WINDOW "Ready to Connect..."
* Here's where it fails, returning a -1:
? SQLEXEC(gnConnHandle, 'SELECT * FROM Newemployees', 'MyCursor')

*Disconnect from Data Source:
=SQLDisConnect(gnConnHandle)
* And remove settings:
IsRemove =SQLConfigDataSource(1,3,"Microsoft Access Driver (*.mdb)",settings)
* SQL Data Settings are removed
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Next
Reply
Map
View

Click here to load this message in the networking platform