ASP - Cannot insert form result to Access DB more than one records

X

xfile

Hi:

I am trying to come up an ASP page for processing form input and to send
form results to an Access database and an email.

I have been stuck to the following procedures and simply don't know how to
correct it, so kindly review it and give me some advises.

---------- These are some SQL strings to be carried out ----------------

mySQL= "INSERT INTO tb1Users (UID) VALUES ('" & Request.Form("UserName") &
"')"
mySQL= "INSERT INTO tb1Users (PWD) VALUES ('" & Request.Form("Password") &
"')"
mySQL= "INSERT INTO tb1Users (ConfirmPWD) VALUES ('" &
Request.Form("ConfirmPassword") & "')"

----------------- These are execution and closing
connection -------------------------
myConnection.Execute mySQL

myConnection.Close

Set myConnection = Nothing
----------------------------------------------------------------------------
---------------------

Note: tb1Users = table name. UID = Access DB field name, UserName = Form
Field Name

At first, I experienced the execution cannot be done by myConnection.Execute
my SQL.

Now it can be carried out but when I examined the database file, only the
first mySQL record will be inserted.

For example: If I only listed the first for UID, then the UserName can be
inserted.

If I listed both UID and PWD, only the last one which in this case is the
"password" will be inserted.

Can anyone please tell me where seems to be the problem.

PS: I also tried the following string statements which will not work at all:
(1) INSERT INTO tb1Users (UID, PWD,...) VALUES ('UserName','Password"..)


Many thanks in advance!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top