Skip to main content
Participating Frequently
April 28, 2008
Question

Record ID after Insert

  • April 28, 2008
  • 3 replies
  • 480 views
I have a form that inserts a record, the user is then redirected to a second page to upload images so I need to recall the record that was just posted. How can I capture the record ID of the record just inserted so I can use it to filter the recordset on the second page. I am using ASP/VBScript. - Thanks
This topic has been closed for replies.

3 replies

Participating Frequently
May 6, 2008
What database are you using? In a PostgreSQL database I use, we use the following SQL to return the just-inserted primary key from the table: SELECT currval('tbl_ifq_rs_user_ser_id_seq') AS NewID; - where the the parameter to the currval function is the sequence that tracks the value of the primary key for the table.
Inspiring
April 28, 2008

"Ken Pollard" <webforumsuser@macromedia.com> wrote in message
news:fv52h9$10p$1@forums.macromedia.com...
>I have a form that inserts a record, the user is then redirected to a
>second
> page to upload images so I need to recall the record that was just posted.
> How
> can I capture the record ID of the record just inserted so I can use it to
> filter the recordset on the second page. - Thanks

Ken, just curious why you don't upload the images at the same time the
record is inserted?


Participating Frequently
April 28, 2008
They actually do upload the required image, but they have the option to upload additonal images that can be large and I don't want a timeout. This way I'm sure the account is created and the required image is there. Then they can upload the large additional images one at a time and I don't need to worry about the script timing out. -Thanks
Inspiring
April 28, 2008
Hi yea,
You never mentioned what server type your using.

I am an asp/vb user and usually use tom mucks dw extension for this.
http://www.tom-muck.com/extensions/help/insertretrieve/

it is a commercial extension but it is very useful.


Tom also has the same extension for php users and its free.

http://www.tom-muck.com/extensions/help/InsertRetrievePHP/

regards

k