ODBC 挂钩/垫片

发布于 2024-09-25 00:29:39 字数 286 浏览 1 评论 0原文

我有一个旧应用程序需要它才能正常运行。现在它使用了一些无效的 SQL。它使用 ODBC 连接到数据库。我只想对 ODBC 进行填充,这样我就可以监视无效的 SQL 并用一些有效的命令替换它。

有什么想法吗?

如果 MySQL 代理可以通过 ODBC 运行,那么它就符合要求。

http://dev.mysql.com/downloads/mysql-proxy/

I have an old app that I need to get functioning. Right now it uses some invalid SQL. It connects to the db using ODBC. I would just like to shim the ODBC so I could watch for the invalid SQL and replace it with some valid commands.

Any ideas?

MySQL proxy would fit the bill if it would fly over ODBC.

http://dev.mysql.com/downloads/mysql-proxy/

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

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

发布评论

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

评论(1

神魇的王 2024-10-02 00:29:39

最简单的方法是自己编写一个填充程序,然后让旧版应用程序加载您的填充程序,然后将除 SQLPrepare 和 SQLExecDirect 之外的所有 ODBC 函数调用代理到原始 ODBC 驱动程序。然后,您可以更改通过这两个函数传入的任何相关 SQL 查询。所有其他函数都不变地传递参数。

您需要将垫片作为 ODBC 驱动程序“安装”在注册表中(如果在 Windows 上),位于 HKLM\SOFTWARE\ODBC\ODBCINST.INI(对于驱动程序)和 ODBC.INI(对于 DSN)下。然后,您可以将旧应用程序指向垫片,这将动态加载原始驱动程序。

Easiest way is to write a shim yourself, and have the legacy app load your shim which then proxies all ODBC function calls except SQLPrepare and SQLExecDirect to the original ODBC driver. You can then alter any relevant SQL queries passed in through these two functions. All other functions pass arguments through unchanged.

You'll need to "install" your shim as an ODBC driver in the registry (if on Windows) under HKLM\SOFTWARE\ODBC\ODBCINST.INI (for the driver) and ODBC.INI (for the DSN). You can then point your old app to your shim, which will load the original driver dynamically.

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