Querying a record you just added

Results 1 to 4 of 4

Thread: Querying a record you just added

  1. #1
    B.Mof Guest

    Default Querying a record you just added

    I know I saw this somewhere, but can&#039t find it now.<BR><BR>I&#039m adding a new row to the database. My ASP is standard fare:<BR><BR>RS.AddNew<BR><BR>RS("Title") = Request.Form("Title")<BR><BR>Etc., Etc. I have a field in each row that autonumbers the items with a unique ID. How can I determine that unique ID before leaving my update page? Doing a count on how many rows I have and adding 1 doesn&#039t seem clean. Is there any way where I can re-query that record to find it&#039s unique ID before leaving the page on a redirect?<BR><BR>B.Mof

  2. #2
    B.Mof Guest

    Default Err, nevermind

    Was looking in the wrong FAQ section. Doh!<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Querying a record you just added

    I have the same question, how do I figure out what the unquie number is before I leave my update/insert page?... I would like to display it on the following page and send it in an email... Whats the answer???

  4. #4
    Pauline Corbett Guest

    Default RE: Querying a record you just added

    I had the same problem but found this<BR><BR>Rs.Open<BR>Rs.AddNew<BR>RS("Name")=Req uest.QueryForm("name")<BR>RS.Update<BR>UserID=Rs(" UserID") //This returns the UserID of the <BR> record just entered<BR>Rs.Close<BR><BR>You can now use the UserID Variable to insert the UserID into linked tables.<BR><BR>I hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts