如何使用 C++ 通过 ODBC API 删除文件 DSN
我使用 SQLWriteFileDSN 创建 ODBC 文件 DSN。现在我想做的是删除 DSN。 基于 http://msdn.microsoft.com/en-us/library/ms403313 .aspx,我尝试使用SQLConfigDataSource来做,但它总是返回0并且dsn文件没有被删除。
驱动程序: Microsoft 文本驱动程序 (*.txt; *.csv)
函数调用: SQLConfigDataSource(NULL, ODBC_REMOVE_DSN, "Microsoft 文本驱动程序 (*.txt; *.csv)", "DSN=filedsnname");
对此有什么想法吗?
I use SQLWriteFileDSN to create ODBC file DSN. Now what I want to do is to remove the DSN.
Based on http://msdn.microsoft.com/en-us/library/ms403313.aspx, I have tried to use SQLConfigDataSource to do it, but it always returns 0 and dsn file is not deleted.
driver: Microsoft Text Driver (*.txt; *.csv)
function call: SQLConfigDataSource(NULL, ODBC_REMOVE_DSN, "Microsoft Text Driver (*.txt; *.csv)", "DSN=filedsnname");
Any idea about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么需要通过 ODBC 来执行此操作?
当然,您只需要使用 C/C++/C# 提供的任何机制删除文件...
我不是程序员,所以我无法为您提供代码示例。
Why do you need to do this via ODBC?
Surely, you just need to delete the file using whatever mechanism C/C++/C# provides...
I am not a programmer so I cannot give you a code sample.