有没有什么“陷阱”?通过 Delphi COM 服务器或 .NET 中的 DLL 调用 BDE 时是否涉及?

发布于 2024-09-08 20:33:27 字数 753 浏览 1 评论 0原文

我问这个问题是我之前问题的后续: 使用 BDE 和 Delphi 访问 dBase 文件的好方法是什么?

有人建议我调用 Delphi COM 服务器而不是通过标准输入/输出传递数据,并且我完全同意这种解决方案非常有限。

基本上我需要一种从 C# 调用 BDE 的方法,而不使用 ADO/OLEDB。最初,我的要求是能够直接执行查询并返回某种 RecordSet 对象,但我也可以使用强类型接口,方法如下:

uint CreateCustomer(string fname, string lname, string addr, string email ) uint CreateContract(...) bool DeleteContract(...)

我希望不必使用 regsvr32 注册 COM 服务器,而是使用 Interop 和 DllImport 直接调用 DLL 方法。使用后一种方法,是否有关于资源清理和“BDE 会话”等方面的特殊考虑。

另外,处理异常并确保在发生异常时释放任何 BDE(或其他)资源的正确方法是什么?

我有很多问题,但我不太确定如何以清晰的方式表达它们:)

编辑:我完全意识到 BDE 已“死亡”,但我无法控制第三个- 仍在使用 BDE 的第三方软件。

I'm asking this as a follow-up to my previous question: What is a good way of accessing dBase files using BDE and Delphi?

It was suggested that I called upon a Delphi COM server instead of passing data though standard input/output, and I totally agree that such a solution is very limited.

Basically I need a way to call BDE from C#, without using ADO/OLEDB. Origianlly my requirement was having the ability to execute queries directly and having some sort of RecordSet object returned, but I'm also okay with a strongly typed interface with method such as:

uint CreateCustomer(string fname, string lname, string addr, string email)
uint CreateContract(...)
bool DeleteContract(...)

I would prefer not having to register a COM server with regsvr32, but rather use Interop and DllImport to call DLL methods directly. Using the latter approach, are there any special considerations with regards to resource cleanup and "BDE Sessions" and what not.

Also, what would be the proper way to handle exceptions and ensure any BDE (or other) resources are freed if exceptions occur?

I have a lot of questions, and I'm not really sure how to present them in a clear way :)

EDIT: I'm fully aware that BDE is 'dead', but I have no control whatsoever over the third-party software that's still using BDE.

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

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

发布评论

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

评论(1

你又不是我 2024-09-15 20:33:27

我错过了你原来的 BDE 问题,所以我提出了 新答案也在那里。

基本上:跳过 BDE,并尝试 Advantage 数据库服务器

——杰罗恩

I missed your original BDE question, so I put up a fresh answer there as well.

Basically: skip the BDE, and try Advantage Database Server:

--jeroen

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