Results 1 to 9 of 9
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    I had made corrections to an Access 2003 program. I copied it to a notebook cmputer with Access 2003 on it. Mine has Outlook 2007 whcih of course uses Microsoft Outlok 12 Object Library.
    The program on the notebook computer gets an error when hitting ok in references after turning off the tick for Outlok 12.
    The notbook computer has Office 2003 SP3 with no hotfix yet.
    I have asked my friend to instal the hotfix and see if that fixes the problem.

    Any ideas?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='patt' post='787167' date='02-Aug-2009 16:25']I had made corrections to an Access 2003 program. I copied it to a notebook cmputer with Access 2003 on it. Mine has Outlook 2007 whcih of course uses Microsoft Outlok 12 Object Library.
    The program on the notebook computer gets an error when hitting ok in references after turning off the tick for Outlok 12.
    The notbook computer has Office 2003 SP3 with no hotfix yet.
    I have asked my friend to instal the hotfix and see if that fixes the problem.

    Any ideas?[/quote]
    I have found an explanation from Microsoft (i almost fell over too). It says to take the code out of break mode and change the references after that.
    The code isn't in break mode though, hmmmm.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Make sure that you open the database with the Shift key held down, to disable all startup options.
    Then go into the Visual Basic Editor without having opened a form or report, and try to fix the references.

    In general, it is to be recommended to develop databases (and other software) in the oldest version that you want to support.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='HansV' post='787182' date='02-Aug-2009 20:42']Make sure that you open the database with the Shift key held down, to disable all startup options.
    Then go into the Visual Basic Editor without having opened a form or report, and try to fix the references.

    In general, it is to be recommended to develop databases (and other software) in the oldest version that you want to support.[/quote]
    I have done all that, that is what is so intriguing.

    He may have a stuffed version of Office 2003 SP 3 (no hotfix yet) on his notebook.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You might try decompiling the database (i.e. open it with the /decompile switch), then try to clear/set references.

    If you want to avoid future problems with references, you might switch from early binding (which requires setting the correct references) to late binding (which doesn't need references).

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='HansV' post='787236' date='03-Aug-2009 06:54']You might try decompiling the database (i.e. open it with the /decompile switch), then try to clear/set references.

    If you want to avoid future problems with references, you might switch from early binding (which requires setting the correct references) to late binding (which doesn't need references).[/quote]
    I have even tried decompiling too.

    What is involved in "late binding"?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='patt' post='787246' date='03-Aug-2009 00:37']What is involved in "late binding"?[/quote]
    Late binding to an object library means:
    - There is no reference to the object library.
    - Objects are created using CreateObject or GetObject, not using the New keyword.
    - Object variables are declared as Variant (explicitly or implicitly by omitting the type) or as Object.
    - All symbolic constants from the object library have been replaced with their value.

    If you use a reference to the object library, it's called "early binding".

    Advantages of early binding:
    - You can use IntelliSense while writing the code.
    - If you run Debug | Compile <project>, you'll get warned if you used non-existing methods etc.
    - Code can be pre-compiled and thus run faster.

    Disadvantages of early binding:
    - Code may fail on other systems if the library is not installed in the same location.

    And conversely

    Advantages of late binding:
    - Will work on other systems if the library is installed in a different location.

    Disadvantages of late binding:
    - No IntelliSense while writing the code.
    - No syntax check.
    - Code may run slower.

    If I need to use late binding, I usually write and test the code using early binding, i.e. with a reference to the object library.
    When the code has been tested to my satisfaction, I convert it to late binding:
    - Look up the values of symbolic constants in the Object Browser.
    - Use Edit/Replace to replace the constants with their values throughout the project.
    - Change all declarations of a specific type from the object library to As Object.
    - Don't use the New keyword, create the object with CreateObject or GetObject instead.
    - Finally, clear the reference to the object library.
    - Select Debug | Compile <project> to make sure that the code is still OK.

    This way, you still benefit from IntelliSense and syntax checking while writing the code.

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='HansV' post='787247' date='03-Aug-2009 10:52']Late binding to an object library means:
    - There is no reference to the object library.
    - Objects are created using CreateObject or GetObject, not using the New keyword.
    - Object variables are declared as Variant (explicitly or implicitly by omitting the type) or as Object.
    - All symbolic constants from the object library have been replaced with their value.

    If you use a reference to the object library, it's called "early binding".

    Advantages of early binding:
    - You can use IntelliSense while writing the code.
    - If you run Debug | Compile <project>, you'll get warned if you used non-existing methods etc.
    - Code can be pre-compiled and thus run faster.

    Disadvantages of early binding:
    - Code may fail on other systems if the library is not installed in the same location.

    And conversely

    Advantages of late binding:
    - Will work on other systems if the library is installed in a different location.

    Disadvantages of late binding:
    - No IntelliSense while writing the code.
    - No syntax check.
    - Code may run slower.

    If I need to use late binding, I usually write and test the code using early binding, i.e. with a reference to the object library.
    When the code has been tested to my satisfaction, I convert it to late binding:
    - Look up the values of symbolic constants in the Object Browser.
    - Use Edit/Replace to replace the constants with their values throughout the project.
    - Change all declarations of a specific type from the object library to As Object.
    - Don't use the New keyword, create the object with CreateObject or GetObject instead.
    - Finally, clear the reference to the object library.
    - Select Debug | Compile <project> to make sure that the code is still OK.

    This way, you still benefit from IntelliSense and syntax checking while writing the code.[/quote]
    Thank you Hans for the explanation, you are certainly a wealth of knowledge, i appreciate your input.

    I think that project is way beyond late binding though.

  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='HansV' post='787236' date='03-Aug-2009 06:54']You might try decompiling the database (i.e. open it with the /decompile switch), then try to clear/set references.

    If you want to avoid future problems with references, you might switch from early binding (which requires setting the correct references) to late binding (which doesn't need references).[/quote]
    It turned out to be a corrupt database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •