Results 1 to 4 of 4

Thread: Error with connection to DB

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Alberton, Gauteng, South-Africa
    Posts
    48

    Angry

    Hi ther Guy's

    I'm trying to connect to a DB from with-in a ASP page we tried using a DLL but no joy. so I'm writing them over to connect from with-in a asp page.

    My code are as follow:

    <%
    Set conn = Server.CreateObject("ADODB.Connection")
    Set objRec = Server.CreateObject("ADODB.Connection")

    conn.Open "Provider=SQLOLEDB;DSN=196.33.166.151;UID=guest;PWD=;Database=Alchemy"
    objRec.ActiveConnection = conn
    objRec.Open "SELECT * from Users"

    While not objRec.EOF
    Response.Write objRec("Users_UID") & " "
    Response.Write objRec("Users_PWD") & " "
    objRec.MoveNext
    Wend

    objRec.Close
    conn.Close
    %>

    I get the following error:

    [DBNMPNTW]Specified SQL server not found.

    *********
    I tried using the IP Address of the Server as well as the DSN but both way's it's not working.

    The Data Sourse name is registered in the System DSN.

    Thanks in advance
    ;-)
    Jaco
    South-Africa

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    your DSN should be in the File DSN and in your asp just
    give the name of your dsn:

    conn.Open "Provider=SQLOLEDB;DSN=yourDsnName;UID=guest;PWD=;Database=Alchemy"

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Alberton, Gauteng, South-Africa
    Posts
    48

    Unhappy

    Hey Sebs

    Thanks for the help thus far.

    I changed it like you said but I still get Specified SQL server not found ... I have it in System DSN, User and File but now go .. what am I doing wrong?

    Thanks for the hlep
    ;-)
    Jaco
    South-Africa

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    try this for your connection string:

    Provider=SQLOLEDB;Data Source=196.33.166.151;UID=guest;PWD=;Database=Alchemy

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