Results 1 to 4 of 4

Thread: Returning the DB Key immediately after Add in EP

  1. #1
    Nick Matteucci Guest

    Returning the DB Key immediately after Add in EP

    Is there any way to immediately return and display the DB Key for the record inserted.

    Users would like to see the DB# on the confirmation and I could program logic to perform edits / add on additional tables related to the new record.

    Thanks gang!

    Nick Matteucci

  2. #2
    John Guest

    Returning the DB Key immediately after Add in EP (reply)

    How about exporting it and then writing it out on your ASP page?

    For example, if the record key is a field called RecNum, then you'd simply
    export RecNum and do a Response.Write to tell them which record they
    updated.

    Thanks,
    John


    ------------
    Nick Matteucci at 9/3/99 9:37:21 AM

    Is there any way to immediately return and display the DB Key for the record inserted.

    Users would like to see the DB# on the confirmation and I could program logic to perform edits / add on additional tables related to the new record.

    Thanks gang!

    Nick Matteucci

  3. #3
    Nick Matteucci Guest

    Returning the DB Key immediately after Add in EP (reply)

    John,

    That works for edit, but what about add?

    Here is an example with your test database. Please let me know if there is a way (before of after the ADD) where I can extract the autonumbered ID I just entered.

    <%
    Set MyDb = Server.CreateObject(&#34;ASPdb.EP&#34

    MyDb.dbmdb=Server.MapPath(&#34;asp-test.mdb&#34

    MyDb.dbUnit = 1

    MyDb.dbSQL = &#34;Select * from Products&#34;

    MyDb.dbNavigationItem=&#34;top, bottom, next, prev, gridrow, color, filter, download, add, update, edit, delete&#34;

    Mydb.dbExportFlds = &#34;0,1&#34;

    MyDb.dbEditParams=&#34;TableName=Products,BookMark Flds=ProductID,TableTag=BORDER=2&#34;

    MyDb.dbEditFlds=&#34;1,2,3,4&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!

    &#39;Write Access AutoNumber ID before closing object

    response.write(&#34;<HR>Export the Autonumbered UniqueID Key: &#34; & Session(&#34;ASPdb_1_UniqueID&#34 & &#34;<BR>&#34

    response.write(&#34;<HR>Export the ProductID: &#34; & Session(&#34;ASPdb_1_ProductID&#34 & &#34;<BR>&#34

    MyDb.aspDBEP

    &#39;Write Access AutoNumber ID after closing object

    response.write(&#34;<HR>Export the Autonumbered UniqueID Key: &#34; & Session(&#34;ASPdb_1_UniqueID&#34 & &#34;<BR>&#34

    response.write(&#34;<HR>Export the ProductID: &#34; & Session(&#34;ASPdb_1_ProductID&#34 & &#34;<BR>&#34

    %>


    ------------
    John at 9/3/99 12:43:29 PM

    How about exporting it and then writing it out on your ASP page?

    For example, if the record key is a field called RecNum, then you&#39;d simply
    export RecNum and do a Response.Write to tell them which record they
    updated.

    Thanks,
    John


    ------------
    Nick Matteucci at 9/3/99 9:37:21 AM

    Is there any way to immediately return and display the DB Key for the record inserted.

    Users would like to see the DB# on the confirmation and I could program logic to perform edits / add on additional tables related to the new record.

    Thanks gang!

    Nick Matteucci

  4. #4
    John Guest

    Returning the DB Key immediately after Add in EP (reply)

    Hi Nick,

    I dont&#39; know any way of retrieving the value of the autonumber entered
    value when a record is added. Good question! Maybe a user out there knows?

    John



    ------------
    Nick Matteucci at 9/7/99 2:25:53 PM

    John,

    That works for edit, but what about add?

    Here is an example with your test database. Please let me know if there is a way (before of after the ADD) where I can extract the autonumbered ID I just entered.

    <%
    Set MyDb = Server.CreateObject(&#34;ASPdb.EP&#34

    MyDb.dbmdb=Server.MapPath(&#34;asp-test.mdb&#34

    MyDb.dbUnit = 1

    MyDb.dbSQL = &#34;Select * from Products&#34;

    MyDb.dbNavigationItem=&#34;top, bottom, next, prev, gridrow, color, filter, download, add, update, edit, delete&#34;

    Mydb.dbExportFlds = &#34;0,1&#34;

    MyDb.dbEditParams=&#34;TableName=Products,BookMark Flds=ProductID,TableTag=BORDER=2&#34;

    MyDb.dbEditFlds=&#34;1,2,3,4&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!

    &#39;Write Access AutoNumber ID before closing object

    response.write(&#34;<HR>Export the Autonumbered UniqueID Key: &#34; & Session(&#34;ASPdb_1_UniqueID&#34 & &#34;<BR>&#34

    response.write(&#34;<HR>Export the ProductID: &#34; & Session(&#34;ASPdb_1_ProductID&#34 & &#34;<BR>&#34

    MyDb.aspDBEP

    &#39;Write Access AutoNumber ID after closing object

    response.write(&#34;<HR>Export the Autonumbered UniqueID Key: &#34; & Session(&#34;ASPdb_1_UniqueID&#34 & &#34;<BR>&#34

    response.write(&#34;<HR>Export the ProductID: &#34; & Session(&#34;ASPdb_1_ProductID&#34 & &#34;<BR>&#34

    %>


    ------------
    John at 9/3/99 12:43:29 PM

    How about exporting it and then writing it out on your ASP page?

    For example, if the record key is a field called RecNum, then you&#39;d simply
    export RecNum and do a Response.Write to tell them which record they
    updated.

    Thanks,
    John


    ------------
    Nick Matteucci at 9/3/99 9:37:21 AM

    Is there any way to immediately return and display the DB Key for the record inserted.

    Users would like to see the DB# on the confirmation and I could program logic to perform edits / add on additional tables related to the new record.

    Thanks gang!

    Nick Matteucci

Posting Permissions

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