Monday, November 06, 2006

ZeosLib and Turbo Delphi Explorer

ZeosLib: a set of of database components for MySQL, PostgreSQL, Interbase, Firebird, MS SQL, Sybase, Oracle and SQLite for Delphi, FreePascal/Lazarus, Kylix.

Turbo Delphi Explorer: a free (downloadable) version of Turbo Delphi with some limitations. One of known limititations is inability to install third party components.

Since we can't install ZeosLib design time components within Turbo Delphi Explorer, we can do this approach to use ZeosLib with Turbo Delphi Explorer:

Prepare ZConnection object at runtime, as shown in the following code:
FConnection := TZConnection.Create(Self);
FConnection.Protocol := 'postgresql-8';
FConnection.HostName := '127.0.0.1';
FConnection.Port := 5432;
FConnection.Database := 'yourdatabase';
FConnection.User := 'yourusername';
FConnection.Password := 'yourpassword';
FConnection.Connect;

Prepare one of ZeosLib dataset compatible component, e.g. TZQuery:
FQuery := TZQuery.Create(Self);
FQuery.Connection := FConnection;
FQuery.SQL.Add('select * from yourtable');
FQuery.Open;

We can than do any usual thing, connecting TZQuery object with provided data access component. This is one possible example:
DataSetProvider1.Dataset := FQuery;
ClientDataset1.Open;

Done.

3 Comments:

At December 08, 2006 3:21 PM, Anonymous Anonymous said...

Pa Zeos componentnya pake nya versi berapa ya?? saya pake versi 0.6.6 tapi kok ga bisa2x konek ya?

 
At December 12, 2006 1:17 PM, Blogger ruslan said...

#1:

zeosdbo v6.6.0beta, sila lihat di sini: http://sourceforge.net/project/
showfiles.php?group_id=35994

 
At April 01, 2008 6:00 PM, Anonymous Joe said...

Pak, bgmn caranya aktivasi Turbo Explorer. Saya coba pake file yang dikirim code gear tapi kok nggak bisa. Trus, Turbo Explorernya dpt dari download langsung di situsnya ya?

 

Post a Comment

<< Home