[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

S

Savas Ates

in asp page
im getting this error how can i solve it..
yesterday the codes work but i setup visual studio 6.0 now it doesnt
works..
 
R

Ray Costanzo [MVP]

What does your connection string look like? Are you connecting to the SQL
Server by its host name? If so, can your server resolve that name? Is
there a firewall in between? Is the server's network cable unplugged?

Ray at work
 
S

Scott Ivey

I have the same problem. We recently moved our ASP app from Windows 2000 to
Windows 2003 Web servers, and when we did this our problems started popping
up. When we moved to the new servers, we also changed the connect strings
from using ODBC DSN's to OLEDB connect strings. To troubleshoot if that was
the cause, we copied the modified app back to the 2000 box, complete with
the new connect strings, and never saw the error happen there. We've tried
adding adding "Network Library=dbmssocn" into our connect strings, but that
didn't help. We added the SQL server to the hosts & lmhosts.sam files, and
did the same on the SQL server (added the web servers to the files) - but
that didn't help. We used the client network utility to enable both TCP/IP
& Named Pipes on the web servers - but that didn't help.

I've seen too many other posts on google to believe that this is an isolated
problem. I've also seen posts that made me believe that this has something
to do with going from Win2000 to Win2003.

The error is very sporadic. We have 100+ users on the app all day long, and
only every once in a while the error happens. If the user hits refresh
right after the error, the connection work just fine.


Please help!

Scott Ivey
 
A

Aaron [SQL Server MVP]

Are you connecting to the server by name, external IP, internal IP, ...?

Can you show the connection string that doesn't work and the ODBC parameters
that work?

--
http://www.aspfaq.com/
(Reverse address to reply.)
 
S

Scott Ivey

I've tried the following connect strings...

"Provider=SQLOLEDB;Data Source=revsql01;Initial Catalog=RPM;User
ID=rpmuser;Password=xxxxx"
"Provider=SQLOLEDB;Data Source=revsql01.revonet.local;Initial
Catalog=RPM;User ID=rpmuser;Password=xxxxx"
"Provider=SQLOLEDB;Data Source=revsql01;Initial Catalog=RPM;User
ID=rpmuser;Password=xxxxx;Network Library=dbmssocn"
"Provider=SQLOLEDB;Data Source=revsql01.revonet.local;Initial
Catalog=RPM;User ID=rpmuser;Password=xxxxx;Network Library=dbmssocn"

I'm currently using string #2 above. The ODBC DSN's were system DSN's, and
used the DB name, username, & password as above.

Using #2, I can connect a thousand times successfully, and have 1 error
somewhere in the middle.

The servers are connected to the same Catalyst 2950 switch, and they all
have hard wired hosts files - so I can't imagine that resolving the other
server is a problem.


Scott
 
A

Aaron [SQL Server MVP]

The servers are connected to the same Catalyst 2950 switch, and they all
have hard wired hosts files - so I can't imagine that resolving the other
server is a problem.

For #2, have you tried using an IP address instead of a server name? DNS
(not DSN), WINS etc. can be flaky occasionally, and I'm sure that could
account for 1 in 1000. It could also be the switch going down briefly, or
some other network glitch.

A
 
S

Scott Ivey

I'm going to try going by IP address tonight. Shouldn't using a hosts file
entry override any DNS issues?


Scott
 
A

Aaron [SQL Server MVP]

I know that the web browser uses the hosts fle, but I'm not confident ado
will do the same thing. I'm pretty sure SQL Server, at least, will attempt
to use the client network library before it ever looks at the hosts file.
Did you set up anything in the client network library? Are you planning to
change the IP (in other words, is there some big reservation against
changing the IP instead of continuing to kludge a hosts file)?

--
http://www.aspfaq.com/
(Reverse address to reply.)
 
S

Scott Ivey

I have no problem with hardwiring the IP - I don't expect that to change
anytime soon :) I just added 2 aliases for the server (revsq01 &
revsql01.revonet.local) in the client network utility using TCP/IP and
pointing at the IP address of the server instead of the DNS name. Hopefully
this will fix it :)


Scott
 
S

Scott Ivey

Well, I added the 2 aliases..

revsql01 - TCP/IP - pointed to the SQL IP address, dynamic port number
revsql01.revonet.local - TCP/IP - pointed to the SQL IP address, dynamic
port number

My connect string is "Provider=SQLOLEDB;Data
Source=revsql01.revonet.local;Initial Catalog=RPM;User
ID=rpmuser;Password=xxxxx"

and a half hour later, I'm getting errors. guess that isn't the fix. damn!

I've tried everything I can think of, and still am struggling.

Scott
 
A

Aaron [SQL Server MVP]

revsql01 - TCP/IP - pointed to the SQL IP address, dynamic port number
revsql01.revonet.local - TCP/IP - pointed to the SQL IP address, dynamic
port number

My connect string is "Provider=SQLOLEDB;Data
Source=revsql01.revonet.local;Initial Catalog=RPM;User
ID=rpmuser;Password=xxxxx"

Is it running on port 1433, or another port?
 
A

Aaron [SQL Server MVP]

Have you tried connecting with a different user name? And/or using the
shorter server name (not sure what you're gaining from
revsql01.revonet.local, unless you're trying to practice your typing
skills)? And/or using the IP address in the connection string?

--
http://www.aspfaq.com/
(Reverse address to reply.)
 
S

Scott Ivey

Haven't tried different users. I had the FQDN in the connect string because
I thought that would fix any DNS resolution problems, if that was the
problem. I'm going to try putting the IP address directly in the connect
string tonight - can't do it during the day without causing an application
restart.

Scott
 
S

Scott Ivey

The strange thing about it all is that when I copy the entire web directory,
including any connection strings, back to my win2000 server, everything
works fine - no errors ever.


Scott
 
S

Scott Ivey

I changed the connect string to use the IP address - and still get the
errors. I don't get it - this just should not be happening. New connect
string is...

"Provider=SQLOLEDB;Data Source=192.168.200.40;Initial Catalog=RPM;User
ID=rpmuser;Password=xxxxx"


MS - are you watching this post??? I'm posting with my MSDN alias - and
we're now at the deadline for resolution for my MSDN Managed Newsgroup
support. I had opened a support incident before posting this, but had
opened it with the Cluster group (since the website is on 2 servers running
NLBS), and they were unable to help me, so I cancelled the ticket. Anyone
have any ideas on which group should handle this?


Thanks,
Scott
 
B

Bob Barrows [MVP]

You should try forcing TCP/IP to be used with the Network Library attribute
in your connection string.:

Network Library=DBMSSOCN;"

Bob Barrows
 
S

Scott Ivey

I've tried that, but it didn't help. I've also used the Client Network
Utility to force TCP/IP, but that didn't help either.


Scott
 
B

Bob Barrows [MVP]

Then I don't understand why you are seeing DBNETLIB in your error
statement...

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top