Results 1 to 13 of 13

Thread: sql server does not exist - oh but it does!

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    sql server does not exist - oh but it does!

    Guys

    I have a couple of lines of code:

    VB Code:
    1. if request.servervariables("HTTP_HOST") = "localhost" Then
    2.     strConnex = "Provider=sqloledb;SERVER=MyLapTop;UID=MyUID;PWD=MyPWD;DATABASE=MyDB"
    3. else
    4.     strConnex = "Provider=sqloledb;SERVER=mywebserver;UID=MyUID;PWD=MyPWD;DATABASE=MyDB"
    5. End if

    which, on my laptop (MyLapTop) works just fine. I have another machine, however, sitting right next to me on the same network that can open and query the database on my laptop from Enterprise Manager/Query Analyser however when I try to use the bit of code above I get the error:

    Microsoft OLE DB Provider for SQL Server (0x80004005) [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    This is when I try to open the connection using:

    VB Code:
    1. Set counterConn = Server.CreateObject("ADODB.Connection")
    2.             counterConn.open strConnex

    If, however, I comment out the test for localhost and go straight out the the webserver database then that connects ok.

    Any ideas?!

    Incidentally, I'm pretty sure that this worked before I went on holiday. I don't know, leave a network engineer in charge of things for 2 weeks and look what happens......!
    Last edited by thebloke; Jul 22nd, 2005 at 06:12 AM.
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width