help please on insert statement into Access from webpage !

G

Guest

hi,

i am trying to write records from an ASPX page to a access database, but get
an error on my insert statement, but not on a select statement. please let me
know if you can see what i'm doing wrong, code is below:

strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
strCompanyName = Request.Form("CompanyName")
strTelephone = Request.Form("Telephone")
strFAX = Request.Form("FAX")
strStreetAddress = Request.Form("StreetAddress")
strCity = Request.Form("City")
strStateProvince = Request.Form("StateProvince")
strZipPostalCode = Request.Form("ZipPostalCode")
strUsername = Request.Form("Username")
strPassword = Request.Form("Password")

curDir = Server.MapPath("\registrationdb.mdb")

set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
"C:\RegistrationDB.mdb" & ";"
Set oRs = Server.CreateObject("ADODB.Recordset")
Set oRs.ActiveConnection = oConn
oRs.Source = "INSERT INTO tblCustomerInfo (FirstName, LastName,
CompanyName, Telephone, FAX, StreetAddress, City, StateProvince,
ZipPostalCode, Username, Password) VALUES ('" & strFirstName & "', '" &
strLastName & "', '" & strCompanyName & "', '" & strTelephone & "', '" &
strFAX & "', '" & strStreetAddress & "', '" & strCity & "', '" &
strStateProvince & "', '" & strZipPostalCode & "', '" & strUsername & "', '"
& strPassword & "')"
oRs.Open
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top