How to resolve Firebird “unavailable database” error on a remote database?

点点圈 提交于 2019-12-07 05:49:47

问题


I have a Firebird 2.0 database running on a remote Windows XP PC.
Using the ADO.net connection provider, I configure the connection as follows:

Dim x As New FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder
x.Database = "[hostname]:FileShare:/db/REMOTE_SVR.FDB"
x.UserID = "SYSDBA"
x.Password = "masterkey"

Dim y As New FirebirdSql.Data.FirebirdClient.FbConnection(x.ConnectionString)
y.Open()

Attempting to open the connection raises an FbException, with the message "unavailable database".

Downloading the ODBC drivers and attempting to connect with those settings produces the same error message.

I have copied the database file to my development environment and verified that I can connect to x.Database = "c:\testdb\REMOTE_SVR.FDB" with these settings (with a local install of Firebird 2.0 Server).

I have confirmed that the Firebird 2.0 Server is running on the remote PC. The fileshare in which the DB is located doesn't require any login or permissions.

I'm probably doing something dumb, but I'm out of ideas.


回答1:


Firebird will - by default - not open database files that are located on a network share. The file must be on a physical disk of the server. This is done to protect the database against corruption from incorrect or insufficient locking of the file (eg when accessed by multiple Firebird server processes from different machines).

So you need to move the database to one of the real drives of the machine that hosts the Firebird server process.



来源:https://stackoverflow.com/questions/38916008/how-to-resolve-firebird-unavailable-database-error-on-a-remote-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!