ASP and MSAccess Insert Help
I'm messing around with ASP a little bit since I've got php down. Well here it goes
I'm using a msaccess database with a dsn connection. The html form has text boxes on it
for name, zip, address, phone number. In the db1.mdb there are 2 tables one for storing the name and one for storing the other information. I can't seem to get the correct syntax to
insert the html form into the database. So how would I do this? Insert the data from the forms
into the database?
Heres what I've got so far
Code:
<%
Dim Conn
Dim SqlName
Dim SqlAddress
strName = Request.Form("txtName")
strAddress = Request.Form("txtaddress")
strCity = Request.Form("txtCity")
strState = Request.Form("txtState")
strZip = Request.Form("txtZip")
strPhone = Request.Form("txtPhone")
strEmail = Request.Form("txtEmail")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ="DSN=db1.mdb"
SqlName="INSERT INTO Name(Name) Values('" & strName '")"
Conn.Execute(SqlName)
SqlAddress="INSERT INTO Address(Address,City,State,Zip,Phone,Email) VALUES('" & strAddress & '","' & strCity & '","' & strState & '","' & strZip & '","' & strPhone & '","' & strEmail '")"
Conn.Execute(SqlAddress)
%>
I'm more of a mySQL person but it's the syntax or how I might insert the data from the html forms into the the database and put it in the correct tables and rows.