Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2003
    Location
    Brisbane
    Posts
    14

    Unanswered: What's wrong with this script?

    Could anyone look over this code and see what might be the problem?

    I am trying to use this script in an .asp page so that it will access data from a database and write it on the page... but all I get are error messages...

    I'm using SunOne asp and an access database called: database1.mdb

    ###################################
    <% @ Language="VBScript" %>
    <% Option Explicit %>
    <%
    Dim PeopleRS, sConnString, myConn, mySQL
    Set myConn= server.CreateObject("ADODB.Connection")
    sConnString="DSN=database1"
    myConn.Open sConnString
    mySQL = "Select * from People"
    Set PeopleRS = myConn.Execute(mySQL)
    Response.Write "<table>"
    do while not PeopleRS
    Response.Write "<tr>"
    Response.Write "<td>" & PeopleRS("ID").value & "</td>"
    Response.Write "<td>" & PeopleRS("People").value & "</td>"
    Response.Write "<td>" & PeopleRS("Comment").value & "</td>"
    Response.Write "</tr>"
    PeopleRS.MoveNext
    loop
    Response.Write "</table>"
    Set PeopleRS = nothing
    Set myConn = nothing
    %>
    ###################################

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    Post the error message you got.

  3. #3
    Join Date
    Dec 2003
    Location
    Brisbane
    Posts
    14

    error message

    The error message is thus:

    Error Type:
    ADODB.Connection.1 (0x80004005)
    SQLState: S1000 Native Error Code: -1045 [DataDirect][ODBC SequeLink driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Not a valid bookmark.



    Originally posted by gyuan
    Post the error message you got.

  4. #4
    Join Date
    Dec 2003
    Posts
    454
    Did you test your ODBC connection?

  5. #5
    Join Date
    Dec 2003
    Posts
    454
    Try this:

    sConnString = "DRIVER={Microsoft Access Driver(*.mdb)};"
    sConnString = sConnString & "DBQ=..\..\....\Database.mdb"

  6. #6
    Join Date
    Dec 2003
    Location
    Brisbane
    Posts
    14

    DSN less Only

    My server host will only support DSN less. It will not support DSN path access.

Posting Permissions

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