Professional Web Applications Themes

ASP code error with SQL server databases - ASP Database

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 & ...

  1. #1

    Default 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

  2. #2

    Default 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.kelacolorado.edu> wrote in message
    news:8e5e432b.0312021441.28565883posting.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

Similar Threads

  1. SQL Server 2000 vs. DB2 databases.
    By Lam Nguyen in forum Microsoft SQL / MS SQL Server
    Replies: 10
    Last Post: February 25th, 07:51 PM
  2. Replies: 2
    Last Post: June 28th, 10:01 PM
  3. Two Websites/Two Databases One Server
    By Parrothead46038 in forum Coldfusion Database Access
    Replies: 3
    Last Post: October 11th, 02:08 PM
  4. Databases - MS Sql Server Desktop Engine
    By Paul Kraus in forum PERL Beginners
    Replies: 3
    Last Post: December 4th, 01:52 PM
  5. Server hosts and databases
    By Minding in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: September 6th, 10:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139