1

我制作了一个在网络环境中访问 firebird 数据库的程序。

我通常在网络的两个不同点通过网络访问数据库。

但是,如果我同时打开这两个程序,则会在第二个程序上引发此异常,该程序试图连接到 DB:

“您的用户名和密码未定义”

如何同时使用两个连接访问 firebird 数据库?

4

4 回答 4

2

这可能是由于使用了 firebird 的嵌入式版本,它只允许 1 个连接。查看您安装的文件名。

如果这是问题,请卸载它并安装经典或超级服务器版本

于 2011-07-08T09:36:02.957 回答
0

大多数数据库连接组件应该允许您在数据库路径之前添加一个 ip 地址或主机名,例如

MyConnection.Database := '127.0.0.1:C:\Databases\testdb.fdb';

显然,请确保您的两个程序都指向相同的 IP 地址或主机名,并确保它们使用的登录凭据是在该 firebird 服务器上定义的。

默认情况下,所有 firebird 服务器安装(嵌入式除外)都可以处理多个连接(即使使用同一个用户),您不必担心这一点。只需确保客户端程序使用的输入(即 db 网络路径和 firebird 服务器登录凭据)适用于它们尝试连接的服务器。您可以只使用 SYSDBA,直到您控制连接,然后开始考虑为您的客户端应用程序创建一个唯一的登录名。

于 2011-07-03T11:11:37.533 回答
0

TIBDatabase组件中,您必须使用以下内容填充Params属性:

user_name=sysdba 
password=masterkey

局域网中每台计算机上的 Firebird 安装都必须设置为这个默认参数。有问题的计算机必须具有不同的访问凭据。

您必须卸载 Firebird,然后他们使用服务和超级服务器选项重新安装最新版本,并标记“使用 gdi32.dll 进行复古...”

告诉我这是否适合你。

于 2012-07-27T04:58:50.993 回答
0

MAke sure that the Firebird database is hosted on a computer that is running the Firebird server.

ie Install Firebird Server on the computer that has the database.

Then from your client PCs where your app is installed make sure that you are accessing the database by connecting to the Firebird server. This means that whichever component your Delphi app is using to connect to the database needs to have the 'server' property set to the hostname of the database server machine.

Once this is done your apps will be making requests to the Firebird database server which knows how to handle the connections and process the SQL requests and return results.

于 2011-07-03T06:29:59.283 回答