>This is the code that I run in my test program, the return value is -1. The connection strings I have tried are below. Both of these work on the server itself and also on the client machine that I installed sql server on. I have also tried a combination of both with ip addresses and they worked
>Driver={SQL Server Native Client 10.0};Server=SERVERNAME\SQLEXPRESS; Database=KernelData;Trusted_Connection=yes;
>Driver={SQL Server Native Client 10.0};Server=192.168.0.1\SQLEXPRESS; Database=KernelData;Uid=SQLUserName;Pwd=Password
>
>lnSqlHandler = SQLSTRINGCONNECT(constring)
>
>IF lnSqlHandler < 1
> MESSAGEBOX("Could not locate Sql Server Database ... Please contact Software Support_" + alltrim(str(lnSqlHandler)),48,'Kernel Software')
> close all
> RETURN
>ELSE
> wait wind "SQL connection Success" time 0.2
>ENDIF
>~M
This program doesn't tell us anything useful as why connection is failing. I did a quick search in our program and for the SqlStringConnect function and I don't see how to return SQL Server error back as to why connection is failing.
If it's not broken, fix it until it is.
My Blog