Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Unanswered: Email form results to ACCESS 2000

    Results are not being stored in ACCESSS, not getting any errors either.
    Can someone look at my code. I have read/write permis, and set up users.mdb dsn connection in odbc, and users.mdb table in ACCESS 2000
    ************************************************** *******
    <title>Form to Database</title>
    <!-- comment - start the HTML form and use a HTML table for formatting-->
    <form action="add_to_database.asp" method="post">
    <div align="center">
    <table width="80%" border="0">
    <td>Name :</td>
    <td><input type="text" name="name"></td>
    <td>Email :</td>
    <td> <input type="text" name="email"></td>
    <td>Comments :</td>
    <td><textarea name="comments"></textarea></td>
    <td><input type="submit" value="submit details" name="submit"></td>
    <!-- end the HTML form-->
    ************<% @ Language="VBScript" %>
    <% Option Explicit %>
    <title>Form to database</title>
    '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=" & Server.MapPath("Users.mdb")

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

    'Open the connection to the database

    'execute the SQL

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

    ' Done. Close the connection object
    Set connection = Nothing

  2. #2
    Join Date
    Jun 2004
    Florida, US
    I believe you could get better answers if you could try ASP forums. I can't figure it out what is the problem from code. sorry

Posting Permissions

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