cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jinho292
Level 3

Problem while establishing a connection.

My app allows user browse SQL Server (I use function SQLBrowse2( szConnection, svServer )).
User have to provide conn type (win or sql), username, pwd.
My app have a button to test connection (use function SQLRTTestConnection2( szConnection, szServer, szDB, szUserName, szPassword, bTrust) to test).

I met the following trouble: If szServer is SQL Server's IP, test conn will be successful. But if szServer is the name of SQL Server (value return from function SQLBrowse2), test conn will be failed (return code = 1:The function failed to establish a connection.)
However if szServer is my PC's name, the connection will be successful.
Plz give me a solution, thank you very much.
Labels (1)
0 Kudos
(1) Reply
hidenori
Level 17

Are you trying to connect to the default instance (MYPC) or a named instance (MYPC\SQLEXPRESS)?
0 Kudos