Migration from ZEOS to UniDac

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply

Have you moved from ZEOS to UniDac?

Yes
4
80%
No
1
20%
 
Total votes: 5

waheed
Posts: 20
Joined: Mon 02 Nov 2009 19:47
Location: Kuwait

Migration from ZEOS to UniDac

Post by waheed » Mon 17 Jan 2011 05:50

This is a first trial Post for those who are migrating from the free ZEOS component to the Supported UniDac components. I will update this post which would be a reference like my other post regarding Migration from ZEOS to MyDac. Hope this helps.

These are the tools used:

* GExperts @ http://www.gexperts.org/: I used Grep Search a lot to find items in the files.
* Beyond Compare @ http://www.scootersoftware.com/:

Of course you need to backup your project before starting the migration steps. I take no responsibility for any problems.
Before you start you need to make all forms Text DFM (right click on a form then select Text DFM at the end of the context menu)

In dfm files do the following (open the files as text from an external editor if you want)
* Replace TZConnection with TUniConnection and User to UserName and replace Protocol with ProviderName and delete TransactIsolationLevel properties.
* In ProviderName adjust the property value to (SQL Server, mySQL, ...), change HostName with Server
* Replace TZQuery with TUniQuery
* Replace TZReadOnlyQuery with TUniQuery and add ReadOnly = True be careful to do this step in the same time or you might loose track of which is which.
* Replace TZTable with TUniTable
* Replace LinkedFields property with DetailFields
* Replace SortedFields property by IndexFieldNames if needed
* Delete WhereMode property from TUniQuery
* Delete ShowRecordTypes property.
* Replace TZUpdateSQL with TUniUpdateSQL component notice that TUniQuery already have the updates properties and you might not need a TUniUpdate any way
* Delete All Params properties from UpdateSQL components since it is not there (needs more work, I'm still looking at it)
* Delete UseSequenceFieldForRefreshSQL from UpdateSQL components
* Replace TBooleanField with TStringField unless you used TinyInt as mentioned later.
* If you have FastReport and you have installed its related components, then replace frxZEOSDatabase with frxMyDacDatabase.
* In DBCheckbox component change the ValueCheck property from True to Y and the ValueUnchecked from False to N.

In Pas code files
* Replace EZSQLException with EUniError and add MyClasses to the uses
* Replace LinkedFields code lines with DetailFields
* SortedFields don't exist in MyDAC so replace them with IndexFieldNames
* Change HostName property to Server
* Change Protocol to ProviderName
* Replace ParamByName with Params.ParamByName

FastReport Items in your code:
* If you use frxMyDacDatabase in your code, change User property to UserName, and remove Protocol
* For frxUniQuery keep ParamByName
* For frxUniQuery replace .AsInteger, .AsString, ... to Value


Units used:
* Remove ZConnection, ZAbstractRODataset, ZAbstractDataset, ZAbstractTable, ZDataset, ZSqlUpdate units from the pas files.

AndreyZ

Post by AndreyZ » Wed 19 Jan 2011 09:47

Hello,

We are planning to support migration from ZEOS in the next version of UniDAC and MyDAC.

Goaul
Posts: 4
Joined: Mon 02 Sep 2013 19:07

Re: Migration from ZEOS to UniDac

Post by Goaul » Wed 11 Sep 2013 15:06

Hello,

1. i see that migration still not implemented; :)
2. additional to post:
in .dfm files
+ Replace TZSQLProcessor with TUniScript

in .pas files
+ Replace TZSQLProcessor.Script with TUniScript.SQL
+ Replace .GetCatalogNames with .GetDatabaseNames

under uses
+ Remove ZConnection, ZAbstractRODataset, ZAbstractDataset, ZAbstractTable, ZDataset, ZSqlProcessor, ZSqlUpdate, ZAbstractConnection
+ Add Uni

Connection setting .Ping can be replaced with .ExecSQL('SELECT NULL', [])

Post Reply