Subject Re: [firebird-support] using TIBValidateService with FB 1.5 database (IBX 7.08)
Author Helen Borrie

At 07:25 AM 2/08/2005 +0000, you wrote:
>Hi there guys,
>The following code works, but it logs only one empty line.
>Is it supposed behaviour of TIBValidationService or am i missing
> with IBValidationService do
> begin
> ServerName := 'localhost';
> LoginPrompt := False;
> Params.Add('user_name=SYSDBA');
> Params.Add('password=masterkey');
> Screen.Cursor := crHourGlass;
> Attach;
> Active := True;
> try
> Options := [CheckDB, ValidateDB];
> DatabaseName := 'C:\Projects\WorkFlowPro\ENV.GDB';
> ServiceStart;
> while not Eof do
> mmLog.Lines.Add(GetNextLine);
> finally
> Active := False;
> Screen.Cursor := crDefault
> end;
> end

[CheckDB,ValidateDB] are not compatible options. CheckDB is a read-only
operation, while ValidateDB finds and tries to eliminate orphaned
structures. It will report logically corrupt but won't try to mend
them. You need a separate run with the MendDB option, to disable such

Alter the way the your tool works, so that you run it with [CheckDB] to get
a report (if any) of corrupt structures; if the log comes up with something
in it, then reset the options and run it with ValidateDB.

To get an idea of what to expect in the log, run the underlying gfix
options in the command line. [CheckDB] is gfix -v -n, while [ValidateDB]
is gfix -v. You can combine either of these options with [IgnoreChecksum],
equvalent to gfix -v -n -i and gfix -v -i respectively.

Remember, too, that the user has to be sysdba, and have exclusive access,
in order to run most of the TIBValidationService options.

If you haven't done so already, read this paper:

It should give you an idea how the various options work and also perhaps
inspire you to think about how you could combine a TIBValidationService and
a TIBBackupService in your tool.

Just to reality check the situation, do make sure that your TIBXxxxxxxxx
service objects are connecting through the "Borland compatibility" client
when you first compile your app; otherwise you are likely to bump into
problems with these components in the Delphi IDE.

Also, be aware that the service components won't work in the IDE if you are
running the Classic server. To date, I don't know of any workaround for
this, other than to develop using SuperServer.

Another thing - it's possible that Borland will change the way the service
components work, over time, since they are designed to work with InterBase,
not Firebird. The same goes for the InterBaseXpress data access
components. You might like to consider swapping over to the TIBOAdmin
components and IB Objects. I expect there is Firebird-compatible support
for the Services API in some of the other component suites as well.