daddio2005
Programmer
Hi
I am running the following code to UPDATE a few rows in a table. The corresponding INSERT statement runs fine and many other UPDATE statements work fine so I know the permissions are OK.
Any Ideas? It doesnt throw any errors up, just times out!
strSQL = "select * from pages where page_id=" & ref2
adoRs.Open strSQL, adoCn
if not adoRs.EOF then
pos=adoRs("pos")
end if
adoRs.Close
if ref1="Before" then
new_pos = pos*1 - 0.5
else
new_pos = pos*1 + 0.5
end if
strSQL = "UPDATE pages set pos=" & new_pos & " WHERE page_id=" & current_id
adoCn.Execute strSQL
strSQL = "select * from pages where parent_page_id=" & parent_page_id & " AND pos<>0 order by pos ASC"
adoRs.Open strSQL, adoCn
n = 0
do while not adoRs.EOF
n = n+1
strSQL = "UPDATE pages set pos=" & n & " WHERE page_id=" & adoRs("page_id")
adoCn.Execute strSQL
adoRs.MoveNext
loop
adoRs.Close
IT APPEARS TO CRASH WITHIN THE DO WHILE LOOP ON THE LINE "adoCn.Execute strSQL".
Any ideas?
Thanks.
I am running the following code to UPDATE a few rows in a table. The corresponding INSERT statement runs fine and many other UPDATE statements work fine so I know the permissions are OK.
Any Ideas? It doesnt throw any errors up, just times out!
strSQL = "select * from pages where page_id=" & ref2
adoRs.Open strSQL, adoCn
if not adoRs.EOF then
pos=adoRs("pos")
end if
adoRs.Close
if ref1="Before" then
new_pos = pos*1 - 0.5
else
new_pos = pos*1 + 0.5
end if
strSQL = "UPDATE pages set pos=" & new_pos & " WHERE page_id=" & current_id
adoCn.Execute strSQL
strSQL = "select * from pages where parent_page_id=" & parent_page_id & " AND pos<>0 order by pos ASC"
adoRs.Open strSQL, adoCn
n = 0
do while not adoRs.EOF
n = n+1
strSQL = "UPDATE pages set pos=" & n & " WHERE page_id=" & adoRs("page_id")
adoCn.Execute strSQL
adoRs.MoveNext
loop
adoRs.Close
IT APPEARS TO CRASH WITHIN THE DO WHILE LOOP ON THE LINE "adoCn.Execute strSQL".
Any ideas?
Thanks.