Database call right after an INSERT

Results 1 to 2 of 2

Thread: Database call right after an INSERT

  1. #1
    Steamer Guest

    Default Database call right after an INSERT

    I have the following situation : <BR><BR>i do an insert in 1 table of my Access database using : <BR><BR>MyConn_write.BeginTrans <BR><BR>MySQL1= "INSERT INTO tbl_Determinatie ( DET_Omschrijving ) " <BR>MySQL2= "VALUES ( &#039"& TRIM(Request.form("determinatie_nieuw")) & "&#039)" <BR>MySQL_new_det = MySQL1 & MySQL2 <BR><BR>MyConn_write.Execute MySQL_new_det <BR>MyConn_write.CommitTrans <BR><BR>This table has an AutoNumber DET_ID. <BR><BR>After i make this insert , i want to call the DET_ID it just inserted into. <BR>Problem is that the SELECT call : <BR><BR>MySQL_det = "SELECT DET_ID FROM tbl_Determinatie WHERE DET_Omschrijving = &#039" & TRIM(Request.form("determinatie_nieuw")) & "&#039 ORDER BY DET_ID" <BR><BR>doesn&#039t see the new entry yet. It always returns .bof <BR><BR>I already tried to redirect the page ( to save some time ) or to open another connection , without any result. <BR><BR>I have to use Access , so i can not use stored procedures to retrieve the ID. <BR><BR>Is there an easy way to solve this issue ?

  2. #2
    Join Date
    Dec 1969

    Default RE: Database call right after an INSERT

    Look in the faqs. I don&#039t know the number, but this topic has been thoroughly covered.

Posting Permissions

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