Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Accessing an Updated Recordset Question


Message #1 by "Nadia Hamza" <hamzan@h...> on Mon, 27 Nov 2000 19:23:41 -0000
Hi,



I've run into an interesting problem.  I can take information from a form

and update a recordset; however, if after I update the recordset, I want

toaccess the latest information, I can't seem to get the latest record

until I've gone onto another asp page.  For example: I have information

from a form that I put into the database using the recordset update.  On

the same ASP page, I then want to know what the latest SessionID number

is.  Unfortunately, it will not give me that number. I don't quite

understand it since the information is definitely in the database at that

time.  If I go to another ASP page, I can do a filter and access the

information I need.



This is the second time I've run into this. I can work around this problem

but I would prefer not to. Any help would be greatly appreciated.  I hope

I'm clear enough in explaining the problem.  If you need any

clarification, please email me at hamzan@h...  Thanks!!!!



Nadia

Message #2 by "Pappas Nikolaos" <pappas@c...> on Tue, 28 Nov 2000 00:42:24 +0200
Hmmm

I thing just refreshing the ASP page will be enough, if there's any other

way

it's interesting to know.

I thing the page is in temporary internet files until you refresh it.

Take care

Nikos





Message #3 by "Dallas Martin" <dmartin@z...> on Mon, 27 Nov 2000 19:00:15 -0500
I seem to remember that a rs.movenext or rs.movelast is needed in order

to see updated info in an Access table.





----- Original Message -----

From: "Nadia Hamza" <hamzan@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, November 27, 2000 2:23 PM

Subject: [asp_databases] Accessing an Updated Recordset Question





> Hi,

>

> I've run into an interesting problem.  I can take information from a form

> and update a recordset; however, if after I update the recordset, I want

> toaccess the latest information, I can't seem to get the latest record

> until I've gone onto another asp page.  For example: I have information

> from a form that I put into the database using the recordset update.  On

> the same ASP page, I then want to know what the latest SessionID number

> is.  Unfortunately, it will not give me that number. I don't quite

> understand it since the information is definitely in the database at that

> time.  If I go to another ASP page, I can do a filter and access the

> information I need.

>

> This is the second time I've run into this. I can work around this problem

> but I would prefer not to. Any help would be greatly appreciated.  I hope

> I'm clear enough in explaining the problem.  If you need any

> clarification, please email me at hamzan@h...  Thanks!!!!

>

> Nadia

>

Message #4 by "Ken Schaefer" <ken@a...> on Tue, 28 Nov 2000 12:53:02 +1100
Nadia,



What database are you using? (I'm assuming that it is Access since that is

the only DB that I've heard of that has the problem you describe.)



If you just want to get the last autonumber created after doing an insert

then look here:

http://www.adopenstatic.com/experiments/fastestautonumber.asp



Basically you need to execute a "SELECT @@Identity" SQL statement (code is

on the page)



Cheers

Ken

----- Original Message -----

From: "Nadia Hamza" <hamzan@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, November 28, 2000 6:23 AM

Subject: [asp_databases] Accessing an Updated Recordset Question





> Hi,

>

> I've run into an interesting problem.  I can take information from a form

> and update a recordset; however, if after I update the recordset, I want

> toaccess the latest information, I can't seem to get the latest record

> until I've gone onto another asp page.  For example: I have information

> from a form that I put into the database using the recordset update.  On

> the same ASP page, I then want to know what the latest SessionID number

> is.  Unfortunately, it will not give me that number. I don't quite

> understand it since the information is definitely in the database at that

> time.  If I go to another ASP page, I can do a filter and access the

> information I need.

>

> This is the second time I've run into this. I can work around this problem

> but I would prefer not to. Any help would be greatly appreciated.  I hope

> I'm clear enough in explaining the problem.  If you need any

> clarification, please email me at hamzan@h...  Thanks!!!!

>

> Nadia





Message #5 by "Ken Schaefer" <ken@a...> on Wed, 29 Nov 2000 16:49:58 +1100
Just as a followup to this problem.



If you are trying to get more than the autonumber of the newly created

record, ie you are actually trying to get other parts of the record back

(why you'd want to do this I don't know, but suppose you did), then there is

this article in the MS KB:



http://support.microsoft.com/support/kb/articles/Q245/6/76.ASP

Records Newly Inserted into Access Database Are Not Immediately Available

When Reselecting



Apparently these is fix for this problem you can get from the MS Support

people, or you could try upgrading your MDAC to v2.5



Cheers

Ken



----- Original Message -----

From: "Ken Schaefer" <ken@a...>

To: "ASP Databases" <asp_databases@p...>

Cc: <hamzan@h...>

Sent: Tuesday, November 28, 2000 12:53 PM

Subject: [asp_databases] Re: Accessing an Updated Recordset Question





> Nadia,

>

> What database are you using? (I'm assuming that it is Access since that is

> the only DB that I've heard of that has the problem you describe.)

>

> If you just want to get the last autonumber created after doing an insert

> then look here:

> http://www.adopenstatic.com/experiments/fastestautonumber.asp

>

> Basically you need to execute a "SELECT @@Identity" SQL statement (code is

> on the page)

>

> Cheers

> Ken






  Return to Index