Page 1 of 1

database path length limit for IBCQuery?

Posted: Thu 30 Apr 2015 13:05
by Bjarke_Moholt
I get an error when running queries from IBCQuery on a database with a very long path (I'm guessing the limit is 255 characters): 'Invalid connection string. Cannot transliterate character between character sets'.
Surroundings: Delphi XE, IBDAC 5.4.12, Firebird 2.5.3


sample code:

Code: Select all

Connection := TIBCConnection.Create(nil);

Connection.AutoCommit          := True;
Connection.ClientLibrary       := 'gds32.dll';
Connection.Database            := LONGDBPATH;  // <-- critical parameter
Connection.Debug               := false;
Connection.LoginPrompt         := True;
Connection.Options.AllowImplicitConnect  := True;
Connection.Options.CharLength            := 0;
Connection.Options.DisconnectedMode      := False;
Connection.Options.EnableBCD             := False;
Connection.Options.EnableFMTBCD          := False;
Connection.Options.EnableMemos           := False;
Connection.Options.KeepDesignConnected   := True;
Connection.Options.LocalFailover         := False;
Connection.Options.Protocol              := TCP;
Connection.Options.TrustedAuthentication := False;
Connection.Options.UseUnicode            := False;
Connection.Password              := 'masterkey';
Connection.Pooling               := False;
Connection.Port                  := '3050';
Connection.Server                := '';
Connection.SQLDialect            := 3;
Connection.Tag                   := 0;
Connection.Username              := 'sysdba';

Query := TIBCQuery.create(nil);
Query.Connection := Connection;
Query.SQL.Clear;
Query.SQL.Add('SELECT * FROM SOMETABLE');
Query.Open; //exception here
Is there a way to resolve this, or should I restrain the connection strings?

Re: database path length limit for IBCQuery?

Posted: Tue 05 May 2015 10:14
by ViktorV
The issue is not due to IBDAC. Firebird has a limitation for database full path (including the file name) by 260 characters, that corresponds the maximum file path length in Windows. A similar error is reproduced in any third-party utility in case of specifying a database path longer than 260 characters.

Re: database path length limit for IBCQuery?

Posted: Wed 06 May 2015 10:43
by Bjarke_Moholt
Thank you, that answers my question.

Re: database path length limit for IBCQuery?

Posted: Wed 06 May 2015 12:03
by ViktorV
Feel free to contact us if you have any further questions about IBDAC.