as a follow up to my post some time ago I now baught the IBDac source and compiled my application with debug data in those units too. As I use a modified JCL Exception dialog that shows the stack dump I could find the position in IBC where the mysterious thing happens and output some interesting data:
The client connects to 10.10.10.45/1709:d:\Programme\itcemil\emil.fdb25 (Firebird 2.5). 99% of the cases it works well. The remaining 1% the following thing happens:
I/O error during "CreateFile (open)" operation for file "D:\PROGRAMME\ITCEMIL\EMIL.FDB25"
Error while trying to open file
Das System kann den angegebenen Pfad nicht finden.
Fehlerklasse: EIBCError
This happens if I use the embedded client, a differend error occurs if I use the "normal" client. According to the Firebird documentation the embedded client is suitable for server connections. For 15 years I have been using the embedded client now without problems.
I tracked down the error to the following position and added some lines to your source to display the connection string used:
Code: Select all
IBCClasses.TGDSConnection.IBCError (Line 1728, "IBCClasses.pas" + 10)
IBCClasses.TGDSConnection.Check (Line 1709, "IBCClasses.pas" + 2)
IBCClasses.TGDSConnection.Connect (Line 2092, "IBCClasses.pas" + 42)
DBAccess.TCustomDAConnection.DoConnect (Line 4076, "DBAccess.pas" + 16)
IBC.TIBCConnection.DoConnect (Line 1961, "IBC.pas" + 7)
DBAccess.TCustomDAConnection.PerformConnect (Line 4192, "DBAccess.pas" + 8)
DBAccess.TCustomDAConnection.SetConnected (Line 5245, "DBAccess.pas" + 109)
DBAccess.TCustomDAConnection.Connect (Line 4169, "DBAccess.pas" + 1)
DBAccess.TCustomDAConnection.InternalConnect (Line 4139, "DBAccess.pas" + 7)
DBAccess.TCustomDADataSet.BeginConnection (Line 7629, "DBAccess.pas" + 14)
DBAccess.TCustomDADataSet.Execute (Line 8190, "DBAccess.pas" + 9)
DBAccess.TCustomDADataSet.Execute (Line 8173, "DBAccess.pas" + 1)
uPatOpenFile.TpatOpenFile.FormCreate (Line 216, "uPatOpenFile.pas" + 37)
Here is the modification I made from Line 2073 on in IBClasses.pas, ErrConnectInfo is a global variable in this unit that is read by my Exception dialog.
Code: Select all
try
GDS.Busy;
try
ErrConnectInfo := 'GDS.isc_attach_database: ' + FullDBName + ' (' + Encoding.
Default.GetString(FullDBNameB) + ') = ';
Res := GDS.isc_attach_database(FStatusVector, Length(FullDBNameB), FullDBNameB, FDatabaseHandle,
FDPBLength, {$IFDEF FPC}PChar{$ENDIF}(FDPB));
if Res <> 0 then
begin
try
ErrorNumber := Marshal.ReadInt32(FStatusVector, 1 * SizeOf(NativeInt));
except
ErrorNumber := -9999;
end;
ErrConnectInfo := ErrConnectInfo + IntToStr(Res) + ' - ' + IntToStr(ErrorNumber);
end;
finally
GDS.Release;
end;
GDS.isc_attach_database: d:\Programme\itcemil\emil.fdb25 (d:\Programme\itcemil\emil.fdb25) = 335544344 - 335544344
Somehow FullDBName strips off the Server information. So I think there must be some Error in IBC (also Unidac as it also happened with unidac).
Please help! I cannot supply a reproducable example as this is a sporadic error but I think this is evidence enough that the server information gets lost within IBDac and it has nothing to do with the client.
Thanks,
Michael