Ask a Question related to ASP Database, Design and Development.
-
mike @ Syntrack #1
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
-
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... -
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.... -
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... -
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... -
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... -
Ray at #2
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>I think it may be time to consider moving to method=post.> tration
second>
> to the asp file undermeath. But when it goes trough the loop for thePlease read this after you have the other issues worked out and consider it.> time, it says:
> 8931440000305551182
>
> SELECT * from SIMS where SIM_ID = '8931440000305551182'
[url]http://www.aspfaq.com/2096[/url]
Requested> Either BOF or EOF is True, or the current record has been deleted.I guess that would be because there are no records returned in your query.> operation requires a current record.
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
You may want to put this connection outside of your while/wend loop so> dim sql, teller, rs, connection
>
> teller = 0
> while not teller = Ubound(SIM_ID_array) + 1
>
> Set connection = Server.CreateObject( "ADODB.Connection" )
you're not creating and destroying it over and over.
Instead of using a dsn, you should use an oledb connection string from> connection.open "DSN=SIMS.mdb"
[url]www.connectionstrings.com[/url]
This line isn't necessary.>
> Set rs = Server.CreateObject( "ADODB.RecordSet" )
Nice!!!>
> %> <p> <%
> response.write(SIM_ID_array(teller))
> sql = "SELECT * from SIMS where SIM_ID = '" & SIM_ID_array(teller) & "'"
> %> <p> <%
> response.write(sql)
Doesn't this already exist?> Set rs = Server.CreateObject( "ADODB.RecordSet" )
Instead of creating a recordset and updating it, why not just execute an> rs.Open sql, connection, 2, 2
>
> rs("syntrack_project") = request("project")
> rs.Update
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
-
Aaron Bertrand - MVP #3
Re: desperate: need help with updating recods
> I think it may be time to consider moving to method=post.
Yes!
Here's why:> 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
[url]http://www.aspfaq.com/2111[/url]
Well, an UPDATE statement, and don't forget the WHERE clause. :-)> 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
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
-
Ray at #4
Re: desperate: need help with updating recods
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:uBzYI6%23kDHA.684@TK2MSFTNGP09.phx.gbl...Oops^2. Thanks!>
> Well, an UPDATE statement, and don't forget the WHERE clause. :-)
Ray at work
Ray at Guest



Reply With Quote

