Passing Ident after insert using Dreamweaver

I am using ASP VB and Dreamweaver CS3 with SQL Server.

I have an insert page. After insert, my page will go to a summary.asp.

On the summary page, I want to populate that page with the information they just  inserted. To do this. I need to pass the ID when I insert or a session or something. How do I do this?

Thanks, Doug
DMcGownAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hieloCommented:
There's a complete sample code here:
http://www.dotnetindex.com/articles/3474_How_to_use_SCOPE_IDENTITY____in_ASPNET.asp

NOTE: after that code is executed, newUserID contains the is of the newly inserted record

>>need to pass the ID when I insert
Your best option is to use a session. So, your code would be looking similar to this:
...
  objCommand.Connection.Open()
  newUserID = objCommand.ExecuteScalar
  objCommand.Connection.Close()
  Session("user") = newUserID
  Response.Redirect("otherpage.asp")

Then, in otherpage.asp, you could retrieve the value as follows:
Dim userID
userID = Session("user")

Your other alternative is to put it on a querystring and redirect, in which case your code would look like this:
  objCommand.Connection.Open()
  newUserID = objCommand.ExecuteScalar
  objCommand.Connection.Close()
  Session("user") = newUserID
  Response.Redirect("otherpage.asp?user=" & newUserID)

Then, in otherpage.asp, you could retrieve the value as follows:
Dim userID
userID = Request("user")
0
CWS (haripriya)Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Split: samic400 {http:#20801497} & hielo {http:#20802999}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

cyberwebservice
Experts Exchange Cleanup Volunteer
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.