Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 October 8th, 2003, 01:28 PM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating specific records

I'm trying to modify a set of records where it loops through all of the records where the value for "email" in the Room table is set to null. It should go through a bit of code, then set the email value to "1" and then update the records, but it gives me this error:

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/Clearance/email.asp, line 126

Is it possible to set the recordset to adLockOptimistic so I can update the records, or is this method just way off what I should do? Any help is appreciated. Code is below.
<%@ Language=VBScript %>
<% Option Explicit %>


<%
include files....
Dim var...
Set objRS = Server.CreateObject("ADODB.Recordset")
strconn = "SELECT * FROM Room WHERE (email IS NULL)"
Set objRS = objConn.execute(strconn)
code...
code...
code...
objRS("email") = "1" <--- line 126
objRS.Update
Close everything...
%>


 
Old October 8th, 2003, 01:57 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can use adLockOptimistic, but you'll have to create and open the recordset by hand using its Open method.

The Execute method of the Connection object will always return a forward-only, read-only recordset, so you can't update it.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 8th, 2003, 02:39 PM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar. It is working fine now.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Total Count of Specific Records in a Report Odeh Naber Access 5 August 1st, 2007 03:50 AM
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Updating records help bspradeep Classic ASP Databases 29 September 9th, 2003 07:00 AM
Updating records bspradeep Classic ASP Databases 0 August 20th, 2003 09:27 AM





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