Created
October 19, 2022 11:22
-
-
Save ThepSamart/d03ccc4ca31cc55cc743c37b39af5d1d to your computer and use it in GitHub Desktop.
Access violations on ToDataset using mORMot2-2.0.4148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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