Ask a Question related to ASP Database, Design and Development.
-
Amit Kela #1
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.asp, line 370
Relevant code:
sql = "Select UserName,Code, Title From TempCartTable WHERE UserName=
'" & strName & "' ORDER BY Code"
set rs = db.execute(sql)
if session ("OrderPlaced") = "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 ("OrderPlaced") = "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='cartdisplay1.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><td>"
Response.Write "<input type=hidden name=""Title" & row
Response.Write """ Value=""" & Server.HtmlEncode(rs("Title"))
Response.Write """>"
Amit Kela Guest
-
SQL Server 2000 vs. DB2 databases.
Hi folks, I need your help on find articles or magazines that proven using SQL Server2000 is more cost effecitve and easier to maintenance... -
How to synchronize 2 databases on same server?
I need to synchronize 2 databases on the same server - everything except one table. Any suggestions on the best way to do this? Thanks in... -
Two Websites/Two Databases One Server
We have two websites on one server. The first website was created in FrontPage. On the "Home" page there is a link that takes the user to the other... -
Databases - MS Sql Server Desktop Engine
Is there a DBI driver for the MS Sql Server Desktop Engine? Paul -
Server hosts and databases
Hi, I'm in the process of developing a psychology project that is hurling me beyond static HTML and personal Web space sites. I'm currently... -
Aaron Bertrand - MVP #2
Re: ASP code error with SQL server databases
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
[url]http://www.aspfaq.com/[/url]
"Amit Kela" <amit.kela@colorado.edu> wrote in message
news:8e5e432b.0312021441.28565883@posting.google.c om...> 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.asp, line 370
>
>
> Relevant code:
> sql = "Select UserName,Code, Title From TempCartTable WHERE UserName=
> '" & strName & "' ORDER BY Code"
> set rs = db.execute(sql)
>
> if session ("OrderPlaced") = "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 ("OrderPlaced") = "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='cartdisplay1.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><td>"
> Response.Write "<input type=hidden name=""Title" & row
> Response.Write """ Value=""" & Server.HtmlEncode(rs("Title"))
> Response.Write """>"
Aaron Bertrand - MVP Guest



Reply With Quote

