How to to recover the automatic number after insertion in a MS Access database

Jan Schenkel janschenkel at yahoo.com
Fri Aug 8 00:59:00 EDT 2003


--- Jérôme_Rosat <jrosat at mac.com> wrote:
> How to recover the value of an "automatic number"
> field of a
> table after inserting a new record in a MS Access
> database.
> 
> Best regards,
> 
> Jerome 
> 

Bonjour Jérôme,

One way might be to simply fetch the maximum value of
this field back from the database, as in :
--
  put "SELECT MAX(myautonumber) FROM mytable" \
      into tSQLQuery
  put revDataFromQuery(tConnectionID, tSQLQuery) \
      into tHighestNumber
--

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the use-livecode mailing list