locked
How to use encrypted or compiled/embedded Access DB in VB programs RRS feed

  • Question

  • Hi all!

    I'm an absolute beginner with VB programming and I'm trying to write a Windows Application with VB 2008 that needs to use some simple Access DB (via OleDB connections). I did it and it works fine, but what I want to do is to have the databases not accessible to the users... I want the databases to travel togheter with the application, or to be embedded, encapsulated in it, but don't want that the user can open and read the .mdb files... 

    I suppose that the way to do what I need is to set the "Build Action" property of the mdb files in the VB project to "Compile" or to "Embedded Resources" (currently it is set to "Content"), but when I try to do it, the application cannot finde the mdb file and cannot connect the database... obviously...

    I suppose I need to modify the connection strings, but I don't know how to do it!

    Could someone help me?

    Thanks!!!

     


    Thursday, May 12, 2011 11:24 AM

Answers

  • You can't really embed an Access database within the app. It has to be accessible and available through the file system, so at some point it needs to be saved there.

    If you don't want the users to be able to open the database outside of the app then use a database password and store it encrypted, either within your app, configuration file or the Registry. 


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Proposed as answer by Mike Feng Monday, May 16, 2011 6:57 AM
    • Marked as answer by Mike Feng Saturday, May 21, 2011 10:30 AM
    Thursday, May 12, 2011 1:22 PM

All replies

  • You can't really embed an Access database within the app. It has to be accessible and available through the file system, so at some point it needs to be saved there.

    If you don't want the users to be able to open the database outside of the app then use a database password and store it encrypted, either within your app, configuration file or the Registry. 


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Proposed as answer by Mike Feng Monday, May 16, 2011 6:57 AM
    • Marked as answer by Mike Feng Saturday, May 21, 2011 10:30 AM
    Thursday, May 12, 2011 1:22 PM
  • Hi Sent,

     

    Thanks for posting in the MSDN Forum.

     

    Any update? I have marked Paul's reply as answer, if you think it provides no help, please unmark it, and  feel free to let me know your any concerns.

     

    Thank you for your understanding and support.

     

    Best Regards,


    Mike Feng [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.

    Saturday, May 21, 2011 10:29 AM