yet another batch update
I am trying another batch update from the Beginning ASP Databases book and have encounter another error.
The error is:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E25)
Row handles must all be released before new ones can be obtained.
My code is:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
dim oRS
set oRS = server.createobject("adodb.recordset")
dim strSource
strSource = "Provider=SQLOLEDB.1;DRIVER={MS SQL-Server};UID=userid;PWD=password;DATABASE=Sailors;S ERVER=server"
oRS.Open "People", strSource, adOpenDynamic, adLockBatchOptimistic
do until oRS.EOF
if oRS.fields("PeopleClubCode") = "scow" then
response.write "Moved sailor: " & oRS.fields("PeopleNameFirst") _
& " " & oRS.fields("PeopleNameLast") & " " & oRS.fields("PeopleClubCode") & "<br>"
oRS.fields("PeopleClubCode") = "wsc"
response.write "Moved sailor: " & oRS.fields("PeopleNameFirst") _
& " " & oRS.fields("PeopleNameLast") & " " & oRS.fields("PeopleClubCode") & "<p>"
end if
oRS.Update
oRS.MoveNext 'error occurs here
Loop
oRS.UpdateBatch
oRS.Close
set oRS=nothing
%>
Thanks,
Wills
|