.NET 5 Connecting to MS Access mdb with Odbc

979 Views Asked by At

I am trying to connect my web application to an old MS Access mdb file.

I found this page: https://learn.microsoft.com/en-us/dotnet/api/system.data.odbc.odbcconnection?view=dotnet-plat-ext-6.0 But I can't figure out how to work with connection strings, I keep getting the Error:

'ERROR [08001] [Microsoft][ODBC Driver 18 for SQL Server]MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF]. ERROR [HYT00] [Microsoft][ODBC Driver 18 for SQL Server]Login timeout expired ERROR [01S00] [Microsoft][ODBC Driver 18 for SQL Server]Invalid connection string attribute ERROR [08001] [Microsoft][ODBC Driver 18 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.'

https://www.connectionstrings.com/microsoft-odbc-driver-17-for-sql-server/ Found this page, although I have the 18 driver installed it should only change the 17 -> 18.

My current Connection string looks like this

Driver={ODBC Driver 18 for SQL Server}; Server=.\SQLExpress; AttachDbFilename = D:\temp\datacollector\microfas.mdb; Trusted_Connection=yes;

But I have no idea if I am approaching it the right way. The application will eventually run locally at a customer with a known location of the .mdb file.

0

There are 0 best solutions below