none
Operation must use an updateable query access RRS feed

  • Question

  •     Hi

       I appollogize if it's the wrong forum category

       I wrote a windows form app using a db access when i run it i get no error. 

       I add  a project setup and run it and then launch the application i get this error Operation must use an updateable query access

     I understand  because the setup copies  into the target folder the db and this db  is read only. 
    so how can i use a db in a setup to be not read only ?
    thanks 


    • Edited by Shay_w Thursday, November 28, 2019 8:23 PM
    Thursday, November 28, 2019 8:22 PM

Answers

  •                                                                                                                                                    

                                                                                                                                                 Hi 

                                                                                                                                   That's just it

      The installers installs the files in folder c\programfiles(x86) otherwise the user can change and at   this location db is set to readonly                                                                                                                         

                      the mdb file must be located in the application folder here the line code       

             
     path = Application.StartupPath & "\db1.mdb"
            Dim base As String = "provider=microsoft.jet.oledb.4.0;data source=" & path
         "I found the solution is to put the data base  in folder   "C:\Users\user\AppData\Roaming                                                                                                            
    Friday, November 29, 2019 9:49 AM

All replies

  • I don't know of any setup that copies a read-only database unless the person creating the setup indicated it should be read-only.

    Here are docs for removing and setting file attributes

    https://docs.microsoft.com/en-us/dotnet/api/system.io.file.setattributes?view=netframework-4.8 


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, November 28, 2019 11:19 PM
    Moderator
  • As addition to Karen's answer. Sometimes installer might copy files to folder where files are set to read only because the location.

    Also setup project usually have different properties for files included. So you should check properties of db file and see if it is set as read only.

    Friday, November 29, 2019 6:45 AM
  •                                                                                                                                                    

                                                                                                                                                 Hi 

                                                                                                                                   That's just it

      The installers installs the files in folder c\programfiles(x86) otherwise the user can change and at   this location db is set to readonly                                                                                                                         

                      the mdb file must be located in the application folder here the line code       

             
     path = Application.StartupPath & "\db1.mdb"
            Dim base As String = "provider=microsoft.jet.oledb.4.0;data source=" & path
         "I found the solution is to put the data base  in folder   "C:\Users\user\AppData\Roaming                                                                                                            
    Friday, November 29, 2019 9:49 AM
  • Hi,

    It seems that you have got your solution, we appreciated you shared us your solution, we also hope you can mark it as an answer by using Mark as answer link.

    By marking a post as Answered or Helpful, you help others find the answer faster.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, December 3, 2019 5:35 AM
    Moderator