I am trying to post html form data to a database. I would like a way for it to loop through all the fields from the form and populate the fields in the database with that same name. For example the standard way to do it is as follows:
Set oRS = Server.CreateObject("ADODB.Recordset"
strSQL = "SELECT * FROM customersPDF"
oRS.Open strSQL, dbConn, 1, 3, 1
oRS.AddNew
oRS("fname"
= request.form("fname"
oRS("lname"
= request.form("lname"
oRS("SSN"
= request.form("SSN"
oRS("address"
= request.form("address"
Instead I would like it to work like this, psuedo code:
for i = 1 to 4
ors("database field name"
= request.form("form field name"
next i
Set oRS = Server.CreateObject("ADODB.Recordset"
strSQL = "SELECT * FROM customersPDF"
oRS.Open strSQL, dbConn, 1, 3, 1
oRS.AddNew
oRS("fname"
oRS("lname"
oRS("SSN"
oRS("address"
Instead I would like it to work like this, psuedo code:
for i = 1 to 4
ors("database field name"
next i