A big THANK YOU to everybody who is trying to help. Here are some
points:
1. I tried this with Access and SQL Server - same results.
2. Please see the actual code below. If anybody has an idea how to do
this in an alternative way - fire away.
3. I'm very much aware of the meaning of cursor and lock types - as I
said I've tried alraedy all combinations (i.e. 2,3 / 3,3, etc) to no
avail.
4. I have not tried yet doing it over two separate connections - this
will probably work, but again this is a challenge to solve it over one
connection
CODE
============================================================================
set rs=server.createobject("adodb.recordset")
set rs_int=server.createobject("adodb.recordset")
sqlstring="select * from anamnesis_wordgroups where wordgroup_id=" &
request.form("id_old")
rs.open sqlstring,connection,2,3
do while not rs.eof
sqlsrtingint="select * from anamnesis_wordgroups where patient_id=" &
rs("patient_id") & " and question_id=" & rs("question_id") & " and
wordgroup_id=" & request.form("id_new")
rs_int.open sqlstringint,connection,2,3
if rs_int.eof then
sqlstring="delete from anamnesis_wordgroups where patient_id=" & rs
("patient_id") & " and question_id=" & rs("question_id") & " and
wordgroup_id=" & request.form("id_old")
else
sqlstring="update anamnesis_wordgroups set wordgroup_id=" &
request.form("id_new") & " where patient_id=" & rs("patient_id") & "
and question_id=" & rs("question_id") & " and wordgroup_id=" &
request.form("id_old")
end if
rs_int.close
connection.execute sqlstring
rs.movenext
loop
rs.close