Create FirebirdSQL database on remote server
Posted: Thu 25 Feb 2021 19:25
Hello,
I am using Delphi 10.3.3, UniDAC 8.3.2, FirebirdSQL 2.5.9 and targeting Win32 executable.
I have below function which works fine on computers where FirebirdSQL server is installed, my application is installed and database is created on that very same computer.
I now need to create a database on a remote server. Lets say, My application is running on computer A and there is another computer B on same LAN. I want to create a database from A on B. When I used above function to achieve that I got below error written in my log
I did double check that target directory exists on the remote computer. I also manually copy a firebirdsql database on that directory on remote server and I could establish a successful connection, write data in it, etc. My only problem is that I cannot remotely create a database.
Any help is appreciated.
Thanks & Regards,
Ertan
I am using Delphi 10.3.3, UniDAC 8.3.2, FirebirdSQL 2.5.9 and targeting Win32 executable.
I have below function which works fine on computers where FirebirdSQL server is installed, my application is installed and database is created on that very same computer.
Code: Select all
function CreateFdbDatabase(const DBName, Server, DatabaseUser, DatabaseUserPassword, FBClientDll:string): Boolean;
var
DB: TUniconnection;
Script: TUniScript;
begin
DB := nil;
Script := nil;
try
DB := TUniConnection.Create(nil);
DB.ProviderName := TInterBaseUniProvider.GetProviderName();
DB.SpecificOptions.Values['ClientLibrary'] := FBClientDll;
Script := TUniScript.Create(nil);
Script.OnError := TMyClass.ScriptError;
Script.Connection := DB;
Script.NoPreconnect := True;
Script.SQL.Add('create database ' + QuotedStr(DBName));
Script.SQL.Add('USER ' + QuotedStr(DatabaseUser) + ' PASSWORD ' + QuotedStr(DatabaseUserPassword));
Script.SQL.Add('PAGE_SIZE 16384 DEFAULT CHARACTER SET WIN1254');
try
Script.Execute();
except
on E: Exception do
begin
if Assigned(FirebirdSQLLog) then FirebirdSQLLog.LogError('Script Error: ' + E.Message);
Exit(False);
end;
end;
Result := True;
finally
Script.Free();
DB.Free();
end;
end;
Code: Select all
Script Error: I/O error during "CreateFile (create)" operation for file "C:\DB\BRANCH\TEST.FDB" Error while trying to create file Sistem belirtilen yolu bulamıyor.
Any help is appreciated.
Thanks & Regards,
Ertan