desperate: need help with updating recods

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

  1. #1

    Default desperate: need help with updating recods

    Hi, I'm sending this info:

    [url]http://step/update_SIM_admin.asp?project=retrtertert&employee= mike%3F%3F&dat[/url]
    e_start=&date_end=&updateQry=+&state=in+use&SIM_ID =8931440000305551182%2C+89
    31440000305551190%2C+8931440000305551208%2C+893144 0000305551224%2C+893144000
    0305551232%2C+8931440000305551240%2C+8931440000305 551257&submit=update+regis
    tration

    to the asp file undermeath. But when it goes trough the loop for the second
    time, it says:
    8931440000305551182

    SELECT * from SIMS where SIM_ID = '8931440000305551182'

    8931440000305551190

    SELECT * from SIMS where SIM_ID = ' 8931440000305551190'

    ADODB.Recordset error '800a0bcd'

    Either BOF or EOF is True, or the current record has been deleted. Requested
    operation requires a current record.

    /update_SIM_admin.asp, line 29


    ************************************
    ************************************
    This is my code:


    <html>

    <body>

    <%

    Dim SIM_ID_ARRAY
    SIM_ID_array = Split(request("SIM_ID"),",")

    dim sql, teller, rs, connection

    teller = 0
    while not teller = Ubound(SIM_ID_array) + 1

    Set connection = Server.CreateObject( "ADODB.Connection" )
    connection.open "DSN=SIMS.mdb"

    Set rs = Server.CreateObject( "ADODB.RecordSet" )

    %> <p> <%
    response.write(SIM_ID_array(teller))
    sql = "SELECT * from SIMS where SIM_ID = '" & SIM_ID_array(teller) & "'"
    %> <p> <%
    response.write(sql)

    Set rs = Server.CreateObject( "ADODB.RecordSet" )
    rs.Open sql, connection, 2, 2

    rs("syntrack_project") = request("project")
    rs.Update

    teller = teller + 1

    rs.close
    set rs = nothing

    connection.close
    set connection = nothing

    set sql = nothing
    Wend

    'Response.Redirect "sims.htm"

    %> </p>

    </body>
    </html>


    mike @ Syntrack Guest

  2. Similar Questions and Discussions

    1. Updating Updating site map or archive dynamically
      Hi there! ;-) Posted in Site Design as well.... Anyone know if there is a way to use Contribute to automatically/dynamically update a site map...
    2. Please help, I'm desperate!
      I've been trying for exactly a month now to create databases from ColdFusion with no success and I've used up all resources I could possibly found....
    3. I need help, desperate
      I just published my web that was created in FrontPage 2002. This server, Windows 2003, has IIS 6.0 and my database just will not work and neither...
    4. Updating AI Files causes position to 'bounce' when updating in Quark
      Is there any way to build Illustrator files so that no matter what edit you might come back and make to the AI file, when you update the modified...
    5. Please help, am desperate
      Hi All. I'm looking for a file, ActiveSM.ocx. I've been spending all day combing the internet for it and can't find it. Can anyone please email...
  3. #2

    Default Re: desperate: need help with updating recods


    "mike @ Syntrack" <mike.van.der.hulst@noooospam.syntrack.nl> wrote in
    message news:3f8e7012$0$256$4d4ebb8e@read.news.nl.uu.net.. .
    >
    [url]http://step/update_SIM_admin.asp?project=retrtertert&employee= mike%3F%3F&dat[/url]
    >
    e_start=&date_end=&updateQry=+&state=in+use&SIM_ID =8931440000305551182%2C+89
    >
    31440000305551190%2C+8931440000305551208%2C+893144 0000305551224%2C+893144000
    >
    0305551232%2C+8931440000305551240%2C+8931440000305 551257&submit=update+regis
    > tration
    I think it may be time to consider moving to method=post.

    >
    > to the asp file undermeath. But when it goes trough the loop for the
    second
    > time, it says:
    > 8931440000305551182
    >
    > SELECT * from SIMS where SIM_ID = '8931440000305551182'
    Please read this after you have the other issues worked out and consider it.
    [url]http://www.aspfaq.com/2096[/url]


    > Either BOF or EOF is True, or the current record has been deleted.
    Requested
    > operation requires a current record.
    I guess that would be because there are no records returned in your query.
    See additional inline replies.

    > <%
    >
    > Dim SIM_ID_ARRAY
    > SIM_ID_array = Split(request("SIM_ID"),",")

    Request what? Request.cookies? Don't just use Request("item"). Always
    specify what collection you want to pull from, i.e. querystring, form,
    cookies, servervariables, Clientcertificate

    > dim sql, teller, rs, connection
    >
    > teller = 0
    > while not teller = Ubound(SIM_ID_array) + 1
    >
    > Set connection = Server.CreateObject( "ADODB.Connection" )
    You may want to put this connection outside of your while/wend loop so
    you're not creating and destroying it over and over.
    > connection.open "DSN=SIMS.mdb"
    Instead of using a dsn, you should use an oledb connection string from
    [url]www.connectionstrings.com[/url]
    >
    > Set rs = Server.CreateObject( "ADODB.RecordSet" )
    This line isn't necessary.
    >
    > %> <p> <%
    > response.write(SIM_ID_array(teller))
    > sql = "SELECT * from SIMS where SIM_ID = '" & SIM_ID_array(teller) & "'"
    > %> <p> <%
    > response.write(sql)
    Nice!!!

    > Set rs = Server.CreateObject( "ADODB.RecordSet" )
    Doesn't this already exist?
    > rs.Open sql, connection, 2, 2
    >
    > rs("syntrack_project") = request("project")
    > rs.Update
    Instead of creating a recordset and updating it, why not just execute an
    INSERT command?

    sql = "UPDATE [SIMS] SET [syntrack_project]='" &
    Replace(Request.Querystring("project"), "'", "''") & "'"
    connection.Execute sql

    >
    > teller = teller + 1
    >
    > rs.close
    > set rs = nothing
    >
    > connection.close
    > set connection = nothing
    >
    > set sql = nothing
    > Wend


    Ray at work



    Ray at Guest

  4. #3

    Default Re: desperate: need help with updating recods

    > I think it may be time to consider moving to method=post.

    Yes!
    > Request what? Request.cookies? Don't just use Request("item"). Always
    > specify what collection you want to pull from, i.e. querystring, form,
    > cookies, servervariables, Clientcertificate
    Here's why:
    [url]http://www.aspfaq.com/2111[/url]
    > Instead of creating a recordset and updating it, why not just execute an
    > INSERT command?
    >
    > sql = "UPDATE [SIMS] SET [syntrack_project]='" &
    > Replace(Request.Querystring("project"), "'", "''") & "'"
    > connection.Execute sql
    Well, an UPDATE statement, and don't forget the WHERE clause. :-)

    You could also use a split/join operation to perform a single UPDATE WHERE
    IN (a,b,c) statement, instead of performing a loop...



    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: desperate: need help with updating recods


    "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
    news:uBzYI6%23kDHA.684@TK2MSFTNGP09.phx.gbl...
    >
    > Well, an UPDATE statement, and don't forget the WHERE clause. :-)
    Oops^2. Thanks!

    Ray at work


    Ray at 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