[Gambas-user] DataView Help

Gianluigi gradobag at gradobag.it
Tue Jul 11 15:51:37 CEST 2023


Il 11/07/23 15:38, Christof Thalhofer ha scritto:
> Am 11.07.23 um 14:40 schrieb Gianluigi:
>
>> Getting the identity of the added student is easy, in the Save Sub just
>> type:
>>
>>     Dim sSQL As String = "SELECT MAX(students_id) FROM students;"
>>     Dim i As Integer
>>
>>     DataSource1.Save
>>     i = DataSource1.Connection.Exec(sSQL)[0]
>>     Print "STUDENT ID = "; i
>>
>> I still couldn't select the correct row though, I always end up
>> selecting the last one
>
> This is not good, as soon as not only one person can insert data, it 
> will be unreliable.
>
> Alles Gute
>
> Christof Thalhofer
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

Hi Christof,

right, I understand you have to use 'LastInsertId' 😅

Regards

Gianluigi



More information about the User mailing list