Solved

SQL Connection Issues

Posted on 2008-10-15
19
298 Views
Last Modified: 2012-06-27
Hello mates,

I am extremely puzzled at what is going on with our SQL Server.

We set up an ODBC data source to connect on our SQL2000 server to point to another SQL2000 server in a remote location. This has worked now for the last 3 years until the SQL Server that the ODBC was pointing to was upgrated from SQL2000 to SQL2005.

Suddenly, the connection is broken.

I went to the ODBC data source and tested the connection and it says, "Connection was successful".

However, when I tested my code, I still get the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

What could be wrong here!

Just to be sure I have covered all bases, here is the line on my code that is throwing this error:

Conn.open session("riff01")

riff01 is the dsn name.

Any help would be greatly appreciated.
0
Comment
Question by:sammySeltzer
  • 10
  • 9
19 Comments
 
LVL 29

Expert Comment

by:Badotz
ID: 22721325
This has helped me with connection strings in the past:

 1. In Notepad, or any other text editor, create a file named Temp.udl  

 2. Leave the file empty and save it to the Desktop

 3. Double-click the Temp.udl file

 4. The Data Link Properties dialog box appears

 5. In the Data Link Properties dialog box, click Provider. Select the appropriate provider from the list

 6. Click Connection and select the corresponding name of the server and the database
    Type the User Name and the Password
 
 7. Click Test Connection to test the connection

 8. Click OK

 9. Right-click Temp.udl and click 'Open With'
   
    If Notepad shows up as an option, click it, otherwise click 'Choose Program' and navigate
    through the list to notepad and select it

10. Copy the connection string to your application

0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22721456
Thanks for your prompt response.

I have used that before too but in this case, I am using dsn name.

can I still use the udl to create dsn name?

I can't seem to have a GO on that.
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22721491
I take that back. I was able to test the udl using dsn name and it said connection succeeded.

I might add as well that when I ran a query in query analyzer trying to connect to the db on the remote server, it worked just fine.

So, the issue appears to be something else that I can't seem to figure out.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22721552
I received the dreaded "80004005" error on a connection string. By placing "ODBC;" at the front of the connection string, the error went away and everything was OK. You might give that a shot (since the lights are still out and we're firing at will ;-)
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22721658
Just to be sure, you said I should put it like the example below?

ODBC Conn.open session("riff01")  no?
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22721762
No, in my case it was

conn_string = "ODBC;DSN=MY_DSN;DBQ=C:\DE\FGHIJK\LMNOP\QRS;NullStrings=0;SERVER=NotTheServer"
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22722662
Hi Badotz,

Unless I am doing something wrong, this is what I have:

         Conn.Open = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=myusername;PWD=mypassword; Initial Catalog=POlintral;Data Source=PRITRAL"

and it keeps telling me that the server (data source) not found, to add sp_addlinkedserver. This is already added. Infact when I tried doing it again, it told me that it is already added.

Yet, when I test it with the udl, it says, "connection succeeded".

I am very, very confused right now and everyone is screeming at me.

HELP, PLEASE!!!

Maybe you can help me include the Network zone into this posting. It is beginning to look more like a network issue.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22722748
Try this:

Conn.Open = "ODBC;Provider=SQLOLEDB.1;Persist Security Info=False;User ID=myusername;PWD=mypassword; Initial Catalog=POlintral;Data Source=PRITRAL"
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22722826
It says data source name not found. I know the data source name is correct.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 29

Expert Comment

by:Badotz
ID: 22723091
Then something somewhere else is wrong (obviously, DUH Badotz).

Did you check with the manufacturer to verify their driver that worked in SQL 2000 server also works in SQL2005 server?
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22723570
Did you check with the manufacturer to verify their driver that worked in SQL 2000 server also works in SQL2005 server?
hmmm, good question!

The manufacturer will be Microsoft?

They own the server and the sql server db (both 2000 and 2005).

The app was developed by us in house and we used odbc to create the dsn.

I am even more confused now, LOL
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22723690
Sorry, I'm famous for stating the obvious ;-)

But as with any app, incompatabilities abound. It is possible that some naming convention changed between versions?

Wish I could be of more help...
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22723748
You have been extremely, extremely helpful and I am truly grateful.

When I laughed out loud, it was more out of frustrations.

Please don't take it the wrong. I am truly grateful for your patience and continued assistance.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22723761
No worries!
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22723804
My biggest worry is that a week or so ago, our networks team relocated the server and changed the IP Address. However, the servername remained the same.

The problem may have started then but we didn't catch it till yesterday.

Now, all they keep telling me is that nothing changed except IP Address but obviously something else changed.

As I stated earlier, If I copy a code and run in in the server from SQL Analyzer, it returns the result fine.

If however, I run from the browser with my asp code, I run into the issues we have been trying to resolve and I have been struggling with this issue since yesterday.

Thanks again for all your help.
0
 
LVL 29

Accepted Solution

by:
Badotz earned 50 total points
ID: 22723902
>>nothing changed except IP Address

Despite their "best efforts", this is a lie. Otherwise you would not have a problem.

When I worked in the IT department of a Large Firm, we had a haiku:

We hate computers,
We hate computer users.
Can you feel the love?

This always lifted my spirits just by reading it ;-)
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22724226
Thanks many times.

I can't ask from you anymore than you have given me.

Thanks again
0
 
LVL 28

Author Comment

by:sammySeltzer
ID: 22724233
I will close this and try the network zone. they may know a few tricks to share.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 22724488
Thanks. Good luck!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now