View Full Version : getting session variable from autonumber

04-26-2008, 06:58 PM
I have an asp.net vb form that inserts a record into an Access Dbase. One of the fields is an autonumber field (ordernumber) that is generated in Access when the data is added to the dbase.

My problem is this:
I need to set a session variable equal to the ordernumber that is autogenerated right after the record has been added to the dbase.

I originally thought about passing a form variable to a page that would retrieve the record and then grab the value for the ordernumber and set the session variable but I don't have any fields in the form that I could reliably use to differentiate each record. For example, I thought I could use the entered phone number but it is possible for the same phone number to be used for more than one record. Same is true for name, more than one order could come from the same person.

Any suggestions?

04-26-2008, 07:35 PM
Grab it after you do the insert statement, here is an example on msdn:

Good luck

04-27-2008, 03:49 AM
Thanks for the direction.

I'll have to dig through this a bit. I'm using Dreamweaver :o so these things end up being more of a challenge than I'd like it to be.