b001
asked on
vfp9 sql remote connection
HI Experts
I am using the following connection string from fvp9 to connect to a remote sql database.
FMS_SERVERIP= '235,256,258,99' my remote sql server ip
lcStr = "Driver={SQL SERVER};Server=&FMS_SERVER IP;Databas e=Group;UI D=b001;pwd =b00158;Tr usted_Conn ection=no; "
try
lnHandle = Sqlstringconnect(lcStr)
lnResult = SQLExec(lnHandle, "SELECT * FROM message ", "cOutData1")
CATCH
wait window 'no sql connection'
ENDTRY
it works fine but if I lost the internet connection it does not goto my catch option instead it comes back with Microsoft SQL Server Login connction failed error
when I click ok it pops up another screen and gives me the oprion to change login id and password then try to connect again.
What I would like to happend when the connection fails is to goto catch option , wait window 'no sql connection'
Please help
Thanks
I am using the following connection string from fvp9 to connect to a remote sql database.
FMS_SERVERIP= '235,256,258,99' my remote sql server ip
lcStr = "Driver={SQL SERVER};Server=&FMS_SERVER
try
lnHandle = Sqlstringconnect(lcStr)
lnResult = SQLExec(lnHandle, "SELECT * FROM message ", "cOutData1")
CATCH
wait window 'no sql connection'
ENDTRY
it works fine but if I lost the internet connection it does not goto my catch option instead it comes back with Microsoft SQL Server Login connction failed error
when I click ok it pops up another screen and gives me the oprion to change login id and password then try to connect again.
What I would like to happend when the connection fails is to goto catch option , wait window 'no sql connection'
Please help
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
IF lnHandle > 0
WAIT WINDOW "There is connection"
ELSE
WAIT WINDOW "There is no connection"
ENDIF