PDA

View Full Version : Multimple Update Help Needed


TennesseeGuy
02-10-2005, 02:50 PM
I have put together a script that works beautifully when attempting to update a record. However if two records end up having the same criteria then only one will process and the other will lock up forever. Can anyone help me get this smple sql update to work with multiple recordsets?

strSql = "SELECT * FROM " & strMemberTablePrefix & "MEMBERS "
set rs3 = my_Conn.Execute (strSql)
pMemID = rs3("MEMBER_ID")
pWarn = rs3("M_WARN")
pWarnDate = rs3("M_WARNDATE")
if len(pWarnDate&"")=0 then
pWarnDate= 0
else
pWarnDate = Int(pWarnDate)
end if
mWarn = pWarnDate

nWarnDate = Int(DateToStr(dtDateTime))
nWarn = nWarnDate

If pWarn = 0 then
rs3.close
Else
If (pWarn = 1) and (mWarn < nWarn - 60) then
strSql = "update " & strMemberTablePrefix & "MEMBERS set M_WARN = 0 where MEMBER_ID=" & pMemID
my_Conn.Execute (strSql)
strSql = "update " & strMemberTablePrefix & "MEMBERS set M_WARNDATE = 0 where MEMBER_ID=" & pMemID
my_Conn.Execute (strSql)
End If
If (pWarn = 2) and (mWarn < nWarn - 120) then
strSql = "update " & strMemberTablePrefix & "MEMBERS set M_WARN = 1 where MEMBER_ID=" & pMemID
my_Conn.Execute (strSql)
strSql = "update " & strMemberTablePrefix & "MEMBERS set M_WARNDATE = " & nWarn &" where MEMBER_ID=" & pMemID
my_Conn.Execute (strSql)
End If
If pWarn > 2 then
strSql = "update " & strMemberTablePrefix & "MEMBERS set M_WARN = 2 where MEMBER_ID=" & pMemID
my_Conn.Execute (strSql)
End If
rs3.close
End If

jaywhy13
02-13-2005, 08:55 AM
Next time try posting ur code within code tags. Could u rephrase and spend a little more time explainin the exact problem that u r having?