Connecting to SQL 2000 remotely SQLOLEDB

Posted on 2007-10-12
Medium Priority
Last Modified: 2010-05-18

This is driving me MAD.

I have a server  that I am trying to connect to, Win2003, SQL2000, IIS V6.
Now, I am able to connect to the SQL database Locally. However not remotely. Getting the following error:
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/includes/conn.asp, line 22
I have TCP/IP protocol enabled, no firewall enabled, default security MSDE/MSSQL permitted.

My connection string looks like this: see below; I am using the IP address on this remote connection, thats the only difference between this and the local connection that works, I have tried the local connection using the same IP and it works as well.  I think that this may not be my connection string but some other server setting that is not permitting remote connections?  

<% Option Explicit %>
  dim db_server,db_userid,db_password,db_name,conn

  db_server="**.***.***.**"                  'database server name
  db_userid="****"                        'Database User ID
  db_password="********"            'Database Password
  db_name="*******"            'Database Name

  dim conString
  set conn=Server.CreateObject("ADODB.Connection")

  conString="Provider=SQLOLEDB.1;Password=" & db_password & ";Persist Security Info=True;User ID=" & db_userid & ";Initial Catalog= " & db_name & ";Data Source=" & db_server


Question by:Tony-laptops
  • 3
  • 2

Expert Comment

ID: 20070027
Try this
    Open a notepad at the web server and save it as test.udl. Now just double click the notepad to open the datalink properties and set the connection using the wizard and test the connection. Do not forget to select the OLEDB for SQL Server as provider.  If connecton is successful then you can just open the file in notepad and use the connection string.
If on putting the IP address  on the server name and providing the user credential does not connect to the server then could be that the IP address is not accessible from the web server(try pinging) .

Expert Comment

ID: 20070030
Correction - You need to double click the saved test.udl.

Author Comment

ID: 20070047
Ok, I got a similar error message:

So that I make myself clear, I have 2 separate servers on 2 IP addresses.  I am trying to connect from server 1 to server 2.

I have done the test from server 2 (test.udl) using server 1 IP address, got error:
Test connection failed because of an error in initializing provider, DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

When I try this on server 1 using server 1 IP, connection is OK.

Accepted Solution

assyst earned 500 total points
ID: 20071171
So that means server 1 is not able to communicate with server 2. So first you need to make sure that both servers can communicate. Did you ping server 2 from server 1 (Start > Run > ping Server2). If you get no reply then talk to your network guy (if there is one :) ) to make sure that Server 1 can communicate to server 2.

Author Comment

ID: 20071510
Hi Assyst,

The host was restricting the connections. Basically, I needed to create a private LAN between the 2 servers (extra money of course) now its all working.

Thanks for your help.

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

807 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