From Xojo Documentation

Revision as of 19:29, 18 February 2022 by Gperlman (talk | contribs) (Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

SQLiteDatabase.LastRowID() As Int64

New in 5.5

Supported for all project types and targets.

Returns an Int64 containing the value of the last RowID added to any table in the database.


This example gets the last rowid of a row added to the team table in an previously connected database:

db.ExecuteSQL("INSERT INTO team (Name, Coach) VALUES ('Penguins', 'Coach Mike')")
Var rowID As Int64
rowID = db.LastRowID
Catch error As DatabaseException
MessageBox("Insert failed. Error: " + error.Message
End Try