[Gambas-user] DataView Help

Gianluigi gradobag at gradobag.it
Tue Jul 11 16:06:49 CEST 2023


Il 11/07/23 15:51, Gianluigi ha scritto:
> 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
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

Dear Christof,

here, what you just pointed out brings back to why I insist with Hans 
that we want to use the tools that Gambas makes available to us.

Not everyone who writes small business programs has the experience that 
Benoit has, that you have or Shordi has, to name a few that we all know.

Gambas shields us from so many mistakes, we only need to be smart enough 
to understand how these tools work (of course I am talking about myself).

With esteem

Gianluigi



More information about the User mailing list