Subject RE: [firebird-support] Sync database metadata
Author Alan McDonald
>
> Hello,
>
> I need to sync two databases - update users database to newer version.
> This task can be achieved with IBExpert, but don't want each user to
> buy
> IBExpert, also now we are facing the problem of more complicated
> database changes.
> Droppping evething except tables in database was not difficult. The
> problem is to create everything back, after the necessairy updates are
> done. The problem is:
> * IBOQuery component fails to alter one procedure (ALTER PROCEDURE
> statement fails with mityrious error).
> * A query component from UIB does the job, but all commented lines are
> gone. This is not a desired effect, as well as we can't be sure, that
> everything was successfull (IBExpert compare is how we check that).
> Database structure is simply too large to check manually.
>
>
> I've been trying to solve the problem by working directly with Firebird
> API, but here I have some trouble: a call to isc_start_transaction()
> causes Access Violation. I'm using Borland C++ Builder 6. Can anyone
> point me to an error? Here's the source for a program:
>
>

Just use the script created by IBExpert in a script component (not a query component). e.g. IB_Script
the script to move from version 1 to version 2 for you database will fire is the database version table (your table) has an entry value of 1. when the script completes, update the version table to 2.
You will still need to ensure exclusive access to the database during the script execution (depending on what’s in the script)
Alan