Project Compiler Error in dbExpress for SQL Server with source

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
Eden0928
Posts: 62
Joined: Sun 22 Apr 2012 14:08

Project Compiler Error in dbExpress for SQL Server with source

Post by Eden0928 » Thu 02 Dec 2021 03:07

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?

Eden0928
Posts: 62
Joined: Sun 22 Apr 2012 14:08

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

Post by Eden0928 » Thu 02 Dec 2021 03:30

What is "Add LITE;DBX40 to conditional defines of your project."

Could you give me the simple built-in project?

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

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

Post by Stellar » Fri 03 Dec 2021 11:04

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

Post Reply