Beginner's question regarding DB create
Posted: Tue 24 Jan 2012 13:29
I would like to programmatically create a Firebird DB. I found that I need to have an existing DB and can then use SQL to create the DB. I created an initial DB using FlameRobin, but cannot connect to it using DBExpress. I use Delphi XE and FB 2.5.1
Can someone show me what is wrong with the code. It complains about
"Unsupported on-disk structure for file ...\MASTER.FDB; found 32779, support 13
Code: Select all
procedure TFirebirdDB.CreateFireBDB;
// This procedure connects to a default DB and then uses SQL to create a DB
var
TmpCnx : TSQLConnection;
begin
TmpCnx := TSQLConnection.Create(nil);
TmpCnx.DriverName := 'DevartInterbase';
TmpCnx.LibraryName := 'dbexpida40.dll';
TmpCnx.VendorLib := 'C:\Windows\System32\fbclient.dll';
TmpCnx.GetDriverFunc := 'getSQLDriverINTERBASE';
TmpCnx.Params.values['Database'] := IncludeTrailingPathDelimiter(fDBPath)
+ 'MASTER.fdb';
// Set the passwords
TmpCnx.LoginPrompt := false;
TmpCnx.Params.values['User_name'] := fmyUser;
TmpCnx.Params.values['Password'] := fmyPassword;
try
TmpCnx.open;
except
on E: Exception do
begin
MessageDlg(fDBPath + fDBName + '.fdb' + #13 + #10 +
'Master DB connection failure - call system administrator. ' + #13
+ #10 + 'Error Message: ' + E.Message, mtWarning, [mbOK], 0);
exit;
end;
end;
end;
"Unsupported on-disk structure for file ...\MASTER.FDB; found 32779, support 13