insertid works with debug mode one, without it returns always 0
Posted: Mon 05 Nov 2007 15:38
After using TMyCommand with the insert command, insertid is only different to 0 if the program is compiled with debug info.
Got the newest (520) mydac build, and could reproduce it.
Some idea what i could do wrong?
It seems i must compiledf with assertion on!!!
Why that? Is there any workaround?
I found the place where the assertion take places:
procedure TMyCommand.Execute(Iters: integer);
var
v: variant;
begin
BeginConnection;
try
inherited;
Assert(Connection.IConnection.GetProp(prLastInsertId, v));
{$IFDEF VER6P}
FInsertId := v;
{$ELSE}
FInsertId := PInt64(@TVarData(v).VInteger)^;
{$ENDIF}
finally
EndConnection;
end;
end;
Is there anyway to get the info that is stored in v outside myaccess.pas?
Since i normally work with asssertion off.
Thx in advance.
Got the newest (520) mydac build, and could reproduce it.
Some idea what i could do wrong?
It seems i must compiledf with assertion on!!!
Why that? Is there any workaround?
I found the place where the assertion take places:
procedure TMyCommand.Execute(Iters: integer);
var
v: variant;
begin
BeginConnection;
try
inherited;
Assert(Connection.IConnection.GetProp(prLastInsertId, v));
{$IFDEF VER6P}
FInsertId := v;
{$ELSE}
FInsertId := PInt64(@TVarData(v).VInteger)^;
{$ENDIF}
finally
EndConnection;
end;
end;
Is there anyway to get the info that is stored in v outside myaccess.pas?
Since i normally work with asssertion off.
Thx in advance.