问题描述
我有一个运行在远程Windows XP PC上的Firebird 2.0数据库.
使用ADO.net连接提供程序,我可以如下配置连接:
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()
尝试打开连接会引发 FbException
,并显示消息不可用的数据库".
Attempting to open the connection raises an FbException
, with the message "unavailable database".
下载ODBC驱动程序并尝试使用这些设置进行连接会产生相同的错误消息.
Downloading the ODBC drivers and attempting to connect with those settings produces the same error message.
我已将数据库文件复制到开发环境中,并验证可以使用以下设置连接到 x.Database ="c:\ testdb \ REMOTE_SVR.FDB"
(在本地安装Firebird 2.0服务器).
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).
我已经确认Firebird 2.0服务器正在远程PC上运行.数据库所在的文件共享不需要任何登录名或权限.
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.
推荐答案
Firebird默认情况下不会打开位于网络共享上的数据库文件.该文件必须在服务器的物理磁盘上.这样做是为了防止数据库因文件的错误或不正确的锁定而损坏(例如,当被来自不同计算机的多个Firebird服务器进程访问时).
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).
因此,您需要将数据库移动到托管Firebird服务器进程的计算机的真实驱动器之一.
So you need to move the database to one of the real drives of the machine that hosts the Firebird server process.
这篇关于如何解决Firebird和“不可用的数据库"远程数据库上的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!