created a site that allows a user to purchase as many books as the want. after they order a book i would like to input their information into a database. i was told to use a procedure or a subroutine to do this, but i am not sure i fully understand how to go about doing this.
this is what i have started:
Sub insertDBinfo
SQL = "INSERT INTO publicationNW
(date,publication,quantity,price,freight,total,cardnumber,ag
entnumber,lastname,firstname,birthmonth,birthdate,birthyear,
address,state,zip) values (" &_
+ "getdate(),"&_
+ "'" & Desc1 & "',"&_
+ "'" & qty1 & "',"&_
+ "'" & request.form("price"
& "',"&_
+ "'" & request.form("freight"
& "',"&_
+ "'" & total1 & "',"&_
+ "'" & right(request.form("cardNum"
,4) & "',"&_
+ "'" & request.form("agentnum"
& "',"&_
+ "'" & request.form("lastname"
& "',"&_
+ "'" & request.form("firstname"
& "',"&_
+ "'" & request.form("DOBmonth"
& "',"&_
+ "'" & request.form("DOBday"
& "',"&_
+ "'" & request.form("DOByear"
& "',"&_
+ "'" & request.form("address"
& "',"&_
+ "'" & request.form("state"
& "',"&_
+ "'" & request.form("zip"
& "')"
oConn.execute SQL, ,adExecuteNoRecords
End Sub
desc1 is a book but how do i go about inserting the rest of the books without writing a subroutine for each one.
this is what i have started:
Sub insertDBinfo
SQL = "INSERT INTO publicationNW
(date,publication,quantity,price,freight,total,cardnumber,ag
entnumber,lastname,firstname,birthmonth,birthdate,birthyear,
address,state,zip) values (" &_
+ "getdate(),"&_
+ "'" & Desc1 & "',"&_
+ "'" & qty1 & "',"&_
+ "'" & request.form("price"
+ "'" & request.form("freight"
+ "'" & total1 & "',"&_
+ "'" & right(request.form("cardNum"
+ "'" & request.form("agentnum"
+ "'" & request.form("lastname"
+ "'" & request.form("firstname"
+ "'" & request.form("DOBmonth"
+ "'" & request.form("DOBday"
+ "'" & request.form("DOByear"
+ "'" & request.form("address"
+ "'" & request.form("state"
+ "'" & request.form("zip"
oConn.execute SQL, ,adExecuteNoRecords
End Sub
desc1 is a book but how do i go about inserting the rest of the books without writing a subroutine for each one.