Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel oledb connection to Ms-Access database lock access db

Tags:

excel

I have an excel spreadsheet that connects to MS-Access 2003 database using ole db connection. When I refresh the data in spreadsheet and open my ms-access database it says database is read-only. If I close the spreadsheet and then open MS-Access DB then it opens in Write mode. The following is the connection string used in Excel spreadsheet.

Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;
Data Source=D:\Dev\Reports.mdb;Mode=Share Deny Write;Extended Properties="";
Jet OLEDB:System database="";Jet OLEDB:Registry Path="";
Jet OLEDB:Database Password="";
Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=0;
Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;
Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;
Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;
Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
like image 796
Kannan Karmegam Avatar asked Aug 17 '10 07:08

Kannan Karmegam


2 Answers

Change "Mode=Share Deny Write" to "Mode=Read"

in connection string

like image 195
Kannan Karmegam Avatar answered Nov 15 '22 08:11

Kannan Karmegam


Have you checked that the Excel user has full permissions on the folder containing the Access file?

like image 39
Fionnuala Avatar answered Nov 15 '22 08:11

Fionnuala