How to remove file DSN by ODBC API using C++
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?
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.
精彩评论