I have a new application uploaded to Windows server that is attempting to read MS Access DB and I get the error:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Tracing shows that I get the error at the point where I try to open the connection.
This is my first WEB APPLICATION in Visual Studio 2019. I have other VS WEBSITE applications that also read DBs in the same way. Those work simply by referencing ADODB.DLL and then placing the ADODB.DLL file in the BIN folder of the published website.
I verified that the DB is good with all the proper permissions and connection strings by opening/reading the same database in my one of my website applications. No problem. Both my WEBSITE apps and my WEB APPLICATION read the database with the same exact class module attached to the project.
So the only difference appears to be that one is a WEB APPLICATION (with compiled code-behind) and the other is a WEBSITE (with uncompiled code behind). But again, the database is opened in an identical class modules attached to the projects.
I noticed that the PUBLISH feature in VS seems to ignore the ADODB.DLL file in my bin folder (ie does not publish it to the server even though it is referenced). But even if I manually upload the DLL to the BIN folder of the server, I get the error.
My server support says that I need to add a System.DSN to access the database. I tried that (may have done it incorrectly), but it didn’t work. And seems wrong given that I read databases the same way in my website apps.
So it "feels like" the published web app DLLs cannot find the ADODB.DLL when it is accessed in a web application. Should I be putting it in a different location or publishing differently somehow?
Source: Windows Questions