Skip to content

Instantly share code, notes, and snippets.

@ThepSamart
Created October 19, 2022 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThepSamart/d03ccc4ca31cc55cc743c37b39af5d1d to your computer and use it in GitHub Desktop.
Save ThepSamart/d03ccc4ca31cc55cc743c37b39af5d1d to your computer and use it in GitHub Desktop.
Access violations on ToDataset using mORMot2-2.0.4148
procedure TForm1.Button2Click(Sender: TObject);
const
SQL= 'select * from T1101 order by DOC_CONTNO desc';
var
z_conn: TSQLDBZEOSConnectionProperties;
i_rows: ISqlDBRows;
s_data: TBinaryDataSet;
begin
z_conn:= TSQLDBZEOSConnectionProperties.Create(
TSQLDBZEOSConnectionProperties.URI(dFirebird, StringToUTF8(DB_SERV), DB_CLIB, False),
StringToUTF8(DB_NAME), DB_USER, DB_PASS
);
try
i_rows:= z_conn.Execute(StringToUTF8(SQL), []);
if i_rows.Step then
ShowMessage('Result rows return');
TAutoFree.One(s_data, ToDataSet(nil, i_rows));
if not s_data.IsEmpty then
ShowMessage('Dataset rows ready');
finally
z_conn.Free;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment