Subject Re: [IBO] IBX to IBO porting
Author Helen Borrie

At 09:57 AM 9/11/2004 +0000, you wrote:

>Greetings all,
>My company has been running IB6.0 since its release and built a
>suite of apps based around IBX components, using Delphi 5 and 7.
>At this point I am considering upgrading from IB6.0, possibly to
>Firebird, however I have heard that it IBX and FB do not mix very
>well, hence this posting: how hard is it to port from IBX to IBO,

not exactly straightforward (but worth the effort!)

>can it be done with a simple search and replace,


> or is it more complex than that?

How I'd approach it is to work item-by-item with the objects in your
datamodule, using the TDataset-compatible components. Don't compile
anything; but work through the components, duplicating each IBX object
with its closest TIBO equivalent and setting the equivalent properties.

Before you begin, open your datamodule as text and copy-paste the entire
contents to a text file and save the text file. Then, go back into form mode.

Initially, use a TIBODatabase and a TIBOTransaction. However, on the
TIBODatabase, don't duplicate the server params. Instead, use the Server,
Path, Protocol, Username and Password properties. Set PasswordStorage to
psNotSecure and set LoginPrompt false. Hook up the TIBOTransaction to the
DefaultTransaction property of the TIBODatabase.

Use a TIBOQuery to duplicate each dataset component (IBQuery or
IBDataset), pick up a TIB_DSQL to duplicate an IBSQL. Initially, replace
IBStoredProc with TIBStoredProc (though later, you will find better ways to
manage stored procedures in IBO). Set just the SQL property to begin
with. When you have them all, rubber-band them all. Select as the
IB_Connection property your TIBODatabase and as the IB_Transaction property
your TIBOTransaction.

If you have any IBClientDatasets, replace them with
TClientDatasets; however, IBO doesn't need a clientdataset component to
get a scrolling dataset so, if that's all you use IBClientDataset for, you
won't need to convert them.

At this point, perform a Save All and then take a backup (filesystem
copy) of the pas and dfm files. You will want this to retrieve your
handler code from later.

Next, go through and delete all of the IBX objects from the
datamodule. Check the declarations to make sure they have gone. The
handler code should have been deleted as well - some of this you will want
to retrieve from the backed up files.

Next, go into the source of all of the forms and the datamodule and comment
out the IBX units in the uses clauses and also dbtables. You may find
dbtables has been added to uses clauses in other places, so it's best to do
a search all files for it.

After that, save all again and then close all.

When you reopen the project, just click Ignore on the exceptions and let
Delphi delete anything it asks to delete.

The project won't compile at this stage, but do a ctrl-F9 and take note of
all the warnings and the fatal error that prevents the compile from
completing. From there, it's just a reiterative process to retrieve the
missing pieces from the old source and replace it in the new version. Just
keep doing this and attempting a compile each time until the compile
eventually completes successfully.

Something that's important to do in IBO is to ensure that all dataset
components have KeyLinks. This is a stringlist property that you can
access in the Object Inspector. In there, type one column name for each
column that is part of the unique key of the records in the dataset
(usually the primary key fields on a single-table query).

Beyond that, follow the Help text and the Delphi help and, of course, ask

>And if so, has anyone knocked together any tools to help the process?

Not that I have heard of.