How Do I Grab the Unique ID Of A Newly Inserted Re

Results 1 to 2 of 2

Thread: How Do I Grab the Unique ID Of A Newly Inserted Re

  1. #1
    Cheryl Guest

    Default How Do I Grab the Unique ID Of A Newly Inserted Re

    I&#039ve just inserted a record into my MS Access database. Now, I want to turn around and grab its unique id and simply display it on my page. I am using the following statement <BR><BR>Set identifier = Conn.Execute("SELECT @@IDENTITY FROM postal")<BR><BR>but receiving a "data mismatch" error.<BR><BR>The primary key is called ID_POSTAL and is defined as an autonumber.<BR><BR>What am I doing wrong?

  2. #2
    Bruce Clark Guest

    Default RE: How Do I Grab the Unique ID Of A Newly Inserte

    Cheryl:<BR><BR>@@IDENTITY only works with SQL Server. A great article on pulling the ID of the last record inserted is at:<BR><BR>http://kamath.com/tutorials/tut004_autonum.asp<BR><BR>Good luck,<BR><BR>Bruce Clark<BR><BR>

Posting Permissions

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