Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    40

    Unanswered: ASP Code to connect to SQL Server 2000

    Can anyone provide a generic connection to SQL Server 2000 via ASP

    I am in the process of upsizing to SQL Server and need to learn the new conneciton string vs what I use now for MS Access

    Here is my current connection in MS Access:

    <% Set objConnST = Server.CreateObject("ADODB.Connection")
    MdbFilePath = Server.MapPath("../Database/AmigosHCTracker_TEST.mdb; Password=password")
    objConnST.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
    strsqST = "SELECT * FROM tbl_Location where State = 'MD' Order By State, CourseName"
    Set objRSST = objConnST.Execute(strsqST) %>

    Here is what I have so far that is bombing out:

    <%
    Set objConn4 = Server.CreateObject("ADODB.Connection")
    objConn4.open "DSN=sql.93524;UID=golfinamigos;PWD=password;DATAB ASE=amigosSQL"
    strsqST = "SELECT * FROM tbl_Location where State = 'MD' Order By State, CourseName"
    Set objRSST = objConnST.Execute(strsqST) %>


    This is the error:

    Microsoft VBScript runtime error '800a01a8'

    Object required: 'objConnST'

    /AreaCourses/Test_DSN.asp, line 5



    Any help would be most appreciated!

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    <%
    Set objRSST = objConn4.Execute(strsqST)
    %>

Posting Permissions

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