ASP code error with SQL server databases

Ask a Question related to ASP Database, Design and Development.

  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. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. Databases - MS Sql Server Desktop Engine
      Is there a DBI driver for the MS Sql Server Desktop Engine? Paul
    5. 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...
  3. #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.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

Posting Permissions

  • You may not post new threads
  • You may 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