Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connects to sql but query won't run.
Message
From
21/12/2007 12:46:18
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01277033
Message ID:
01277036
Views:
24
>lnConnHandle=SQLSTRINGCONNECT("DRIVER=SQL Server;SERVER=STRDBF02;APP=Microsoft Visual FoxPro;DATABASE=ADEPT5_GLSS;UID=reports;Password=reports")
>
>This my connection, It says I am connected but my query won't run. When I log in as a trusted connection it works fine. What am i missing.
>
>Thanks

You missing the check WHY it not runs:
lnConnHandle=SQLSTRINGCONNECT("DRIVER=SQL Server;SERVER=STRDBF02;APP=Microsoft Visual FoxPro;DATABASE=ADEPT5_GLSS;UID=reports;Password=reports")
IF lnConnHandle < 0
    AERROR(laError)
    MessageBox(laError[1,2])
    RETURN
ENDIF

IF SQLEXEC(lnConnHandle, query here, [CursorHere]) < 0
    AERROR(laError)
    MessageBox(laError[1,2])
    RETURN
ENDIF
...
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform