locked
Internal Server error when submitting data to Access db RRS feed

  • Question

  • User221306376 posted

    I am trying to create a website that takes input from users and then updates a table in MS Access db.

    I have a plain html form that takes the imput and in the action I entered the asp file name.

    Once a user clicks on submit on the html page I get the 500 internal server error.

    I properly uploaded the files on the server,

    I have created a DSN on the server, but cannot see the DSN under the "Select ODBC DSN" when I try to create a connection from DreamWeaver.

    I am using a 64 bit machine so nto sure if that might be causing the problem.

    Here is code form asp file :

    <% @ Language="VBScript" %>
    <% Option Explicit %>
    <html>
    <head>
    <title>Form to database</title>
    </head>
    <body>
    <%
    'declare your variables
    Dim name, email, comments
    Dim sConnString, connection, sSQL

    ' Receiving values from Form, assign the values entered to variables
    name = Request.Form("name")
    email = Request.Form("email")
    comments =Request.Form("comments")

    'declare SQL statement that will query the database
    sSQL = "INSERT into users_tbl (name, email, comments) values ('" & _
    name & "', '" & email & "', '" & comments & "')"

    'define the connection string, specify database
    'driver and the location of database
    sConnString=("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='d:/hosting/6859771/html/access_db/Users.mdb';User Id=;Password=")


    'create an ADO connection object
    Set connection = Server.CreateObject("ADODB.Connection")

    'Open the connection to the database
    connection.Open(sConnString)

    'execute the SQL
    connection.execute(sSQL)

    ' Done. Close the connection object
    connection.Close
    Set connection = Nothing

    response.write "The form information was inserted successfully."


    %>
    </body>
    </html>

    Wednesday, October 20, 2010 3:01 PM

Answers

  • User-1199946673 posted

    All forums on www.asp.net are intended for ASP.NET (.aspx) related questions only, you're using classic ASP (.asp). Please ask your question(s) on another forum.

    And yes, most likely the problem is your server (64 bit).

    http://tinyurl.com/29jgs78

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 20, 2010 5:03 PM