Good morning,
I am currently trying to use an ODBC connection to connect to my database.
private OdbcConnection connect = new OdbcConnection("DSN = My Data Source; DATABASE = MyDB;");
// From research I discovered that some people use DB instead of DATABASE.
After Googling the error, I found out that as the name specifies this occurs when there is no such name in the ODBC DSN connections. The problem could also arise when the application is looking for the 32-bit version, however, only the 64-bit version is setup. I went to System32 and SysWOW64, and made sure to setup a System DSN ODBC connection for each ODBCAD32 executable.
The error:

Any suggestions? Could it be that this is happening due to the fact that my DSN has spaces involved in the name? The DSN is properly setup due to the fact that it is being used by other software.
Thanks, Isaac
OK so even though I set the user within the ODBC connection, I had to set the User ID and Password as such:
private OdbcConnection connect = new OdbcConnection("DSN=My Data Source; UID=User; PWD=Password;");
Also another issue was that I usually apply spaces surrounding the equal sign. This resulted in a connection error. Therefore do NOT do as below:
private OdbcConnection connect = new OdbcConnection("DSN = My Data Source; UID = User; PWD = Password;");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With