[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 346
  • Last Modified:

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
0
DMcGown
Asked:
DMcGown
2 Solutions
 
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

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now