473,803 Members | 3,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP code error with SQL server databases

Hey,
I am getting the following error when I try to delete the contents
of a recordset under a condition statement. Is there any way I can
delete them without running into this error?
I need to delete the contents in the recordset 'rs' to delete the
items from the shopping cart once the order is placed.
Thanks, Amit

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation
of the provider, or of the selected locktype.
/FacLog/cartdisplay1.as p, line 370
Relevant code:
sql = "Select UserName,Code, Title From TempCartTable WHERE UserName=
'" & strName & "' ORDER BY Code"
set rs = db.execute(sql)

if session ("OrderPlace d") = "true" then
Response.Write " <div align = center> <font color=#FF0000>< b>
<h2> Your Cart is Presently Empty !!! </h2> <b> </font> <div>"
end if

' Get all the Instructor Selections from TempCartTable
if session ("OrderPlace d") = "false" then
If not rs.eof Then
'Response.Write rs("title")
Response.Write "<h3> Database Requests </h3>"
Response.Write "<br><table border='1'>"
Response.Write "<tr> <td><div align=center><b > Remove
</b></div></td> <td><div align=center><b > Code </b></div></td>
<td><div align=center><b > Title </b></div></td> <td><div
align=center><b > Course Details </b></div></td> <td><div
align=center><b > Date Requested For </b></div></td><td><div
align=center><b > Comments </b></div></td>"
row=0

while not rs.eof
Response.write( flag)
row=row+1

Response.Write "<tr><td width='15'><a
href='cartdispl ay1.asp?Remove= "
Response.Write rs("Code")
Response.Write "'><img src='/images/dot03.jpg'></a></td><td>"
Response.Write rs("Code")
Response.Write "</td>"
Response.Write "<input type=hidden name='Code" & row
Response.Write "' Value='"
Response.Write rs("Code")
Response.Write "'>"
Response.Write "<td><a target=_parent href='FacMenuFS .html?Code="&
rs("Code") & "'><font color='#006699' >"
Response.Write rs("Title")
Response.Write "</font></td> <div align=center><t d>"
Response.Write "<input type=hidden name=""Title" & row
Response.Write """ Value=""" & Server.HtmlEnco de(rs("Title"))
Response.Write """>"
Jul 19 '05 #1
1 3753
Use a DELETE statement to affect data.

conn.execute "DELETE table WHERE key=" & key,,129

Not only does it avoid the problem you're having, it is also more efficient.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Amit Kela" <am*******@colo rado.edu> wrote in message
news:8e******** *************** ***@posting.goo gle.com...
Hey,
I am getting the following error when I try to delete the contents
of a recordset under a condition statement. Is there any way I can
delete them without running into this error?
I need to delete the contents in the recordset 'rs' to delete the
items from the shopping cart once the order is placed.
Thanks, Amit

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation
of the provider, or of the selected locktype.
/FacLog/cartdisplay1.as p, line 370
Relevant code:
sql = "Select UserName,Code, Title From TempCartTable WHERE UserName=
'" & strName & "' ORDER BY Code"
set rs = db.execute(sql)

if session ("OrderPlace d") = "true" then
Response.Write " <div align = center> <font color=#FF0000>< b>
<h2> Your Cart is Presently Empty !!! </h2> <b> </font> <div>"
end if

' Get all the Instructor Selections from TempCartTable
if session ("OrderPlace d") = "false" then
If not rs.eof Then
'Response.Write rs("title")
Response.Write "<h3> Database Requests </h3>"
Response.Write "<br><table border='1'>"
Response.Write "<tr> <td><div align=center><b > Remove
</b></div></td> <td><div align=center><b > Code </b></div></td>
<td><div align=center><b > Title </b></div></td> <td><div
align=center><b > Course Details </b></div></td> <td><div
align=center><b > Date Requested For </b></div></td><td><div
align=center><b > Comments </b></div></td>"
row=0

while not rs.eof
Response.write( flag)
row=row+1

Response.Write "<tr><td width='15'><a
href='cartdispl ay1.asp?Remove= "
Response.Write rs("Code")
Response.Write "'><img src='/images/dot03.jpg'></a></td><td>"
Response.Write rs("Code")
Response.Write "</td>"
Response.Write "<input type=hidden name='Code" & row
Response.Write "' Value='"
Response.Write rs("Code")
Response.Write "'>"
Response.Write "<td><a target=_parent href='FacMenuFS .html?Code="&
rs("Code") & "'><font color='#006699' >"
Response.Write rs("Title")
Response.Write "</font></td> <div align=center><t d>"
Response.Write "<input type=hidden name=""Title" & row
Response.Write """ Value=""" & Server.HtmlEnco de(rs("Title"))
Response.Write """>"

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1621
by: Steven Scaife | last post by:
Below is my ASP page, I have changed the update to read DRIAL which doesn't exist, shouldnt this throw an error, or if the connection cannot be made shouldnt it throw an error as well thanks in advance <%@language="VBScript"%> <% option explicit %> <% response.buffer = True %>
11
14263
by: Taishi | last post by:
Andy, I am new to SQL. It was hard just to figure out how to install it. I know I am logged in as a Admin. in Windows. I have the little server box with the round circle on it in the bottom right corner(toolbar). The SQL Server Service Manager. I tried to search for the sp_helpsrvrolemember command on my drive. It's
1
5068
by: Steven | last post by:
This is complicated so I will try to be specific. Server: W2K DB2 V8.1 fixpack 4 Instances: DB2 databases TOOLSDB, DBDC DEV databases SURVEY, QUALDEV, DBDCDEV STAGE databases WSWSTAGE, TEMP I am having a problem I created the development box and things have been going well. I started to use Federation and things have gone south. I enabled federation on the DEV and DB2 instances to do some tests. I then needed to create a new database...
1
4011
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the live databases on the network. Is there a way, via code, when I get back in-house from being on the road to click a button, and select the backends I want to link to? I would want to delete all the current links and link to the "live"
6
7493
by: John | last post by:
Hi I have a front-end/back-end access app. I have created a replication set between the backend on a server an the backend on a laptop. My question is; How can I cause the synchronisation to happen via code? Basically I need to give the user an option to press a button (or menu option) on the laptop when the laptop is connected to the server/network for synchronisation to happen. Thanks
21
28052
by: Peter Nurse | last post by:
I have just upgraded to SQL Server 2005 from SQL Server 2000. In Microsoft SQL Server Management Studio, when I click on database properties, I receive the following error:- Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation. (Microsoft SQL Server, Error: 468)
18
18754
by: NEWSGROUPS | last post by:
I work for a large organization were my team has developed 2 very substantial databases in Access 2000. These databases have been working fine for the last 6 years with minimal issues or problems. About 1 week ago today we have started experiencing the error "Microsoft Visual Basic Run Time Error 3043 Disk or Network Error" just about every day around the same time each day (activity starts to increase at this time in the databases)....
4
5969
by: Mark D Powell | last post by:
While I was out of the office the Lan Team moved one of my SQL Server 2000 servers to a new network domain. Since then the maintenance job has not ran. The error log for the SQL Agents has the message listed in the subject line. I have not found any useful articles on the MS SQL Server site. Anyone know what might be wrong and how to fix it. HTH -- Mark D Powell --
5
2546
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs and registration keys, so I'm certain that the two machines are as similar as they can be.
0
3961
by: Toralf Kirsten | last post by:
Hi all, we have installed DB2 V9.5 Trial on a Fedora 6 Linux box (32bit). Since the box is included in a NIS we have manually created db2 users db2inst, dasusr and db2fenc on this box (not in the NIS). The installation process is carried out by using the root user (as root, not using sudo or something else). We selected the custom installation and de-selected the SA MP option but enabled the option to build the TOOLSDB (catalog db as I...
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.