Hi all
Can anybody tell me why this code is not updating the records?
Got it from Dr Devs site and I even used my own FAQ, but I still can't get it to work.
The code processes all the way through to the redirect page, but when I go back to the records, they have not been updated.
Any help would be great
Cheers
Dean
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
Can anybody tell me why this code is not updating the records?
Got it from Dr Devs site and I even used my own FAQ, but I still can't get it to work.
The code processes all the way through to the redirect page, but when I go back to the records, they have not been updated.
Code:
<%
If Request("Submit") <> "" Then
intRecIDs = Replace(Request("hidRecIDs"), "*", "")
arrRecIDs = Split(intRecIDs, ", ")
For i = 0 to Ubound(arrRecIDs)
txtsurname = Replace(Request("txtsurname" & arrRecIDs(i)), "'", "''")
txtfirstname = Replace(Request("txtfirstname" & arrRecIDs(i)), "'", "''")
txtemail = Replace(Request("txtemail" & arrRecIDs(i)), "'", "''")
txtph = Replace(Request("txtph" & arrRecIDs(i)), "'", "''")
txtmob = Replace(Request("txtmob" & arrRecIDs(i)), "'", "''")
Set CmdUpdate = Server.CreateObject ("ADODB.Command")
CmdUpdate.ActiveConnection = MM_connect_STRING
commUpdate.CommandText = "UPDATE KnectMbrTBL SET mbr_Surname = '" & txtsurname & "', mbr_Firstname = '" & txtfirstname & "',mbr_email = '" & txtemail & "',mbr_Ph = '" & txtph & "', mbr_Mob = '" & txtmob & "' WHERE RecID = " & arrRecIDs(i)
commUpdate.CommandType = 1
commUpdate.CommandTimeout = 0
commUpdate.Prepared = true
commUpdate.Execute()
Next
Response.Redirect("UDgroups.asp?LoginID=" & (mbrs.Fields.Item("mbr_GroupID").Value))
End If
%>
Any help would be great
Cheers
Dean
-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."