Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec & SQLPREPARE not being executed
Message
 
To
03/08/2011 09:34:09
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01520048
Message ID:
01520057
Views:
54
>Hello Fox/SQL experts :)!
>
>Yesterday i got help in writing this handle
>
>
>IF SQLExec(m.Handle, "SELECT * FROM useraccess", "test") " more than " 0
>but the thing is, i dont see the cursor "test" in the Data enviroment, i cant selcet it nor can i browse, the reason why im also wondering if this even executing is because if i do "Select *from peterpan" (peterpan being a table that doesnt exist) it doesnt error out on that line
>
>
>
>
>
>ive played around with it and changed it to
>
>SQLPREPARE(m.Handle, 'SELECT * FROM useraccess', 'test')
>SQLEXEC(m.Handle)
>
>but that doesnt seem to solve the problem

Ken,
there is a SQL Server tool named SQL Profiler.
You can tun it and see what query you sent to SQLServer.
Than you can copy and paste this query in SSMS and see the result.

BTW you ALWAYS should check the result or any of SQL* functions:
lnResult =  SQLEXEC(........)
DO CASE
   CASE lnResult < 0
        AERROR(laError)
        MessageBox(laError[1,2])
        RETURN
   CASE lnResult = 0
        ** Query still executes.
        ** You must wait here untill some resukt
OTHERWISE
        *** Success
ENDCASE
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform