Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Connections
Message
 
To
13/11/1998 12:10:17
Sam Chung
Benesphere Administrators
Bellevue, Washington, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00155424
Message ID:
00157457
Views:
23
If a SQLCONNECT connection fails, the return value is -1. A handle of 1 is perfectly valid and that's what the first connection handle's value would be. Your test would eliminate this handle value. Change the If test to If gnConnHandle = -1 and try it.

>STORE SQLCONNECT('fsa', 'claims','password') TO gnConnHandle
>
> IF gnConnHandle <= 2
>
> = MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>
> ELSE
>
> = MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
> = SQLDISCONNECT(gnConnHandle)
>
> ENDIF
>
>This program is trying to connect to a SQL backend database to a database called FSA. I keep getting the Call failed message. Can you help?? Thanks for your assistance.
"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
Reply
Map
View

Click here to load this message in the networking platform