Hi, I am trying to access the MS Access database on my local machine
in C# Windows Application in Visual Studio.NET.
But it seems that it does not work. I use the Microsoft Application
Blocks to access the database.
I have tried 2 possible connection strings.
-----------------------------------------
str_1 = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" + DBFilePath;
str_2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DBFilePath;
//SqlHelper is the class in the Microsoft Application Blocks
SqlHelper.ExecuteNonQuery( str_1, CommandType.Text, SQL_str);
-----------------------------------
The error message I got is:
"Unknown connection option in connection string: driver." for str_1
and
" Unknown connection option in connection string: provider." for str_2
So I am wondering, where is the problem?
Is it because my connection string for MS Access is specified wrongly?
Or is it because I cannot use SqlHelper to access the MS Access
database? ( I have used SqlHelper class to access the MS SQL server,
and it works)
Your help will be greatly appreciated.
James