Hi all
I have a x32 bit application on a windows10 x64 machine.
The application was working fine untill I change the connection string from OLEDB to ODBC with a DSN.
Since my application x32 bit I created a x32 bit DSN to an ACCESS db wich also is a x32 (Office 365).
When I run the application I receive the error, cannot open database (Unknown) it may not be a database that your application recognizes.
I can oppen the Database from Access fine no pronblem, I also recreated the 32bit DSN dultiple times and the problem still precistes.

Recommended Answers

All 5 Replies

Sorry missed the code

        Dim dbcon As OdbcConnection
        Dim cmd As OdbcCommand
        Dim dr As OdbcDataReader
        Dim SelectString As String
        dt = New DataTable
        cmd = New OdbcCommand
        SelectString = "Select * FROM Fees"
        Try
            dbcon = New OdbcConnection("DSN=AUS")
            dbcon.Open()
            With cmd
                .CommandType = CommandType.Text
                .CommandText = SelectString
                .Connection = dbcon
                dr = .ExecuteReader
                dt.Load(dr)
            End With

My advice is to go DSN-less to see what this connection requires. There are so many prior discussions about DSN connection failures that I can't guess which is the cause here. Maybe no password?

One other thing, if you really want ODBC then I believe you MUST use the ODBC application found at C:\Windows\System32\odbcad32.exe in older versions of Windows 10 or under Control Panel ODBC Data Sources (32 bit) These are the 32 bit ODBC application on a 64bit Windows 10 machine. The ODBC Application you find as default is typlically 64 bit which won't work with 32 bit apps and of course you can't have two with the same name so I would delete the 64 bit ODBC and create with 32 bit version.

Thank you all for your assistance.
I solved it by installing the 2016 redistribute.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.