Visual Studio 2010 and an *.accdb - Read only database


  • I am using Visual Studio 2010.  I am attempting to deploy an application that uses an *.accdb file.  I understand that I can not install the accdb file into the c:\program files directory because that causes the accdb file to be read only.  I also understand I need to either install the accdb file to the C:\Program Data or C:\Users\public directories.  The question is how do I get the accdb file to install into a proper directory and also what does my app.config file need to show as far as a path to connect to it. 

    I was able to get the accdb file to install into the C:\program Data directory and was able to get the connection to work, but the accdb file was still read only. 

    I tried using the Special Folder - 'Commond Files Folder' but it didnt seem to install to any location.  Plus the connection string did not work.  i attempted to use the %public%\..........path. 

    So I would like to know what folder should i add and then what should the connection string be to get to that folder.  and...will the same solution work on xp, vista, and 7 or do i need to create seperate install files?

    any help is greatly appreciated.

    • Moved by Bob_BaoModerator Monday, January 31, 2011 7:42 AM (From:Application Compatibility for Windows Development)
    Saturday, January 29, 2011 4:14 PM

All replies

  • Hi Voyagr12,

    According to the document: .accdb has the most options to customize. So could you please ensure the property settings of the database file, do you set the "Readonly" for it. I do not think the property is related with target folder. However, you could try to deploy it by administrator account. Or try to create a Setup project of Visual Studio to deploy it. So in default, we could deploy the DB file in the same location with our application. This issue may be caused by other settings from Access file, I will help you to move it Access forum, it is probably your best resource on this.


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 31, 2011 7:41 AM
  • From what I have read, it has nothing to do with the accdb file itself.  I have created a Setup project in Visual Studio.  That is how I am creating the msi file.  This msi file is then what I use for installation.  I have attempted on Vista and XP.   It works on XP by default because if I install the accdb file to Program Files or Program Data folders it is not read only.  Only in Vista does it appear to have an issue with making the accdb file read only. 

    I feel this thread has nothing to do with Access, but more to do with the Setup Project created in Visual Studio.  I need to know what directory the accdb file should be installed into in the 'File System', and then what should be my connection path in the app.config file. 

    Ideally it would be nice to have it install into a public directory, but at this point, it doesnt really make a big difference for me.



    Monday, January 31, 2011 1:05 PM
  • Does anyone have any ideas?
    Wednesday, February 02, 2011 2:42 AM
  • I am having the same issue as you, I do not believe it is the Access file or an Access property, but an issue with the client OS (Vista or Win7) and permissions on the special folders.

    If I find anything out I will let you know.

    Monday, April 04, 2011 5:17 PM