通过 Delphi 连接到多个 firebird 数据库

发布于 2024-08-31 19:06:45 字数 323 浏览 1 评论 0原文

我正在将一个系统与另外 2 个应用程序集成,其中一个使用 Firebird 数据库,另一个使用 BIS(使用 ADO)。我的delphi应用程序使用Firebird。我需要从数据库中读取数据,将其插入 BIS 数据库和其他应用程序 firebird 数据库中。我为每个创建了单独的数据模块。将数据发送到 ADO 工作正常,但是当写入另一个 Firebird DB(我的数据库仍然打开)时,我收到奇怪的错误。我已经设法将问题隔离到第二个火鸟数据库。小数据写入似乎没问题。

数据结构完全不同,因此无法使用同步工具。

有没有办法通过使用多线程或每个 Firebird 实例使用单独的内存空间来克服这个问题?

I am integrating a system with 2 other applications, 1 using a Firebird database whilst the other BIS (using ADO). My delphi application uses Firebird. I need to read data from my database, insert it into both the BIS database and the other application firebird database. I have created seperate data modules for each. Sending data to the ADO works fine, but when writing to the other Firebird DB (my db still open) I get strange errors. I have managed to isolate the problem to the second firebird DB. Small data writes seems fine.

The data structures are completly different, so un able to use a synch tool.

is there a way to overcome this by using multi threading or seperate memory space each Firebird instance uses?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱已欠费 2024-09-07 19:06:45

我不使用 DataModules,但经常使用每个数据库的多个 TAdoConnection/TAdoQuery 来访问(读/写)多个数据库。

  1. 为每个数据库创建一个 TAdoConnection。我从未访问过 Firebird,但据我所知,它就像 Interbase;所以您应该能够使用 TAdoConnection 访问它。
  2. 为每个数据库创建相应的 TAdoQuery 查询。
  3. 单独打开每个查询。
  4. 完成后请确保释放所有内容。

从它的声音来看,似乎您可能正在使用单个数据库连接到一个 Firebird 数据库(很可能是“您的”)。

另一个考虑因素:检查对第二个数据库的查询是否产生预期的结果和字段。

I don't use DataModules, but routinely access (both read/write) multiple databases all the time using multiple TAdoConnection/TAdoQuery for each database.

  1. For each database create a TAdoConnection. I have never accessed Firebird, but from what I can gather it is just like Interbase; so you should be able to access it with TAdoConnection.
  2. Create a corresponding TAdoQuery query for each database.
  3. Open each query separately.
  4. After you are done make sure to free everything.

From the sounds of it, seems like you might be using a single database connection to one Firebird database (most likely "Yours").

Another consideration: Check that a query to the 2nd database yields the intended results and fields.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文