claghorn
asked on
Can't connect Visual Basic 6.0 to SQL Server 2005.
receiving this error with the following code. "named pipes provider unable to open a connection with sql server [53]
.ConnectionString = "Provider=SQLNCLI;" & _
"Server=servername" & _
"Database=databasename;" & _
"Uid=userid;" & _
"Pwd=password;"
Named pipes is enabled on server so I don't know what else to check. I'm using Active X ADO version 2.6 with Visual Basic 6.0
.ConnectionString = "Provider=SQLNCLI;" & _
"Server=servername" & _
"Database=databasename;" & _
"Uid=userid;" & _
"Pwd=password;"
Named pipes is enabled on server so I don't know what else to check. I'm using Active X ADO version 2.6 with Visual Basic 6.0
Is the servername the correct one ? If the SQL Server is not the default instance, you should include the name of the instance. For example: MyMachine\SQLEXPRESS ...
Hope this helps ...
Hope this helps ...
ASKER
Yes, server is set to receive remote connections using both TCP/IP and Names Pipes. The server name I am using in my connection string is correct. It is not Express.
And you are able to connect to the SQL Server from that machine using sqlcmd ? ... or any other tool ?
ASKER
Yes, I get a response. ie:
sqlcmd -S myServer\instanceName
I get a 1>
I also connect using my SQL Server Client Tools. ie: Management Studio
sqlcmd -S myServer\instanceName
I get a 1>
I also connect using my SQL Server Client Tools. ie: Management Studio
ASKER
The database "servername" according to connection properties of sqlserver has a backslash in it. The instance name does not. Not sure if this is relevant to my problem though. It would make things easier to deal with if the server name had a one word name with no backslash I suppose. If sql server shows it as a backslash then why must I use a forward slash when expressing it in my connection string?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Using a backslash results in error:
SQL Network Interfaces Error Locating Server/Instance specified. [xFFFFFF]
SQL Network Interfaces Error Locating Server/Instance specified. [xFFFFFF]
ASKER
I noticed the semicolon was missing. oooops. Well we covered the other things to check anyways.
:-)
ASKER
But you did help me notice this though because you got me back into thinking that I WAS supposed to be using the backslash.
"Server=servername\instanc ename" & _
How can we get te instancename for above statement?
How can we get te instancename for above statement?
Programs > Microsoft SQL Server 2005 > Configuration > Surface Area Configurations