open accdr file protected with database password

Anonymous
2013-08-21T12:29:22+00:00

Hi dear

how can I open accdr file protected with database password  by another one accdb file (with VBA code) ?

regard

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

47 answers

Sort by: Oldest
  1. Anonymous
    2014-01-27T23:32:59+00:00
    1. You don't need to check that, it should change automatically, by itself, when opening in the different versions.  There is no need for you to select it.  You should not be selecting anything there.
    2. My MISTAKE, that should have been Option Compare Database.  So it should be...

    Option Compare Database

    Option Explicit

    For an explanation...

    Option Compare Database tells your code how to compare strings, numbers, etc.  Option Explicit tells your code that each variable needs to be defined for it to be used.  This is very important... make sure they're at the top of each module (commented code (in green, something like:  'commented code) can go before these, or empty spaces, but nothing else.

    1. If you are getting errors using Option Explixit it means you have undeclared variables.  Using your example...

    For i=o to Ubound( AAA)...

    You need to declare i and maybe o, if that is the letter o and not a number (zero)., ie:

    Dim i As Long  'If numeric

    OR

    Dim i As Integer

    OR

    Dim i As String  'If text

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-01-28T00:34:04+00:00

    thanks a lot

    1-sometimes we use like this  : Dim  UBound  only (without as ..... )

    what's the meaning of it ?  so UBound  is defined text or integer or ....? for which variable do we use like that? ( can we use of it for text or number or other variable type ? by other means , can we use of it instead of i as integer when i is a number ?

    2- even I don't define some variable like i as integer or other , access full will run my program correctly, is there any problem or 100% necessary to modify codes in this situation ? or not require to modify the codes? if you tell me yes it's neccessory to modify even it works correctly , please explain the reason .

    3-is necessary OLE Automation to check even I don't use of any OLE Object ? why? what's that?

    regard

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-01-28T02:01:04+00:00
    1. Read this to understand declaring variables...

    http://office.microsoft.com/en-us/access-help/HV080755458.aspx

    1. Sure your program will run correctly if the variables are not properly declared.  BUT, it makes debugging errors a nightmare.  So, if not following a standard practice is okay with you then don't bother. 

    And, in thinking about it...  If your code doesn't compile then converting to a Runtime can cause it to run with errors.    Now, it will Compile without variables being declared but one has to wonder if that's a false positive because you have omitted the statement that would check for errors in your code.  To put it simply, you converted your database to a Runtime, it is giving you problem... how do you really know the source of the problems because you omitted the statement that would check.  Up to you, so do as you please...

    1. OLE Automation - you can leave it unchecked.  There has been debate about how useful it is, I can't find the thread where that conversation took place.  However, it is set by default and doesn't really do any harm to leave it that way.  I'd rather leave the default to be sure any errors showing up aren't related to that.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-01-30T20:16:36+00:00

    I have a question about explicit that was at above

    1- can I use of varient for every parameters like string , integer ,etc ?

    2- some of my codes are :

    ...........

     With Me.attachFile

            cmdSaveToFile.Enabled = CBool(.AttachmentCount)

            cmdOpenFile.Enabled = cmdSaveToFile.Enabled

       ........

    when I use of explicit and compile it , it give me an error for undefinding type of cmdSaveToFile and cmdOpenFile .

    which type should I use for that ? can I define for it "variant" ? what's the best ?

    regard

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2014-02-01T22:16:57+00:00
    1. Yes, you can use Integer, String, Boolean, etc...
    2. Try...

    Me.cmdSaveToFile

    Me.cmdOpenFile

    ...as I'm assuming those are Command Buttons.  But I'm nit sure as I don't know what...

    Me.attachFile

    is.  If you decide to use Option Explicit I'm sure you're going to have quite a bit to fix/adjust.  It's your code you're going to have to fetermine the correct variable.

    Was this answer helpful?

    0 comments No comments