R
Red Dog via .NET 247
Hi all,
I need to read data from an Access Database that has been deployed onto a CD. This obviously makes both the MDB and the containing folder read only. I've set the connection to be read-only but for some reason I get a locking issue.
The error is:
System.Data.OleDb.OleDbException: Could not lock file.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
Where the connection string is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\Northwind.mdb;User ID=Admin;Password=;Extended Properties=;Mode=Read;
Please help me! I'm hoping is just requiring the use of some special connection string property...
Andrew Weaver
www.ssw.com.au
I need to read data from an Access Database that has been deployed onto a CD. This obviously makes both the MDB and the containing folder read only. I've set the connection to be read-only but for some reason I get a locking issue.
The error is:
System.Data.OleDb.OleDbException: Could not lock file.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
Where the connection string is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\Northwind.mdb;User ID=Admin;Password=;Extended Properties=;Mode=Read;
Please help me! I'm hoping is just requiring the use of some special connection string property...
Andrew Weaver
www.ssw.com.au