Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Connection (Server Name verus IP address)

Status
Not open for further replies.

BlakeK

Programmer
Oct 1, 2001
59
US
We have a project in VB 6 which connects to a SQL2K server, using a DSN-less ADO connection. Currently it uses the name of the server in the connection string.
We have no problems at most of our remote sites, but our one site has very slow response times in running queries, and we thought this might be a resolution problem with finding the SQL server. I thought we might try using the IP address, insetad of the server name, in the conneciton string, in case the problem was being caused by some missing information at the one remote site, like a hosts file entry missing.

The current ConnectionString was:

ConnectString = ""
ConnectString = ConnectString & "DRIVER={SQL Server};"
ConnectString = ConnectString & "SERVER=SSQL;"
ConnectString = ConnectString & "DATABASE=eNCast;"
ConnectString = ConnectString & "NETWORK LIBRARY=DBMSSOCN;"
ConnectString = ConnectString & "TRUSTED_CONNECTION=YES;"

I changed this to be:

ConnectString = ""
ConnectString = ConnectString & "DRIVER={SQL Server};"
ConnectString = ConnectString & "SERVER=192.168.1.21;"
ConnectString = ConnectString & "DATABASE=eNCast;"
ConnectString = ConnectString & "NETWORK LIBRARY=DBMSSOCN;"
ConnectString = ConnectString & "TRUSTED_CONNECTION=YES;"

to my surprise, this made the connection extremely slow at all the sites which were quick when using the name!
I thought the name and IP were supposed to be interchangeable? Why would this change have slowed the sites which didn't used to work?

And to the root of the problem, any thoughts on why an ADO connection would only be slow at a given location, that may be the problem of the connection method?

Thanks. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top