[Gambas-user] DataView Help
benoit.minisini at gambas-basic.org
Tue Jul 11 14:52:27 CEST 2023
Le 11/07/2023 à 14:40, Gianluigi a écrit :
> Hi Lee,
> Getting the identity of the added student is easy, in the Save Sub just
> Dim sSQL As String = "SELECT MAX(students_id) FROM students;"
> Dim i As Integer
> i = DataSource1.Connection.Exec(sSQL)
> Print "STUDENT ID = "; i
> I still couldn't select the correct row though, I always end up
> selecting the last one
If your record primary key is a serial field, you can use the
'LastInsertId' property of the 'Connection' object to get it.
More information about the User