SQLiteDatabase.LastRowID

From Xojo Documentation

Method

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.

Example

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

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