Microsoft OLE DB Provider for SQL Server error '80004005' unable to connect remotely to database

Dear experts,
I have an ASP file on a webserver that needs to connects to a database server remotely. But for some reason it doesn't allow me to do so. I know it is not the database server problem because I tried connecting to it with another computer and IT WORKS data comes out. I tried using a DSN connection on the web server and "TESTS COMPLETED SUCCESSFULLY", but I still cant' get the data to come up on my ASP page.


the error on the ASP page is
Microsoft OLE DB Provider for SQL Server error '80004005'
 "client unable to establish connection"

 I've also tried directly connecting to SQL server which still doesnt' work.

the error on the ASP page is
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNMPNTW]Access denied.


 I'm pretty sure that it is the web server restricting access but don't know how to unenable it. Any suggestions would be appreciated. I'm on a company network. Is this a problem? I'm getting desperate on this one.

Peter
tienluongAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
PashaModConnect With a Mentor Commented:
Closed, no points refunded.
PashaMod
Community Support Moderator
0
 
drichardsCommented:
Is your SQL Server set up for "Windows ony" authentication?
0
 
Bob LambersonSoftware EngineerCommented:
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
RonaldKunenborgCommented:
I suggest you take a look at the SQL server setup, just as drichards said. I had the exact same problem.
This is caused by the webserver trying to use the account under which the webserver is running to access the database. This account usually has NO permission to access the database.

To solve it, set up SQL server to allow access by using accountname/password login.

Also, if you are already using this way to access the database, try writing the connect statement anew. Maybe you overlooked a space or quote somewhere?

Good luck,
Ronald.
0
 
dileedilCommented:
Dim connection

set connection=Server.CreateObject("ADODB.Connection")
connection.ConnectionString = "Provider=SQLOLEDB; Data Source=SourceName; Initial Catalog=CatalogName; User ID=sa; Password="
connection.open

Try to set Connecting String like this , This is a solution for you,
Thanks
0
 
RonaldKunenborgCommented:
Hi TienLuong,

if you answered the question, please share your answer with us so we may benefit in the future. The answers given above are the most straightforward ones, so if you have a really different problem your answer may help someone in the future.

Regards,
- Ronald.
0
All Courses

From novice to tech pro — start learning today.