Adding Records to ACCESS

Results 1 to 2 of 2

Thread: Adding Records to ACCESS

  1. #1
    Gil Guest

    Default Adding Records to ACCESS

    1. Build a form on your user&#039;s page<BR>2. Put in three fields named “Field1” . . . “Field3”<BR>3. Add a SUBMIT button<BR>4. Set the ACTION property of the form to the target page<BR>5. On the target page add this script:<BR><BR><BR>Field1Value = Request.Form("Field1")<BR>Field2Value = Request.Form("Field2")<BR>Field3Value = Request.Form("Field3")<BR><BR><BR>ActionSQL = "INSERT INTO YourTableName ( Field1, Field2, Field3 ) " _<BR>& "SELECT &#039;" & Field1Value & "&#039;, &#039;" & Field2Value & "&#039;, &#039;" & Field3Value & “&#039; “<BR><BR>Set DBConn = Server.CreateObject("ADODB.Connection")<BR>DBConn. Open “Your DSN Name”<BR><BR>DBConn.Execute ActionSQL<BR><BR><BR>DBConn.Close<BR>Set DBConn = Nothing<BR><BR>After the user enters the data and clicks SUBMIT, the values of the three fields will be sent to the target page designated by the forms action statement.<BR>The “Request.form . . .” statements on the target page retrieves the user’s information .<BR>The Action SQL creates a new record and inserts the user’s entries into the table.<BR><BR>Hope this helps . . . Gil<BR>

  2. #2
    Join Date
    Dec 1969

    Default Thanks man thats exactly what I needed...heheheheh

    It happens to us all we press the new post button instead of the reply button. SHAME ON YOU! lol. have a great day. <BR><BR>Mike M

Posting Permissions

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