1

I got a following error "Access to the database file is not allowed. [ File name = C:\Program Files\Default Company Name\somedbfile.sdf ]" while trying to log on after installing it in windows 7. It worked if i manually remove read only property of sdf file but it is not a good for client. Could we do this pragmatically. Any help would be appreciable.

Thanks in advance. Tarun

Tarun Giri
  • 11
  • 2
  • How you are accessing sfd file. If you are using SQL Compact Edition, just try to re-install. Description given above is not clear for your exact issue. – Gaurav Arora Jun 27 '14 at 20:25
  • The issue is with the particular window application release file which i given to client, when client installed the application and try to access it by just logged on then he got the error given above. I analyzed and found that for this release only the database(.sdf) file is being set read only after install. – Tarun Giri Jun 30 '14 at 17:03
  • How you provided windows app to your client, is it a setup file or just binaries? If this is a setup then you need to do some stuff to make it workable. There are lot of SO threads related to this. Let me know if you need more help. – Gaurav Arora Jul 02 '14 at 17:20
  • Yes, it is setup file. – Tarun Giri Jul 05 '14 at 06:51
  • What is SO threads? I searched for the same but could not find any fruitful link or document.Could you please provide me some link related to this – Tarun Giri Jul 05 '14 at 06:56
  • Actually, our application build in 32 bit system(x86) and it is working fine on 32 bit OS but if it installed on 64 bit system then the permission issue occurred(the installed files and folders is not accessible due to in-sufficient user permission). – Tarun Giri Jul 05 '14 at 07:01
  • One more thing the OS compatibility issue occurred only if we set COM Library reference dll's Isolated property to True(it is automatically registered the COM dll to the client machine). – Tarun Giri Jul 05 '14 at 07:54
  • One more thing the OS compatibility issue occurred only if we set COM Library reference dll's Isolated property to True(it is automatically registered the COM dll to the client machine irrespective of the different different COM dll version client is using.). Here , the conflict is occurred if we do set Isolated property to false then application run on both 32/64 bit OS but the third party application is not accessible and throw exception COM library with this version is not registered if dll version varies machine to machine. – Tarun Giri Jul 05 '14 at 08:04
  • Tarun - I went through all of your comments and now I can suggest: create a batch file which will deploy your com component on client machine and this should be supplied as a part of your Setup. – Gaurav Arora Jul 15 '14 at 11:29
  • I did it as per your suggestion and it is working fine in 32 bit machine but failed to register the COM dll in 64 bit machine. I also tried to registered our dll into 64 bit machine manually using command prompt, it is also not registering it. – Tarun Giri Jul 16 '14 at 11:06
  • Tarun - can you post your batch command in comment here. Check SO link: http://stackoverflow.com/questions/4897685/how-do-i-register-a-dll-on-windows-7-64-bit also check msdn link: http://social.msdn.microsoft.com/Forums/en-US/813f13ec-0180-496a-8af0-b57dfd4e4de4/could-not-register-a-32-bit-dll-in-windows-7-64-bit?forum=netfx64bit for further references – Gaurav Arora Jul 17 '14 at 14:23

1 Answers1

1

the folders 'Program Files' or 'Program Files (x86)' are read only for the common users. if database file is in this folder , - change permission of this file to full control . or - change path of database file

Keramat
  • 63
  • 3