Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec syntax?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00222232
Message ID:
00222243
Views:
34
Use AERROR() to find out what the exact problem is. That might give you an idea of where to start.

>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
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform