remobjects / pascalscript

pascalscript
Other
447 stars 178 forks source link

how to solve access violation problem? #260

Open relativ opened 2 years ago

relativ commented 2 years ago
Program IFSTest;
var
    SQLConnection: TDBConnection;
    SQLQuery: TDBQuery;
Begin
    SQLConnection:= TDBConnection.Create();
    SQLConnection.ProviderName := 'MySQL'; // Access, Advantage, ASE, DB2, DBF, InterBase, MySQL, NexusDB, ODBC, Oracle, PostgreSQL, SQL Server, SQLite, MongoDB
    SQLConnection.UserName := 'root';
    SQLConnection.Password := '';
    SQLConnection.Server := 'localhost';
    SQLConnection.Database := 'mysql';
    SQLConnection.Open();

    SQLQuery:= TDBQuery.Create();
    SQLQuery.Connection := SQLConnection;
    SQLQuery.SQL.Text := 'select * from user';
    SQLQuery.Open;
    while not SQLQuery.Eof do
    begin
                                Memo1.Lines.Add(SQLQuery.FieldByNameAsString('User')) ;
        SQLQuery.Next;
    end;

    SQLQuery.Close();
    SQLQuery.Free();

    SQLConnection.Close();
    SQLConnection.free();

End.
Failed when compiling <br/>
[Error] (1:1): Access violation at address 05D317C7 in module 'PascalScript_Core_D25.bpl'. Read of address 00000004

how to solve this problem ? i am using external bpl "PascalScript_Core_D25.bpl"

evgeny-k commented 2 years ago

try to build your project w/o run-time package. run-time packages hide actual error/place of error.

relativ commented 2 years ago

how i configure project as w/o run-time package

evgeny-k commented 2 years ago

uncheck Link with runtime packages? see more at https://docwiki.embarcadero.com/RADStudio/Sydney/en/Runtime_Packages_(Options)

relativ commented 2 years ago

Hmm its checked. So will i uncheck also in dlls which is used by exe?

relativ commented 2 years ago

This time i am getting property is not defined error.