SQL Server does not exist or access denied

Hi,
 I have developed a small application using VB6 on Windows XP. Following is the code snapshot. I have added Microsoft ActiveX Data Objects 2.1 Library through Project Reference for ADODB Connection.

Public con As New ADODB.Connection

Public Sub Main()
    Set con = Nothing
    With con
       .CursorLocation = adUseClient
       .ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SCMSUG;Data Source=Admin\local"
       .Open
    End With
End Sub

I tried above code for connecting to a remote SQL Server database on LAN. But it is giving me the following error

Run-time error'-2147467259 (80004005)':
[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied.

Any Suggestions




Answer this question

SQL Server does not exist or access denied

  • yaarit

    About 99.9% of the time (give or take 0.1%), that error means the SQL Server that you've named can't be reached.  This can be because it's blocked by a firewall, not on the same network as you, or you simply misspelled it.

    -Ryan / Kardax

  • haibing

    Is your SQL Server installed as a default instance on your box named 'admin' If it is, try changing 'Data Source=admin\local' to ''Data Source=admin'.
  • nickicha

    THANK YOU!!!

    I replaced my Data Source from "Data Source=DSN" to "Data Source =(local)" and it worked like a charm!

    My string is:
    ConstantName = "Provider=SQLOLEDB;Data Source=(local);Initial Catalog=DatabaseName;Integrated Security=SSPI"

  • Michael Baarz

    Hi I have installed Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A on a server running windows server 2003. It all installs fine and the services run. But when i try to connect the following error message appears. Please can any one help.

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

  • eric8910

    Thanks for reply , but didn't work. windows firewall is off.
    My Computer name is admin. SQL server group name is ACM and Database name is SCMSUG.
    What should be the connection string. i am using ADODB.connection for database connectivity.

    Reply ,
    Thanks in advance.

  • tomk_vsts_user

    I had exactly the same problem once upgrading from SP1 to SP2 XP and was able to fix the problem by using "(local)" i.e. Server=(local) for an ADO connection instead of my machine name which worked on SP1.
  • SergioTorres

    Thank you David !!! I replaced

    <add key="Servername" value="localhost"

    with

    <add key="Servername" value=""

    worked like a beauty!!!!!

  • tc1109

    I too am getting the error and have tried things from other posts to no avail. Here are the details:

    I have XP pro SP2 and all fixes
    Zone labs integrity client (All SQL items are trusted)
    Symantic AV

    I open up Visual Studio.net 2003 to the Server Explorer

    When I installed MSDE i was told (by the error that came up when I didnt put it in)
       setup.exe sapwd=abc123      'I created just a simple password

    I navigate to the following server
       HOMEPC\AMS

    When I click on the (+) it prompts me for SQL Server Logon and password

    I put in the password (default was already in logon field) and got the error message

    'SQL Server does not exist or access denied'

    I have also tried numerous other passwords, no password, starting the SQLAGENT.  I am new to SQL Server (havent learned it yet, trying to learn VB.NET first)


  • mdegi

    Are you trying to connect to the MSDE 2000 instance locally or remotely

    In an effort to provide customers with more secure products, Microsoft Windows Server 2003 supports MSDE 2000 with SP3 or later. Find more information here:

    http://www.microsoft.com/sql/howtobuy/windowsnetsupport.mspx

    You can find further information on how to configure your SQL Server to be accessible over the network by enabling TCP, in Microsoft KB Article 841252.

    Hope this helps.



  • Infiniti

    GOOD DAY.
    I am also getting this error message. I am trying to connect from a remote pc using oledb connection. I havent checked if a firewall is on. but is there is a firewall do i have to disable it is there any way i can access the server without disabling the firewall thank you.

  • droby10

     ShimpiSuhas wrote:

    Data Source=Admin\local



    I think you can use  Data Source=(local) if you are tring to connect to a server on the same machine
    or Data Source=Admin if you are tring from anywhere (including the same machine)


  • joan leon

    I met similar issue by using this connection string:
    "Provider=SQLOLEDB;Data Source=xxx;UID=xxx;PWD=xxx;Database=xxx;"

    And fixed it by using:
    "OLE DB Services=-2;DRIVER={SQLServer};Data Source=xxx;UID=xxx;PWD=xxx;Database=xxx;"


  • E_l_i

    Try for the server name just .
    This sounds crazy but it work for my setup.


  • Sunil Pillappa

    I had to install SQL Server Service Pack 3a to resolve my problem with the 'SQL Server does not exist or access denied' error message.

    Wayne
     


  • SQL Server does not exist or access denied