Results 1 to 2 of 2


  1. #1
    John M. Guest

    Default SQL INSERT

    Hello,<BR><BR>I am simply trying to insert data taken from an HTML form into 3 columns of a small access database. The first column is an autonumber key called &#039UserID&#039, the second is &#039Name&#039, the third is &#039Address&#039.<BR><BR>Can I use the following code:<BR><BR>INSERT INTO Customers (UserID, Name, Address)<BR>VALUES(??, request.form("variable1"), request.form("variable2"))<BR><BR>If so, how do I handle the autonumber.<BR><BR>I know this is basic, I am just starting out.<BR><BR>Thanks!!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL INSERT

    Autonumber is created by db, so the query is<BR><BR>"INSERT INTO Customers (Name, Address) VALUES (&#039" & request.form("variable1") & "&#039, &#039" & request.form("variable2") & "&#039)"<BR><BR>I allowed my self to put " , &#039 and & . because I assume name and address are strings so you need to put &#039 to insert string into db<BR>and " and & to concatenate variables with string<BR><BR>

Posting Permissions

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