Re: Firebird 4.0.5 Connection String Question...

48 views
Skip to first unread message

Steve Naidamast

unread,
Oct 28, 2024, 12:37:17 PM10/28/24
to firebird-net-provider
Hello...

I have recently upgraded my entire project to Firebird 4.0.5 with Jiri's latest ADO.NET provider (10.31.1).

I am using the Firebird Embedded cofiguration.

Previously using Firebird 2.5 my connection string worked fine with an included database-file-path as follows...

>>>
"User=SYSDBA;Password=masterkey;DataSource=localhost;Database=AGK_WORKBENCH.FDB;Dialect=3;Charset=UTF8;ServerType=1;"
<<<

In the upgraded project, this connection string does not work.  If I take out the path as a result of having the database within the root directory of my project, everything appears to work.

Please note that I have removed both the "Dialect" and the "Charset" in the 4.0.5 connection string.

Has there been a change in how the connection strings are configured for the 4.x.x database engines?

Thank you...

Steve Naidamast
Sr. Software Engineer

Jiří Činčura

unread,
Oct 29, 2024, 9:25:38 AM10/29/24
to 'Mr. John' via firebird-net-provider
No.

--
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/
> --
> You received this message because you are subscribed to the Google
> Groups "firebird-net-provider" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to firebird-net-pro...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/firebird-net-provider/ec097675-78e1-4e62-b905-c3d9c230081dn%40googlegroups.com
> <https://groups.google.com/d/msgid/firebird-net-provider/ec097675-78e1-4e62-b905-c3d9c230081dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mark Rotteveel

unread,
Oct 29, 2024, 9:54:55 AM10/29/24
to firebird-n...@googlegroups.com
On 28/10/2024 17:37, Steve Naidamast wrote:
> I have recently upgraded my entire project to Firebird 4.0.5 with Jiri's
> latest ADO.NET provider (10.31.1).
>
> I am using the Firebird Embedded cofiguration.
>
> Previously using Firebird 2.5 my connection string worked fine with an
> included database-file-path as follows...

Where was fbembed.dll/fbclient.dll located when you used Firebird 2.5,
and where is it located now you're using Firebird 4.0?

What is the location of the executable, and what is the location of the
database file?

> >>>
> "User=SYSDBA;Password=masterkey;DataSource=localhost;Database=AGK_WORKBENCH.FDB;Dialect=3;Charset=UTF8;ServerType=1;"
> <<<
>
> In the upgraded project, this connection string does not work.  If I
> take out the path as a result of having the database within the root
> directory of my project, everything appears to work.

What do you mean with "If I take out the path as a result of having the
database within the root directory of my project"?

> Has there been a change in how the connection strings are configured for
> the 4.x.x database engines?

I do think something changed with how relative paths are resolved
starting with Firebird 3.0, but I'm not sure of the specifics, or if
that applies in the case of embedded, or only when connecting through a
server.

Mark
--
Mark Rotteveel

Steve Naidamast

unread,
Oct 29, 2024, 10:33:26 AM10/29/24
to firebird-net-provider
Thank you, Mark, for your reply...

I didn't notice it when I posted my query but I put up the wrong sample connection string...  My apologies...

This is the connection-string that I should have posted...  (This connection string with Firebird 2.5 works with the 2.5 database file and the correct fbclient.dll, which is in the application's root directory.)

   User=SYSDBA;Password=masterkey;DataSource=localhost;Database=C:\Databases\Firebird\Databases\4.0.5 Databases x64\MS_WORKBENCH.FDB;ServerType=1;Client Library=fbclient.dll;

However, the above connection string does not work with the Firebird 4.0.5 client\ADO.NET provider.  Yet, when the file path is removed and I access the database file in the application's root directory
using the connection string below, everything works as expected...

   User=SYSDBA;Password=masterkey;DataSource=localhost;Database=MS_WORKBENCH.FDB;ServerType=1;Client Library=fbclient.dll;

This is why I have asked if something has changed in the ADO.NET provider.  However, that may have been the wrong question, as you suggest, in that it has more to do with the fbclient.dll...

I did however, research the the 4.0.5 Release Notes and the User Guide on this matter but did not find anything that related to this issue.

Any clarification you could provide would be very much appreciated.

Thank you...

Steve Naidamast
Sr. Software Engineer

Mark Rotteveel

unread,
Oct 29, 2024, 10:41:14 AM10/29/24
to firebird-n...@googlegroups.com
On 29/10/2024 15:33, Steve Naidamast wrote:
> Thank you, Mark, for your reply...
>
> I didn't notice it when I posted my query but I put up the wrong sample
> connection string...  My apologies...
>
> This is the connection-string that I should have posted...  (This
> connection string with Firebird 2.5 works with the 2.5 database file and
> the correct fbclient.dll, which is in the application's root directory.)
>
>    User=SYSDBA;Password=masterkey;DataSource=localhost;Database=C:
> \Databases\Firebird\Databases\4.0.5 Databases
> x64\MS_WORKBENCH.FDB;ServerType=1;Client Library=fbclient.dll;
>
> However, the above connection string does not work with the Firebird
> 4.0.5 client\ADO.NET provider.  Yet, when the file path is removed and I
> access the database file in the application's root directory
> using the connection string below, everything works as expected...
>
>
> User=SYSDBA;Password=masterkey;DataSource=localhost;Database=MS_WORKBENCH.FDB;ServerType=1;Client Library=fbclient.dll;
>
> This is why I have asked if something has changed in the ADO.NET
> provider.  However, that may have been the wrong question, as you
> suggest, in that it has more to do with the fbclient.dll...
>
> I did however, research the the 4.0.5 Release Notes and the User Guide
> on this matter but did not find anything that related to this issue.
>
> Any clarification you could provide would be very much appreciated.

Exactly what error do you get?

Mark
--
Mark Rotteveel

Steve Naidamast

unread,
Oct 29, 2024, 10:44:47 AM10/29/24
to firebird-net-provider
Mark...

I did find the following after you had mentioned there may have been a change in the use of file paths starting with Firebird 3.0.


Within this documentation, I found the following...  (Please see the last section, highlighted in red.)

>>>
Additionally, Firebird 3.0 introduces generalized URL-like syntax for
connection strings:

  [ <protocol> : // [ <host> [ : <port> ] ] ] / <file path to database or alias>

Where protocol is one of: INET (means TCP) or XNET (means shared memory).

Examples:

  Connect via TCP using database name:

    inet://192.168.0.11//db/mydb.fdb
    inet://192.168.0.11/C:\db\mydb.fdb
    inet://myserver/C:\db\mydb.fdb
    inet://localhost//db/mydb.fdb

  Connect via TCP using database alias:

    inet://192.168.0.11/mydb
    inet://myserver/mydb
    inet://localhost/mydb

  Connect via TCP using non-default port 3051:

    inet://192.168.0.11:3051/C:\db\mydb.fdb
    inet://192.168.0.11:3051/mydb
    inet://myserver:3051//db/mydb.fdb
    inet://localhost:3051//db/mydb.fdb
    inet://myserver:3051/mydb
    inet://localhost:3051/mydb

  Connect via TCP using non-default service name:

    inet://192.168.0.11:fb_db/C:\db\mydb.fdb
    inet://192.168.0.11:fb_db/mydb
    inet://localhost:fb_db//db/mydb.fdb
    inet://myserver:fb_db//db/mydb.fdb
    inet://myserver:fb_db/mydb
    inet://localhost:fb_db/mydb

  The "inet" protocol can be replaced by "inet4" or "inet6" to restrict client
  to IPv4 or IPv6 addresses corresponding to supplied name ("inet" protocol
  tries all addresses in the order determined by OS):

    inet4://myserver/mydb
    inet6://myserver/mydb

  Loopback connection via TCP:

    inet:///db/mydb.fdb
    inet://C:\db\mydb.fdb
    inet://mydb

  Local connection via shared memory:

    xnet://C:\db\mydb.fdb
    xnet://mydb

  Local (embedded by default) connection:

    /db/mydb.fdb
    C:\db\mydb.fdb
    mydb
<<<

Steve Naidamast
Sr. Software Engineer


Mark Rotteveel

unread,
Oct 29, 2024, 10:52:19 AM10/29/24
to firebird-n...@googlegroups.com
On 29/10/2024 15:44, Steve Naidamast wrote:
> Mark...
>
> I did find the following after you had mentioned there may have been a
> change in the use of file paths starting with Firebird 3.0.
>
> This is the link for this information... https://github.com/FirebirdSQL/
> firebird/blob/master/doc/README.connection_strings <https://github.com/
> FirebirdSQL/firebird/blob/master/doc/README.connection_strings>
>
> Within this documentation, I found the following...  (Please see the
> last section, highlighted in red.)

I don't see the relevancy to highlight that. Why do you think it's
relevant? (And to be clear, the highlighted part was already the same
before Firebird 3.0, though now it's more likely to use the embedded
engine instead of the XNET protocol compared to Firebird 2.5 and older.)

What I was talking about was how Firebird (server or possibly the
engine) resolves relative paths. I vaguely recall something changed
there, but given you specify an absolute path, I don't think it's
relevant here.

Mark
--
Mark Rotteveel

Steve Naidamast

unread,
Oct 29, 2024, 10:53:10 AM10/29/24
to firebird-net-provider
Mark...

This is simply not possible...  :-(

I re-entered the connection string with a complete file path as shown below to produce the error for you, and this time it worked as expected...

   User=SYSDBA;Password=masterkey;DataSource=localhost;Database=C:\Databases\Firebird\Databases\4.0.5 Databases x64\MS_WORKBENCH.FDB;ServerType=1;Client Library=fbclient.dll;

I have been trying to resolve this issue for several days and now all of  sudden it starts working.

I am using Visual Studio 2022, with the latest update to the software, .NET CORE 8.0, and VB.NET.

At first I thought it was because I had some data in the table I was accessing.  But I deleted the data and re-accessed the table through my application and everything till worked as expected.

Steve Naidamast
Sr. Software Engineer

João Bosco

unread,
Nov 1, 2024, 4:29:58 AM11/1/24
to firebird-net-provider
I see that lot of articles or questions like that.

Try using "Pooling=False"
Reply all
Reply to author
Forward
0 new messages