Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    10

    Unanswered: Guestbbook at brinkster problem

    Hey nice ppl

    I have set up a guestbook at brinkster with this code
    __________________________________________________ __
    Guestbook.asp
    <html>
    <head>
    <title>ASP Guestbook</title>
    </head>
    <body>

    <font face="ARIAL" size="2" color="BLACK"><b>
    Welcome to my guestbook...</b></font></p>
    <FORM METHOD="POST" ACTION="guestbookThankYou.asp">
    Name: <INPUT NAME="name" size="33"><br>
    Email: <INPUT NAME="email" size="33"><br>
    URL: <INPUT NAME="url" size="33"><br>
    Message: <textarea rows="6" name="message" cols="30">
    </textarea><br>
    <INPUT TYPE="SUBMIT" VALUE="SEND">
    <INPUT TYPE="BUTTON" VALUE="VIEW GUESTBOOK"
    onClick="location.href='guests.asp';">
    </form>
    </body>
    </html>
    __________________________________________________ __
    Guests.asp

    <html>
    <head>
    </head>
    <body>

    <p>Guestlist entries....</p>
    <%
    openStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/db/dbguests.mdb")
    Set cn = Server.CreateObject("ADODB.Connection")
    cn.Open openStr, UserID, Password
    SQL = "SELECT * FROM guestbook ORDER BY 'ID' DESC"
    Set record = Server.CreateObject("ADODB.Recordset")
    record.Open sql, cn
    record.MoveFirst
    Do While Not record.EOF
    Response.Write"<b>Date</b>: " & record("todaysDate").Value & "<br>"
    Response.Write"<b>Name</b>: " & record("name").Value & "<br>"
    emailValue=record("email").Value
    Response.Write"<b>Email: </b>" & _
    "<A HREF='mailto:" & emailValue & "'>" & emailValue & "</A><br>"
    urlValue=record("url").Value
    Response.Write"<b>URL: </b><A HREF='" & _
    urlValue & "' target='blank'>" & urlValue & "</A><br>"
    Response.Write"<b>Message</b>: " & _
    record("message").Value & "<br>"
    Response.Write"<hr width='80%'>"
    record.MoveNext
    Loop

    record.Close
    Set record = Nothing
    cn.Close
    Set cn = Nothing
    %>

    </body>
    </html>
    __________________________________________________ __
    guestThankyou.asp

    <html>
    <head>
    </head>
    <body>

    <p>Thank you for signing my guestbook...</p>
    <FORM METHOD="POST" ACTION="guests.asp">
    <%
    Set cn = Server.CreateObject("ADODB.Connection")
    openStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/db/dbguests.mdb")
    cn.Open openStr
    SQL = "SELECT * FROM guestbook"
    Set record = Server.CreateObject("ADODB.Recordset")
    record.Open sql, cn, 2, 2
    record.AddNew
    record("name") = Request.Form("name")
    record("email") = Request.Form("email")
    record("url") = Request.Form("url")
    record("message") = Request.Form("message")
    record("todaysDate") = Now()
    record.Update
    record.Close
    Set record = Nothing
    cn.Close
    Set cn = Nothing

    %>
    <INPUT TYPE="BUTTON" VALUE="VIEW GUESTBOOK"
    onClick="location.href='guests.asp';">
    </form>
    </body>
    </html>

    I have placed my db(dbguests.mdb) in the bd folder on brinkster and changed the server map path to Server.MapPath("/db/dbguests.mdb")

    When I go to my guestbook and submit the data I enter I get this error:

    Thank you for signing my guestbook...

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x898 Thread 0x2a0 DBC 0x101bb024 Jet'.

    /ozhorseasp/guestbookThankYou.asp, line 11

    Here is the url to my guestbook.
    http://www27.brinkster.com/ozhorseasp/guestbook.asp

    Any1 got any ideas where I am going wrong??

    Or should I be using some other guestbook for brinkster??

  2. #2
    Join Date
    Dec 2003
    Posts
    454

    your MapPath() may return a wrong path for your database file

    Since the MapPath() returns a virtual path to the corresponding physical directory on the server, your MapPath() will produce the following output c:\inetpub\wwwroot\db\dbguests.mdb. If your database file db\dbguests.mdb is not located under the c:\inetpub\wwwroot directory you will get the error message which is the same as the one you got.

    You can try to use Server.MapPath("../") to return the relative physical path to the page that is being viewed in the Web browser.
    Last edited by gyuan; 12-23-03 at 15:35.

  3. #3
    Join Date
    Dec 2003
    Posts
    10

    Thankx

    gyuan

    Thank you ill give that a go.

Posting Permissions

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