>>>>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.
>>
>>AERROR.
>>
>>IF lnSqlHandler < 1
>> AERROR(laError)
>> MESSAGEBOX("Could not locate Sql Server Database ... Please contact Software Support" + CHR(13)+laError[1,2],48,'Kernel Software')
>> close all
>> RETURN
>>ELSE
>> ..
>>ENDIF
>>
>
>Yes, that's what I was thinking.
Thanks for the suggestion, this is giving me more information. The message I'm getting is below. Tried google but I'm not finding the solution to it. The ODBC driver for SQL Server is installed
Connectivity error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
~M
Go raibh maith agat
~M