Page 1 of 1

Project Compiler Error in dbExpress for SQL Server with source

Posted: Thu 02 Dec 2021 03:07
by Eden0928
I create an empty project and add related units.

My environment :
dbExpress for SQL Server with source 9.0.1
Delphi XE (150)
Windows 10 64bit

Code: Select all

unit Unit2;

interface

uses
  DBXCommon, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dbxsda, DBXDevartSQLServer, DB, SqlExpr;

type
  TForm2 = class(TForm)
    SQLConnection1: TSQLConnection;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

initialization
    RegisterDbXpressLib(@getSQLDriverSQLServer);

end.
But an error message will appear in the source code when compiling:
[DCC Error] dbexp.pas(2164): E2010 Incompatible types: 'Boolean' and 'Word'

Code: Select all

procedure TMemSQLCursor.GetField(FieldNo: word; Buffer: pointer; var IsBlank: LongBool);
...
    FRecordSet.GetField(Field, FRecBuf, Buffer, BufferLen, False, _IsBlank);
...
Why?

Re: Project Compiler Error in dbExpress for SQL Server with source

Posted: Thu 02 Dec 2021 03:30
by Eden0928
What is "Add LITE;DBX40 to conditional defines of your project."

Could you give me the simple built-in project?

Re: Project Compiler Error in dbExpress for SQL Server with source

Posted: Fri 03 Dec 2021 11:04
by Stellar
Hi Eden!

Thanks for your questions!

To debug the driver, you need to add compiler instructions to your application LITE; DBX40; DRIVERDEBUG.
Also, you need to add the DbxSdaDriverLoader unit to the uses section.
See this sample:

// defines: LITE;DBX40;DRIVERDEBUG

SQLConnection1.DriverName := 'DevartSQLServerDirectBuiltin';
SQLConnection1.GetDriverFunc := 'getSQLDriverSQLServerDirect';
SQLConnection1.LibraryName := 'dbexpsda41.dll';
SQLConnection1.VendorLib := 'not used';

Please, let us know if any questions!
Sergey,
Devart Team