Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2003, 10:28 AM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old July 31st, 2003, 10:31 AM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oops, just remembered how to correct the error. Duh, oRS.CursorLocation = adUseClient

All works fine.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored procedure - batch update timeware SQL Server ASP 2 December 12th, 2007 04:13 PM
Batch File Allan320 Access 10 June 8th, 2006 06:46 AM
BATCH scapermoya Other Programming Languages 0 May 1st, 2006 08:47 PM
Batch Update to AS400 muklee Servlets 0 January 27th, 2005 09:34 PM
batch update billyducs Classic ASP Databases 4 July 30th, 2003 11:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.