What is wrong with this code? The first part with tblTest1 is okay. No problem there. But when it comes to updating tblTest2, I got that "HTTP 500 - Internal server error" message. What did I do wrong?
strInput1 = Trim(Request.Form("Input1"))
strInput2 = Trim(Request.Form("Input2"))
strCon =
<..some connection..>
strSQL = "SELECT * FROM tblTest1;"
Set rsProcessInput = Server.CreateObject("ADODB.Recordset")
rsProcessInput.CursorType = 2
rsProcessInput.LockType = 3
rsProcessInput.Open strSQL, strCon
rsProcessInput.AddNew
rsProcessInput.Fields("Input1").value = strInput1
rsProcessInput.Fields("Input2").value = strInput2
rsProcessInput.Update
rsProcessInput.Requery
rsProcessInput.MoveLast
rsProcessInput.Close
Set rsProcessInput = Nothing
'update tblTest2 if strInput1 = A
If strInput1 = "A" Then
Dim rsUpdateTest2
Set rsUpdateTest2 = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblTest2;"
rsUpdateTest2.Open strSQL, strCon
rsUpdateTest2.CursorType = 2
rsUpdateTest2.LockType = 3
rsUpdateTest2.Fields("Input1").value = strInput1
rsUpdateTest2.Fields("Input2").value = strInput2
rsUpdateTest2.Update
rsUpdateTest2.Requery
rsUpdateTest2.MoveLast
rsUpdateTest2.Close
Set rsUpdateTest2 = Nothing
End If
Set strCon = Nothing