Driver disable without "Zeos.inc"

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
nakisen
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 12.07.2021, 16:03

Driver disable without "Zeos.inc"

Post by nakisen »

Hi,

I want to disable some database drivers. But I don't want to do this with "Zeos.inc". I could not do this with the codes I added in "project1.inc" in my sample project. Can I disable drivers with "project1.inc"?

Code: Select all

unit Unit1;

interface

{$I project1.inc}

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ZSqlUpdate, Data.DB, ZAbstractRODataset,
  ZAbstractDataset, ZDataset, ZAbstractConnection, ZConnection;

type
  TForm1 = class(TForm)
    ZQuery1: TZQuery;
    ZUpdateSQL1: TZUpdateSQL;
    ZConnection1: TZConnection;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

end.

Code: Select all

project1.inc content

{.$DEFINE ZEOS_DISABLE_MYSQL}
{$DEFINE ZEOS_DISABLE_POSTGRESQL}
{.$DEFINE ZEOS_DISABLE_DBLIB}
{$DEFINE ZEOS_DISABLE_ADO}
{.$DEFINE ZEOS_DISABLE_INTERBASE}
{.$DEFINE ZEOS_DISABLE_FIREBIRD}
{$DEFINE ZEOS_DISABLE_SQLITE}
{$DEFINE ZEOS_DISABLE_ORACLE}
{$DEFINE ZEOS_DISABLE_ASA}
{$DEFINE ZEOS_DISABLE_SQLANY}
{.$DEFINE ZEOS_DISABLE_POOLED}
{$DEFINE ZEOS_DISABLE_OLEDB}
{$DEFINE ZEOS_DISABLE_ODBC}
{$DEFINE ZEOS_DISABLE_PROXY}
{$DEFINE ZEOS_PROXY_USE_INTERNAL_PROXY}
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Driver disable without "Zeos.inc"

Post by marsupilami »

Hello nakisen,

it ist possible to disable drivers but not with your project1.inc. It all depends on the compilation of your project. Project1.inc is only included by Unit1.pas but not by other units - so it has no effect on other units. If you want to disable drivers without modifying Zeos.inc, you can do it this way:
  1. Add the Zeos source paths to the search path of your project. Zeos source paths are zeos\src\core, zeos\src\parsesql, zeos\src\plain, zeos\src\dbc and zeos\src\comnponent.
  2. Add the defines for disabling Zeos drivers to your project defines in the project options.
Adding the Zeos source paths will make sure that Zeos will be recomiled for your project. Adding the defines to the project options, will make sure that Zeos gets recompiled with those defines enabled.
I suggest you set the unit output path to be somewhere in your project folder. Otherwise the recompiled units will be littering the Zeos sources and might get picked up by other projects. Also keep in mind that this will increase compile time for your project because the zeos units will be recompiled every time.

Best regards,

Jan
nakisen
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 12.07.2021, 16:03

Re: Driver disable without "Zeos.inc"

Post by nakisen »

Thanks
Post Reply