Hi, can anybody see what is wrong with the code below? I go from type mismatch error to insert error.
What it does is on a previous page - if a checkbox is checked, the values along that row (in the form) are inserted - if no checked box - then go onto the next row.
Response Writing the values pulls the rowcount and property ID a-ok.
Thank you in advance.
<% Dim strRowCount
strRowCount=(Session("svRowcount"
)
%>
<% Dim rs,i
Set Conn = Server.CreateObject("ADODB.Connection"
conn.open "DSN=mydsn;"
for i=1 to strRowCount
IF Request.Form("txtExistant"&i)<>"" THEN
SQLstmt = "Insert into tblDetail"
SQLstmt = SQLstmt & "SET fldPropertyID=" & Session("svPropertyID"
SQLstmt = SQLstmt & ",fldDetailTitle='" & Request.Form("txtName"&i)
SQLstmt = SQLstmt & "',fldDimensionsWidth=" & Request.Form("txtWidth"&i)
SQLstmt = SQLstmt & ",fldDimensionsLength=" & Request.Form("txtLength"&i)
SQLstmt = SQLstmt & ",fldWidePoints='" & Request.Form("txtWidest"&i)
SQLstmt = SQLstmt & "',fldRoomCat=" & Request.Form("txtType"&i)
SQLstmt = SQLstmt & ",fldDescription='" & Request.Form("txtDescription"&i)
Set RS = Conn.Execute(SQLstmt)
End IF
NEXT
%>
"Damn the torpedoes, full speed ahead!"
-Adm. James Farragut
Stuart
What it does is on a previous page - if a checkbox is checked, the values along that row (in the form) are inserted - if no checked box - then go onto the next row.
Response Writing the values pulls the rowcount and property ID a-ok.
Thank you in advance.
<% Dim strRowCount
strRowCount=(Session("svRowcount"
%>
<% Dim rs,i
Set Conn = Server.CreateObject("ADODB.Connection"
conn.open "DSN=mydsn;"
for i=1 to strRowCount
IF Request.Form("txtExistant"&i)<>"" THEN
SQLstmt = "Insert into tblDetail"
SQLstmt = SQLstmt & "SET fldPropertyID=" & Session("svPropertyID"
SQLstmt = SQLstmt & ",fldDetailTitle='" & Request.Form("txtName"&i)
SQLstmt = SQLstmt & "',fldDimensionsWidth=" & Request.Form("txtWidth"&i)
SQLstmt = SQLstmt & ",fldDimensionsLength=" & Request.Form("txtLength"&i)
SQLstmt = SQLstmt & ",fldWidePoints='" & Request.Form("txtWidest"&i)
SQLstmt = SQLstmt & "',fldRoomCat=" & Request.Form("txtType"&i)
SQLstmt = SQLstmt & ",fldDescription='" & Request.Form("txtDescription"&i)
Set RS = Conn.Execute(SQLstmt)
End IF
NEXT
%>
"Damn the torpedoes, full speed ahead!"
-Adm. James Farragut
Stuart