Migration IBX-IBDAC

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
WLE
Posts: 3
Joined: Fri 08 Oct 2010 19:15

Migration IBX-IBDAC

Post by WLE » Fri 08 Oct 2010 20:35

Hi,

I had migrated a project (100k LOC) from IBX to IBDAC with the wizard in less than 3 hours. This is really great!!!

Some suggetions:
1. In some Units no IBC is added to uses clause
2. generator-Settings are not converted

this would be more complicated:
3. Change InTransaction to Active
4. Transaction.Database to Transaction.DefaultConnection
5. Query/Dataset.Database to Connection
6. comment Query/Dataset.close
7. change Query/dataset.ExecSQL to .Execute

I need to test the app for some time, if I found something more I post it here....

anyway: Thank you very much!!! You save me some sleepless nights :-)

AndreyZ

Post by AndreyZ » Mon 11 Oct 2010 13:03

Hello,

Migration Wizard serves only to simplify routine operations, that's why if IBDAC components don't have the same properties and methods IBX components do, you should replace them manually.
We will take your suggestions into consideration, thank you.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 13 May 2011 08:23

WLE wrote:Some suggetions:
1. In some Units no IBC is added to uses clause
2. generator-Settings are not converted

this would be more complicated:
3. Change InTransaction to Active
4. Transaction.Database to Transaction.DefaultConnection
5. Query/Dataset.Database to Connection
6. comment Query/Dataset.close
7. change Query/dataset.ExecSQL to .Execute
1. IBC unit is added by Delphi IDE automatically when opening a form where IBDAC components are placed.

3. Migration Wizard doesn't parse and change source code. We change only published properties and therefore we cannot change InTransaction to Active.

4. In the latest IBDAC version Migration Wizard changes Transaction.DefaultDatabase to Transaction.DefaultConnection.
5. In the latest IBDAC version Migration Wizard changes Query/Dataset.Database to Connection.

6. Why do you need to comment Query/Dataset.Close? It is a correct method.

7. The TIBCQuery component has the ExecSQL method that has the same functionality as the Execute method and is implemented for compatibility with IBX. Therefore you don't need to change this method.

PizzaProgram
Posts: 3
Joined: Mon 17 Sep 2018 10:17

Re: Migration IBX-IBDAC

Post by PizzaProgram » Mon 17 Sep 2018 11:13

Dear Developers,

I agree with WLE. I've spent 6! days with the migration process. 95% of this work could have been avoided, if:
  • 1.) Migr.Wizard would take care most of these keyword-replacements
    2.) a list of Tricks&Tips would have showed: how to do a complete migration, what to be aware, etc.
Delphi 7 code-completion does NOT work until all errors are fixed. So this job was a nightmare.
I'm an experienced Delphi developer with 25 years of experience, but without this topic I had no idea how to deal with "unknow property: InTransaction" ...

Here are other things I've encountered:
(I write those down to help others. The solution is after the >> part )

Code: Select all

[Error]...: Undeclared identifier: 'InTransaction'
	>> .Active
	
[Error] IBScript1.Close;   
	>>  Comment out or delete //IBScript1.Close;

[Error] NetLekeres.pas(734): Undeclared identifier: 'DefaultAction'
	>> .DefaultCloseAction

TRTR.DefaultDatabase  
	>> TRTR.DefaultConnection

[Error]...: Undeclared identifier: 'RefreshSQL'
	>> 'SQL'
	
[Error]...: Undeclared identifier: 'AsInt64'
	.AsLargeInt
	TLargeIntField(...FieldbyName('...')).AsLargeInt
	

TIBEvents >> TIBCAlerter
	uses ... IBEvents 	>> DAAlerter, IBCAlerter
	Registered		>> Active
	DataBase 		>> Connection
	OnEventAlert 		>> OnEvent
	(Sender: TObject; EventName: String; EventCount: Integer; var CancelAlerts: Boolean);
		>>(Sender: TObject; EventName: String; EventCount: Integer);
	
IBCBackupService
UBCRestoreService
	Params .. User Pass >>  .Username   .Password
	DatabaseName 		>>  Database
	ServerName			>>  Server
	
IBCScript
	.Script.Text	>> .SQL.Text
	.Database	>> .Connection
	.Terminator	>> .Delimiter
	
TIBCQuery
	.InsertSQL 	>> SQLInsert
	.ModifySQL	>> SQLUpdate
	.BufferChunks	>> FetchRows
	.LocateNext	>> LocateEx
	
LocateNext >> LocateEx(...)
	[loCaseInsensitive,loPartialKey] >> 
	[l[b]x[/b]CaseInsensitive, [b]lxPartialCompare, lxNext[/b]]

	
EIBInterBaseError  >> EIBCError (uses IBCError)
	.IBErrorCode >> .ErrorCode


Error: The DS_VevokUpdateRecord method referenced by DS_Vevok.OnUpdateRecord has an incompatible parameter list.
[Error]...: Incompatible types: 'TUpdateAction' and 'TIBUpdateAction'
	procedure ...UpdateRecord(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
		UpdateAction := uaAbort;  >>  UpdateAction := DB.uaAbort	;


TIBServerProperties >> 	TIBCServerProperties (uses IBCAdmin)
	.ServerName >> .Server 
	
TIBDataBaseInfo	>>  TGDSDatabaseInfo (uses IBCClasses)
	(!!! NOT TIBCDataBaseInfo !!!)
	https://www.devart.com/ibdac/docs/devart.ibdac.tgdsdatabaseinfo%20members.htm	
	
	Error: Unknown SPB ...
		sql_dialect=3'#13' << delete from Params

	Error: Unknown SPB constant (lc_ctype)


Project ... raised exception class EDatabaseError with message 'DS_Tetelek: Type mismatch for field 'Áfa_helyi', expecting: [b]BCD actual: Float[/b]'. Process stopped. Use Step or Run to continue.

---------------------------
Debugger Exception Notification
---------------------------
Project ... raised exception class EIBCError with message 'invalid parameter in transaction parameter block
Found more than one transaction isolation in TPB'. Process stopped. Use Step or Run to continue.
    (The saved .DFM file showed '[b]snapshot[/b]' while doubl-clicking the component showed '[b]ReadCommited[/b]' !! )
	Solution: >> Double Click Transaction >> change isolation to something other >> OK >> DblClick >> change back >> OK


DataModule >> View as Text	
	Module 'E:\FFFFF\Pizza\prg\Datas.pas' has open descendents or linked modules. Cannot close.
	 ? could not find a solution yet. :-( 
... and there were of course some more I've forgot to copy.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Migration IBX-IBDAC

Post by ViktorV » Mon 17 Sep 2018 12:58

As we wrote earlier, the Migration Wizard serves only to simplify routine operations, and after the conversion, the project might be uncompiled. This wizard replaces IBX components in the specified project (dfm-and pas-files) with IBDAC (UniDAC) components. If IBDAC (UniDAC) components do not have the same properties and methods that IBX components do, you should replace them manually.

Post Reply