Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Database API > Methods

Database API: LastId()

Scroll Prev Next More

 

Returns the last inserted autoincremented field value in the current connection.

Syntax

DB_LastId()

Arguments

No arguments.

Return value

Returns the last inserted autoincremented field value in the current connection.

 

 

Dim data
Set data = CreateDictionary()
data("make") = "Toyota"
data("type") = "RAV4"
data("price") = 16000
DB_Insert "Cars",data
' get the ID of the inserted record and print it on the page
response.write DB_LastId();

See also:

Database API: Insert()

Database API: LastError()

Database API: SetConnection()

Connecting to the database

About Database API