Subject | Re: [firebird-support] Connection String question - vb.net - embedded |
---|---|
Author | Helen Borrie |
Post date | 2010-01-21T21:46:41Z |
Sorry, list, I let this message through by mistake.
Rick, this question belongs on the firebird-net-provider list. Some inline comments here might help you to post a more informative message when you take it there.
At 05:17 AM 22/01/2010, rickgeorge88 wrote:
An application connects to a * firebird server * through the appropriate * firebird client library * . The "embedded" connection model uses a library that is a merger of the Firebird client and an exclusive instance of the Firebird server.
The connection protocol is all-important. The embedded client can't use a network protocol: it is designed for stand-along use on a single machine. The embedded client and server talk to each other in the inter-process communication space of the user application, NOT across a network connection (not even TCP/IP local loopback server Localhost!)
The client library presents a uniform interface of functions for communication between applications and the server. Each host-language driver wraps the application's calls to this client lib (API) in language that your host language can work with. For vb.net, you need the Firebird dotNet provider.
Your .NET driver layer provides properties that the driver will use to compose a connection string with the correct format for the protocol you want. I'm not a .NET developer but I believe the ServerType property is what the driver uses to decide what protocol you want. "Localhost" or anything else related to a network protocol is not valid for an embedded connection.
You can use the file aliases.conf to set up the file location so that any connecting application can supply the alias instead of the actual path. This is particularly desirable if you want the application to be portable. For example, an entry in aliases.conf like so:
MyDB = C:\data\MyData.fdb
..will enable you to use the alias for the Database property of your connection instead of hard-coding the path. If you install your embedded structure on another machine, with the database located in a different place, you only have to open aliases.conf and edit the path for the hard-coded alias.
But - whatever - take this to the right list and provide enough detail so that the experts there understand your setup.
^ heLen ^
Rick, this question belongs on the firebird-net-provider list. Some inline comments here might help you to post a more informative message when you take it there.
At 05:17 AM 22/01/2010, rickgeorge88 wrote:
>I have tried various ways of connecting (Google) to an embedded firebird databaseThere is no such thing as "an embedded firebird database". A database is a database. Connections can be made to it by any of the three models of Firebird server (Classic, Superserver or Embedded).
An application connects to a * firebird server * through the appropriate * firebird client library * . The "embedded" connection model uses a library that is a merger of the Firebird client and an exclusive instance of the Firebird server.
The connection protocol is all-important. The embedded client can't use a network protocol: it is designed for stand-along use on a single machine. The embedded client and server talk to each other in the inter-process communication space of the user application, NOT across a network connection (not even TCP/IP local loopback server Localhost!)
The client library presents a uniform interface of functions for communication between applications and the server. Each host-language driver wraps the application's calls to this client lib (API) in language that your host language can work with. For vb.net, you need the Firebird dotNet provider.
>and I just can't seem to get the connection string correct.Subscribe to the firebird-net-provider list and ask about the connection properties directly. Don't forget to say which versions of fbembed.dll, the dotNet client and the .NET framework you are working with.
>Is there a 'local' shorter version for the connection string to an embedded database?Connection to a database via any server model must resolve to a full local path (not a mapped location or a relative path). The connection string that is ultimately passed must enable the server (any model, including embedded) to find the database on its own host file system.
Your .NET driver layer provides properties that the driver will use to compose a connection string with the correct format for the protocol you want. I'm not a .NET developer but I believe the ServerType property is what the driver uses to decide what protocol you want. "Localhost" or anything else related to a network protocol is not valid for an embedded connection.
You can use the file aliases.conf to set up the file location so that any connecting application can supply the alias instead of the actual path. This is particularly desirable if you want the application to be portable. For example, an entry in aliases.conf like so:
MyDB = C:\data\MyData.fdb
..will enable you to use the alias for the Database property of your connection instead of hard-coding the path. If you install your embedded structure on another machine, with the database located in a different place, you only have to open aliases.conf and edit the path for the hard-coded alias.
But - whatever - take this to the right list and provide enough detail so that the experts there understand your setup.
^ heLen ^