Closing of National Mirrors

Dear Visitor,
The ZeosLib Team has decided to close all international mirrors and keep just the main (english) site running. While this is only a temporary measure, the mirrors will probably be out for some time. The official date on which the mirrors will be shut down is September 9, 2004.

The good news is that since we no longer will be maintaining the mirrors there will be plenty of time for our team to concentrate on more urgent tasks such as the documentation of our software.

We apologize for any disruptions on your regular activities or projects that we may cause.

Thank you for your comprehension and for supporting ZeosLib!

The ZeosLib Team.

Posted in Uncategorized | Leave a comment

ZeosDBO 6.5.1-alpha released

ZeosDBO 6.5 continues 6.x branch by adding new valuable functionality into well known database components. In the new version you’ll get drivers for Oracle 9i, SQLite 2.8, MySQL 4.1, PostgreSQL 7.4, most wanted Midas/DataSnap IProviderSupport interface and many other features and bug fixes.

Version 6.5.1 is an alpha release and intended to present the development progress to our users. Although it passed tests it is _not_ recommended for production environment yet. You may use it on your own risk. Your reports about bugs and problems found in this version we’ll address in timely manner.

Thanks for your support,
The ZeosLib Development Team

New features:

  • Added database error codes to rethrown exceptions in dataset.
  • Added support for cidr, inet and macaddr column types into PostgreSQL driver.

Bug Fixes:

  • Fixed Bug#1021705 Numeric values overflow
  • Fixed Bug#1034795 Metadata don’t filter the table type
  • Fixed Bug#993352 problem with TZInterbase6DatabaseMetadata.GetTables table type SYSTEM TABLE
  • Fixed Bug#991069 Creation of a DB and FKs in Firebird
  • Fixed Bug#985629 Locate and Lookup don’t find float fields.
  • Fixed Bug#993981 MySQL and PostgreSQL drivers do not process float values if decimal separator other then “.”.
  • Fixed Bug#995080 “List Index Out of Bounds” exception in Dataset.UpdateStatus on empty resultset.
  • Fixed Bug#999658 Truncation of BigDecimal fields. Thanks to Kestutis Laurinavicius.
  • Fixed Bug#1000534. SQL Parser error when “join … on” clause contains functions with parameters.
  • Fixed Bug#1004534 Access Violation when RecNo is called on closed Dataset.
  • Fixed Bug#1045286 Method IsNull returns incorrect result for fields containing “” characters.
Posted in News | Leave a comment

Patch #1 for ZeosDBO 6.1.5

There is a patch for 6.1.5 available in the Download section. Please apply the patch to the 6.1.5 source and recompile.

This patch addresses the following problems:

  • Fixed Bug#985629 Locate and Lookup don’t find float fields.
  • Fixed Bug#988462 Query.RowsAffected returns 0 for some databases.
  • Fixed Bug#966267 Fixed processing OnEditError, OnPostError, OnDeleteError events.
  • Fixed Bug#957126 Incorrect processing of empty strings in default values in MySQL driver. Thanks to Alex/ghost3k.
  • Fixed Bug#981208 SELECT * FROM mydb.mytable is not updateable.

The installation procedure is simple: unzip the patch archive in zeosdbo installation directory, then recompile and reinstall the components.

Thanks for you continuing support,
The ZeosLib Development Team.

Posted in Announces | Leave a comment

FreeDbConv Version 1.63 Released

cforce writes “New:
* support for postgresql-7.4, sqlite, sqlite-2.8, oracle, oracle-9i, mysql-4.1, ado
* changed interface
* speed improvments

BugFixes:
* fixed Win2k bug
* interbase & firebird import
* autocommit bug / autocommit cycle
* out of bound bug if status file is messed up

http://www.mediashark.de.vu”

Posted in News | Leave a comment

ZeosDBO 6.5.0-alpha released

ZeosDBO 6.5 continues 6.x branch by adding new valuable functionality into well known database components. In the new version you’ll get drivers for Oracle 9i, SQLite 2.8, MySQL 4.1, PostgreSQL 7.4, most wanted Midas/DataSnap IProviderSupport interface and many other features and bug fixes.

Version 6.5.0 is an alpha release and intended to present the development progress to our users. Although it passed tests it is _not_ recommended for production environment yet. You may use it on your own risk. Your reports about bugs and problems found in this version we’ll address in timely manner.

Thanks for your support,
The ZeosLib Development Team

New features:

* Added implementation of IProviderSupport interface.
* Added MySQL 4.1 driver.
* Added PostgreSQL 7.4 driver.
* Added Oracle 9i driver.
* Added doSmartOpen option to Dataset to allow executing DML statements by Open without throwing exception.
* Added support for SQL specific syntax in Query.SQL and UpdateSQL.
* Added SQLite 2.8 driver.
* Added depended compilation for drivers, included into TZConnection drivers list. Now users may select which drivers they want to use to decrease size of their applications. (See /src/Zeos.inc file for details)
* Added processing for query parameters with ftGraphic type. Thanks to Pavel Blahovec.
* Changed type for Dataset.ShowRecordTypes to TUpdateStatusSet.
* Added GetProtocolNames, GetCatalogNames, GetSchemaNames, GetTableNames, GetStoredProcNames methods into TZConnection component.
* Replaced RequestLive with ReadOnly property in TZTable component to make it more compatible with standard TTable.
* Added InTransaction property in TZConnection component.

Bug Fixes:

* Fixed Bug#981208 SELECT * FROM mydb.mytable is not updateable.
* Replaced thrown exception type in Datasets to EZDatabaseError custom class.
* Fixed Bug#966267 Fixed processing OnEditError, OnPostError, OnDeleteError events.
* Fixed memory leak in Statement.Execute. Now all Connections, Statements and ResultSets must be explicitely closed before desposing.
* Fixed Bug#959307 TZDBLibCallableStatement.Execute Empty parameter string sever translate as null value
* Fixed Bug#907497 TZDBLibCallableStatement.ExecutePrepared Return incorrect string values of stored procedure
* Fixed Bug#951881 TZFirebirdNativeLibraryLoader does not work with INTERBASE_CRYPT option
* Fixed #956613 TZInterbase6DatabaseMetadata.GetTables throws an error while reading metadata
* Fixed #947915 TZInterbase6CallableStatement.ExecuteUpdatePrepared does not raise exception in Stored Procedure
* Fixed #945251 TZAbstractDatabaseMetadata.GetTableTypes always returns “TABLE” as result, but never “VIEW” or “SYSTEM TABLE”.
* Fixed Bug#914057 ZSQLMonitor.SaveToFile does not use FileName.
* Fixed Bug #914436 Text fields with specified character set are not recognized in MySQL driver.
* Fixed Bug #914369 Fixed memory leaks in Interbase driver
* Fixed Bug#912220 PostgreSQL driver doesn’t read oid blobs.
* Fixed Bug#909181 do not sets fields to null
* Fixed Bug #914436 Bug several MySQL TEXT Fields are not correct identified
* Fixed Bug #919395 Memory leak in TZExpressionParser.TokenizeExpression. Thanks to mocarts.
* Fixed Bug #919401 When dataset is in Edit mode function UpdatesPending always returns true does matter were changes made or not. Thanks to mocarts.
* Fixed Bug #924861 Memory leak, when client cannot connect to server
* Refactored ZDBC metadata classes.
* Fixed processing of Int64 values in Dataset.Refresh.
* Fixed Bug #933623 ‘current transaction is aborted, commands ignored until end of transaction block.’ error in postgresql when previous statement in transaction fails. Now if autocommit mode is set components automatically rollback failed statements. In manual commit mode developer should explicitely call Connection.Rollback.
* Fixed Bug #824786 TZMetadata shows PostgreSQL 7.4 system tables from ‘information_schema’ as regular tables.
* Fixed duplicated AfterScroll event in Query.Locate and Query.FindRecord methods.
* Fixed Bug#948940 Random “Can not update this query type” error in PostgreSQL driver. Thanks to Sergio Freue.
* Fixed Bug#957126 Incorrect processing of empty strings in default values in MySQL driver. Thanks to Alex/ghost3k.

Posted in Announces | Leave a comment

Unit for fast preparing and executing SQL scripts

GAF writes “Design time application development is good for small or middle projects. But when count of forms in the project is more than 10 and number of queries on each form is more than 3 it’s too hard to easy modify application. My unit can be helpful for creating and executing SQL scripts in runtime level but not in design time.

Why you need for each (even simple) sql queries make Query on form? Each time set published properties… If changed just ONE option but for all queries it needs to modify all queries at all forms :(.
Published properties sometimes change their values themselfs. For example, after component reinstall.It’s more easy to modify it in units. Default properties for all queries specify one time… With runtime scripts it’s easy to goes to then next versions of ZeosDBO and other.

With each database structure modification it needs to modify SQL scripts in application. How you are finding what you need to correct? I have use for it Search in TotalCommander in application folder. I can’t use Delphi option Find in Files… because it don’t find information in dfm files.
If all scripts stores in pas units then it possible to
a) easy find information with Delphi option Find in Files…
b) easy work with CVS (for your own needs or for collaborate working with another developers)

Continue reading
Posted in Code Hacks | Leave a comment

How to create a database, tables and triguers

OCTweak writes “Create a new application and add a ZConnection and a ZSQLPROCESSOR to the form
Add a button, name it CreateBtn and add the following click event for it


procedure TForm1.CreateBtnClick(Sender: TObject);
var
HstName, PathName, DBName, Props: string;
begin
HstName := ‘192.168.0.1’; // if using embed, leave blank
PathName := ‘c:fibdatabases’; // path where the database will be created at the server
DBName := ‘TEST’; // database name, do not add an extension
ZConnection.Properties.Clear;
ZConnection.HostName := HstName;
ZConnection.Database := PathName + DBName + ‘.fdb’;
ZConnection.User := ‘sysdba’;
ZConnection.Password := ‘masterkey’;
Props := ‘CreateNewDatabase=CREATE DATABASE ”’;
if ZConnection.HostName ” then // if not firebird embedded
Props := Props + HstName + ‘:’;
Props := Props +
PathName + DBName + ‘.fdb”’ +
‘ USER ”’ + ZConnection.User + ”” +
‘ PASSWORD ”’ + ZConnection.Password + ”” +
‘ PAGE_SIZE 16384 DEFAULT CHARACTER SET ISO8859_1’ +
‘ FILE ”’+ PathName + DBName + ‘2.fdb”’ + // create a 2nd file
‘ LENGTH=50000 STARTING AT PAGE 50001’;

ZConnection.Properties.Add(Props);
ZConnection.Connect;

// Now that the database is created
// create some tables, generators and triguers
ZScript.Script.Clear;
ZScript.Delimiter := ‘!!’; // necessary because of triguers
ZScript.DelimiterType := dtSetTerm; // use ZScriptParser
ZScript.LoadFromFile(ExtractFilePath(ParamStr(0)) + ‘createDB.sql’); // look below for the contents of this file
ZConnection.StartTransaction;
ZScript.Execute;
ZConnection.Commit;

ZConnection.Disconnect; // disconnect from database;

end;

create a text file name it createDB.sql and add the following lines to it
After, save it in the same folder where you create your exe.

SET TERM !! ;
Create Table TBL (
keycode Integer not null,
fchar char(9),
fvarchar varchar( 20 ),
fdate Date,
fblobText Blob sub_type 1,
PRIMARY KEY (keycode))!!
CREATE GENERATOR KEYCODE_GEN!!
Create Table TBLIMG (
keyimgcode integer not null,
fblobJPG Blob sub_type -1,
PRIMARY KEY (keyimgcode))!!
CREATE GENERATOR KEYIMGCODE_GEN!!
CREATE TRIGGER SET_KEYCODE FOR TBL
BEFORE INSERT AS
BEGIN
IF ((NEW.KEYCODE = 0) OR (NEW.KEYCODE IS NULL)) THEN
NEW.KEYCODE = GEN_ID(KEYCODE_GEN, 1);
END !!
CREATE TRIGGER SET_KEYIMGCODE FOR TBLIMG
BEFORE INSERT AS
BEGIN
IF ((NEW.KEYIMGCODE = 0) OR (NEW.KEYIMGCODE IS NULL)) THEN
NEW.KEYIMGCODE = GEN_ID(KEYIMGCODE_GEN, 1);
END !!

Posted in Code Hacks | Leave a comment

How to define transaction isolation level during connection

OCTweak writes “procedure TForm1.ConnectBtnClick(Sender: TObject);
begin
ZConnection.Properties.Clear;
ZConnection.HostName := ‘192.168.0.1’; // ip where Firebird is installed or leave blank if embed;
ZConnection.Database := ‘c:fibdatabasesTEST.FDB’;
ZConnection.User := ‘sysdba’;
ZConnection.Password := ‘masterkey’;
ZConnection.Properties.Add(‘codepage=ISO8859_1’);
ZConnection.TransactIsolationLevel := tiNone; // use ZDbcIntfs
// ==============================
// IMPORTANT
//The first element in every TPB must be the isc_tpb_version3 constant.
ZConnection.Properties.Add(‘isc_tpb_version3’);
// ==============================
ZConnection.Properties.Add(‘isc_tpb_concurrency’);
ZConnection.Properties.Add(‘isc_tpb_wait’);
ZConnection.Connect;
end;

Posted in Code Hacks | Leave a comment

Transactions, Locking, ZeosDBO, and You (Part 1)

Merlin writes “The ability to understand and transactions and use them from within your application is what makes you a truly great database developer. This article explains how to incorporate transactions into your database development strategies. A follow up artical will give specific example and suggestions about how to deal with transatcions while working with ZeosDBO.

Locking PostgreSQL/Transactions & Multi-Version Concurrency Control (MVCC) (Part 1)

This article is primarily geared towards PostgreSQL developers but the concepts can be applied to any database that supports transactions.
Part 1 will describe the overall concepts involved and lay the foundation for transaction based development. Part 2 give concrete real world examples on how to apply these concepts in ZeosDBO.
What are the reasons for moving to a transactional model?

Continue reading
Posted in Manuals | Leave a comment

Suggestion: remove drivers from ZConnection.pas and move to other unit

ssamayoa writes “A few days ago I began to test Zeos because I like the idea to make single applications which targets diferent dabatase servers, in my case Im interested on supporting Firebird, Oracle and MS SQL Server.


What I notice from the begining is the big size of EXE file. It is comprensible since all Zeos database drivers are linked because all driver units are referenced in ZConnection and each one has initialization code which instantiates the driver.

I saw some conditional compilation in the uses clause of the latest (from CVS) ZConnection.pas. Is a big step forward but still requiered compilation of part of Zeos to add or remove any driver from the EXE linking.

I think that ZConnection.pas shouldnt have in uses clauses any of the specific driver (PostgreSQL, Interbase and so), it should be moved to ZComponentReg.pas or new unit which must be added to ZComponents.dpk. With this change the compiled BPL used will have all drivers. The conditional compilation can be left on such unit allowing the developer the customization of ZComponent package.

Then, if the developer wants some drivers to be linked with his/her EXE, he/she just need add the desired driver’s unit to any of their own units.

What do you think?

Regards.

Posted in Code Hacks | Leave a comment