Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Connection Issues

Posted on 2008-10-15
19
Medium Priority
?
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 29

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 29

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 29

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 29

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 29

Author Comment

by:sammySeltzer
ID: 22722826
It says data source name not found. I know the data source name is correct.
0
 
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 29

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 29

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 29

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 200 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 29

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 29

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

715 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