Start Password Protected Ms Access MDB/MDE in Runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gngui
    New Member
    • Apr 2007
    • 10

    Start Password Protected Ms Access MDB/MDE in Runtime

    Hi,
    Please Please Please anyone out there, if you have a solution, i will highly appreciate as i have searched the internet for 5 days now with no hope.
    1st, the versions i am using are Ms Access 2003 & Visual Studio 2005.
    Problem
    I am using a database password on my MDB (using "set database password"). This is just for my basic security to stop basic users from importing my queries (basic user, i know any advanced guy can hack in, but now that becomes a copyright issue). With this, i would like to use VB (.exe) to open the database without asking the user for the password. I have set up the Db so that the user does not have any control to reset the Db password, e.g. disabling shift overide, etc.
    So far i have found two sets of code that still do not do what i want;
    1.
    Dim oAccess As Microsoft.Offic e.Interop.Acces s.Application
    oAccess = New Microsoft.Offic e.Interop.Acces s.Application
    oAccess.OpenCur rentDatabase(fi lepath:=Db_path , bstrPassword:=" password")

    This code works OK but opens the Db with the full version of access, not in the runtime version.....

    2.
    Shell(PathName: ="""" & ms_access_path & """" & " " & """" & dbpath & """" & " /runtime")

    This code opens the Ms Access DB in runtime but i cannot automatically enter the Db password......

    What i need basically is to open my password protected MDB/MDE in /runtime without prompting for the password (password defined in the code of my .exe file)
    Any assistance in solving this problem is much appreciated.
  • slapshock
    New Member
    • Oct 2006
    • 57

    #2
    Originally posted by gngui
    Hi,
    Please Please Please anyone out there, if you have a solution, i will highly appreciate as i have searched the internet for 5 days now with no hope.
    1st, the versions i am using are Ms Access 2003 & Visual Studio 2005.
    Problem
    I am using a database password on my MDB (using "set database password"). This is just for my basic security to stop basic users from importing my queries (basic user, i know any advanced guy can hack in, but now that becomes a copyright issue). With this, i would like to use VB (.exe) to open the database without asking the user for the password. I have set up the Db so that the user does not have any control to reset the Db password, e.g. disabling shift overide, etc.
    So far i have found two sets of code that still do not do what i want;
    1.
    Dim oAccess As Microsoft.Offic e.Interop.Acces s.Application
    oAccess = New Microsoft.Offic e.Interop.Acces s.Application
    oAccess.OpenCur rentDatabase(fi lepath:=Db_path , bstrPassword:=" password")

    This code works OK but opens the Db with the full version of access, not in the runtime version.....

    2.
    Shell(PathName: ="""" & ms_access_path & """" & " " & """" & dbpath & """" & " /runtime")

    This code opens the Ms Access DB in runtime but i cannot automatically enter the Db password......

    What i need basically is to open my password protected MDB/MDE in /runtime without prompting for the password (password defined in the code of my .exe file)
    Any assistance in solving this problem is much appreciated.

    Try this code:


    Dim cn As New ADODB.Connectio n
    With cn
    cn.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=app.path & \yourdbasehere; jet oledb:database password=yourpa sswordhere"
    End With

    Comment

    • jrtox
      New Member
      • Sep 2007
      • 89

      #3
      Originally posted by slapshock
      Try this code:


      Dim cn As New ADODB.Connectio n
      With cn
      cn.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=app.path & \yourdbasehere; jet oledb:database password=yourpa sswordhere"
      End With

      Hello,
      Its my Problem also and I Got it Now.
      Tnx

      Regards
      ervin

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by gngui
        Hi,
        Please Please Please anyone out there, if you have a solution, i will highly.
        Can you explain why you want open the DB File Exclusively?

        Comment

        • jrtox
          New Member
          • Sep 2007
          • 89

          #5
          Just wanna share my coding maybe it can help you out:
          I do create i DB and Open it as Exclusively for me to put a SecurityPasswor d and my password is "0".

          Now my coding in VB6 are as follow:

          Function Connect()

          Dim ESQL As String

          Set CONN = New ADODB.Connectio n
          Set CONN = Nothing

          MSDatabase = App.Path & ("\DBase\TimeSh eet.mdb")
          CONN.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source= " & MSDatabase & ";jet oledb:database password=0"

          End Function


          Thank you Slapshock

          Regards
          Ervin

          Comment

          • gngui
            New Member
            • Apr 2007
            • 10

            #6
            Hi Guys,
            Thanks for your assistance but this is not what i want.
            I need to open the MDB application, not connect to it. The ADO code you provided just connects to the MDB.
            Please go through my original post. My problem is opening the MDB database.

            Comment

            • gngui
              New Member
              • Apr 2007
              • 10

              #7
              Any one out thea who can help?????

              Comment

              • gngui
                New Member
                • Apr 2007
                • 10

                #8
                Anyone? HEEEEELP. Awaiting any response.

                Comment

                • avalonit
                  New Member
                  • Jun 2013
                  • 2

                  #9
                  Solved! Open the mdb exclusively using the /excl parameter in the shell command. Make sure shift-open is disabled in the mbd. Now dynamically link the backend only on startup of the frontend mdb. Now no one can get the the backend cause its got a plain old database pw on it, and its dynamically linked, and you can't shift-reenable it cause its exclusely opened. Please correct me if I'm wrong.

                  Comment

                  Working...