Hello,
Thanks to this forum and Mr. Gmmastros and Mr. BigRed1212
I was able to build a complex form, it works well. The problem I am having is that my insert is adding a leading space on records two and up. The first record goes in with out an space but the subsequent records have a space. I have looked at different approches but have not come up with a solution. wondering if anybody could give me some other ideas.
the insert code
Thanks!!!
Thanks to this forum and Mr. Gmmastros and Mr. BigRed1212
I was able to build a complex form, it works well. The problem I am having is that my insert is adding a leading space on records two and up. The first record goes in with out an space but the subsequent records have a space. I have looked at different approches but have not come up with a solution. wondering if anybody could give me some other ideas.
the insert code
Code:
<%
'declare your variables
Dim itm, userid, responses, keycontrol, comm, reviewnote, i
Dim sConnString, connection, sSQL
'Receiving values from Form, assign the values entered to variables
itm = Split(Request.Form("itm"),",")
responses = Split(Request.Form("responses"),",")
userid = Split(Request.Form("userid"),",")
keycontrol = Split(Request.Form("keycontrol"),",")
comm = Split(Request.Form("comm"),",")
reviewnote = Split(Request.Form("reviewnote"),",")
'define the connection string, specify database
'driver and the location of database
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("qa.mdb")
'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")
'Open the connection to the database
connection.Open(sConnString)
For i = lBound(userid) to ubound(userid)
'declare SQL statement that will query the database
sSQL = "INSERT into answers1 (userid,itm, responses, keycontrol, comm, reviewnote) values ('" & _
userid(i) & "','" & itm(i) & "','" & responses(i) & "','" & keycontrol(i) & "','" & comm(i) & "','" & reviewnote(i) & "')"
connection.execute(sSQL)
Next
'execute the SQL
' connection.execute(sSQL) don't need this line anymore
'Done. Close the connection object
connection.Close
Set connection = Nothing
%>
Thanks!!!