Subject | Re: [IBO] "Unavailable database"? |
---|---|
Author | ra8009 |
Post date | 2005-09-27T05:58:59Z |
Helen wrote: "Could you please paste the entire code for the procedure
where you do this, including the full handler declaration with arguments?"
I've included the entire event handler and object definition below.
LoginUser is "SYSDBA" and LoginPassword is "masterkey". I've also been
able to reproduce the error with simpler code. If I've missed
information you need just let me know:
object MainConnection: TIB_Connection
PasswordStorage = psNotSecure
SQLDialect = 3
Params.Strings = (
'PATH=C:\data\customer.FDB'
'USER NAME=SYSDBA'
'PROTOCOL=TCP/IP'
'SQL DIALECT=3')
Left = 36
Top = 24
SavedPassword = '.JuMbLe.01.432B0639073E0E4B49'
end
procedure TMainDM.DataModuleCreate(Sender: TObject);
var
AppPath,ServerName:String;
IniFile:TIniFile;
begin
With MainConnection do
begin
Disconnect;
OpenIniFile;
Database := IniFile.readString('MAIN','AppDatabasePath','');
Server := IniFile.readString('MAIN','Server','');
UserName := LoginUser;
Password := LoginPassword;
try
connect;
except on E:Exception do
begin
MessageDlg('Unable to connect to database: '+Database+'
'+E.Message,mtInformation,[mbOk],0);
Application.Terminate;
end
end;
end;
where you do this, including the full handler declaration with arguments?"
I've included the entire event handler and object definition below.
LoginUser is "SYSDBA" and LoginPassword is "masterkey". I've also been
able to reproduce the error with simpler code. If I've missed
information you need just let me know:
object MainConnection: TIB_Connection
PasswordStorage = psNotSecure
SQLDialect = 3
Params.Strings = (
'PATH=C:\data\customer.FDB'
'USER NAME=SYSDBA'
'PROTOCOL=TCP/IP'
'SQL DIALECT=3')
Left = 36
Top = 24
SavedPassword = '.JuMbLe.01.432B0639073E0E4B49'
end
procedure TMainDM.DataModuleCreate(Sender: TObject);
var
AppPath,ServerName:String;
IniFile:TIniFile;
begin
With MainConnection do
begin
Disconnect;
OpenIniFile;
Database := IniFile.readString('MAIN','AppDatabasePath','');
Server := IniFile.readString('MAIN','Server','');
UserName := LoginUser;
Password := LoginPassword;
try
connect;
except on E:Exception do
begin
MessageDlg('Unable to connect to database: '+Database+'
'+E.Message,mtInformation,[mbOk],0);
Application.Terminate;
end
end;
end;