Hello all,
I was told to post this question in this forum instead hopefully that someone can see the reason why the code does not update nor save data when called.
Thanks!
I was told to post this question in this forum instead hopefully that someone can see the reason why the code does not update nor save data when called.
Code:
'declare the variables
Response.Buffer = true
On Error Resume Next
Dim strErrorMessage
Dim bolErrors
'Initialize variables
strErrorMessage = "" 'The error messages for tech. support
bolErrors = False 'Have we found any errors yet?
'Now our two subs
sub TrapError(strError)
bolErrors = True 'we've found an error!
strErrorMessage = strErrorMessage & strError & ", "
end sub
'first, get the total # of items that could be updated
Dim icount
icount = request.form("count")
'variables: id, name, selected template
Dim tid,tname,tselect
Dim iLoop, iString, arrCols
'get current page
pCurPage = Request.form("curPage")
For iLoop = 0 to icount
tname = Request.form(iLoop & ".tempName")
tselect = Request.form("tempSelected")
sDelete = Request.form(iLoop & ".delete")
' if NOT numberValidation(sDelete) then
' response.Redirect "error.asp?msg=" & Server.URLEncode("Invalid ID to delete!")
' end if
strID = Request.form(iLoop & ".idTemplate")
' if NOT numberValidation(strID) then
' response.Redirect "error.asp?msg=" & Server.URLEncode("Invalid ID to update!")
' end if
'update the appropriate column
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = 2
rs.LockType = 3
rs.Open "SELECT tempName,tempSelected FROM Templates WHERE idTemplate = " & cint(strID), objConn
if len(tname)>0 then
rs.Fields("tempName") = lcase(tname)
end if
if len(tselect)>0 then
rs.Fields("tempSelected") = tselect
end if
rs.Update
if len(sDelete) > 0 then
'Delete records from ProductSupport
strSQL = "DELETE FROM Templates " _
& " WHERE idTemplate = " & trim(sDelete)
objConn.Execute strSQL
end if
If Err.number <> 0 then
TrapError Err.description
End If
Next
call closeRS(rs)
call closedb()
Thanks!