Subject | Re: [firebird-support] Get the value of generated primary key after an insert |
---|---|
Author | Radu Sky |
Post date | 2006-05-20T21:18:29Z |
Adriano wrote:
I was referring to MyVar field.
MsgBox Myvar will always return 0 since you declared as local variable;
You need to retrieve the field value 'MyVar' from your query cn like
from any ordinary table.
MsgBox cn.fieldbyname('MyVar').value
I must admit that I don't know the syntax there but you should do
something like that
HTH
Radu
> Hi Radu & Aage,Hello,
>
>
>> Shouldn't be MsgBox MyVar ?
>> Just a shot in the dark...
>
> Dim MyVar as Integer
> query =3D "SELECT GEN_ID(GEN_PRATICHE_IDPRATICA, 1) as MYVAR FROM RDB$DATAB=
> ASE;"
> cn.Execute query
> MsgBox Myvar
> Returns Always 0
>
> It's darker than before ..
> Some more light ?
>
I was referring to MyVar field.
MsgBox Myvar will always return 0 since you declared as local variable;
You need to retrieve the field value 'MyVar' from your query cn like
from any ordinary table.
MsgBox cn.fieldbyname('MyVar').value
I must admit that I don't know the syntax there but you should do
something like that
HTH
Radu