• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3463
  • Last Modified:

CreateObject("Access.Application") - Object library feature not supported when compiling VBA code in Access module

I copied a .MDB application file from a Win2000 machine to a WinXP machine.  Both machines have Access 2002 loaded.  When I try to execute the .MDB file on the WinXP machine, I get an error popup that says "Compiler error: Object library feature not supported".  My code is

Dim Nacc As Access.Application    
Set Nacc = CreateObject("Access.Application") <- compiler highlights the Nacc in this line

Both Machines have Visual Basic 6.3 but the WinXP machine has Retail: 6.4.9972 and the Win2000 machine has Retail: 6.3.8863.  I've copied the 6.3.8838 vbe6.dll and vbe6ext.olb files to the WinXP machine and still get the same error.  I checked all of the references in the Access programs on  both machines and they appear to be identical.  Thanks for any help
0
cacomputerguy
Asked:
cacomputerguy
3 Solutions
 
flavoCommented:
>> Dim Nacc As Access.Application    

Considering this line works im sure your access install is fine.

Try this

Dim Nacc As Access.Application    
Set Nacc = New Access.application

Should be faster too :-)
0
 
cacomputerguyAuthor Commented:
Before I posted here, I went to the Microsoft site and saw this alternative way of setting up an Access Application interface.  I tried the New Access.Application and I get the "Microsoft Access has encountered a problem and needs to close" error.  The details are AppName: msaccess.exe     AppVer: 10.0.2616.0     ModName: vbe6.dll     ModVer: 6.4.99.72     Offset: 0009792f .  I have other, much larger Access applications running on the WinXP machine and they don't have a problem (of course, they don't have this call).  
0
 
flavoCommented:
May i ask why you need this?  Maybe there is another way around it
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
cacomputerguyAuthor Commented:
Sure.  I have an automated "process" for creating an MDE file from an MDB front-end.  The code looks like this -
    ' The following lines simulate accepting the default name, clicking Make MDE and clicking Save
    SendKeys "C:\Program Files\x.MDB" & "{Enter}"     ' path and db name of mdb file
    SendKeys "C:\Program Files\x.MDE" & "{Enter}"               ' default to putting the mde in the same folder
    If FileExist("C:\Program Files\x.MDE") Then
        SendKeys "Y"                 ' answer yes to the replace question
    End If
    SendKeys "{Enter}"               ' Save the mde file
   
    Nacc.DoCmd.RunCommand acCmdMakeMDEFile

If there's an easier way of making an MDE, I'm all for it.
0
 
flavoCommented:
ill put a call out to the others... I found the PAQ where you got this from... I'd still suggest using the menu's personally...

I HATE SENDKEYS!

Dave
0
 
Arthur_WoodCommented:
why are you creating the MDE from within Access itself?  This is NOT something that you want average users doing.  It should ONLY be done by the developer of the application, and should only need to be done once.  This is not something that should need to be done repeatedly.

Before you create an MDE, you MUST be ABSOLUTELY sure that the code compiles correctly, and that can only be done manually, so that would seem to preclude the 'automated' generation of the MDE.

AW
0
 
cacomputerguyAuthor Commented:
Thanks, AW.  I AM the developer and my application is compiled and sent out in different versions about 5 times a week.  This is NOT a process that the average user does.  I DO assure a clean compile before making the MDE because the application is compiled and tested in a test environment BEFORE it is packaged into the production versions.  I guess I'm just lazy and want the automated MakeMDE to work on the WinXP machine EXACTLY as it has for the last 1.5 years on the Win2000 machine.
0
 
Chuck WoodCommented:
I found some suggested fixes:

You will receive an "Object library feature not supported" message. Placing an underscore in front of the object and enclosing it in square brackets will generally resolve this problem. The variable should be declared as Access.[_Application].

The solution was to change the order of the references (Tools menu in vb window). There seemed to be no logic to my change in order of references - it was just trial and error.

Under Tools | References, there is a huge list. No entries have "Missing" in front of them. If none have "MISSING:", select an additional reference at random, back out of the dialog, then go back in and unselect the reference you just added. That worked!

You might want to try one or more of these.

Chuck
0
 
dannywarehamCommented:
Rather than using sendkeys (which is evil), I would recommend creating a .bat file with the necessary commands.

<Full Access 2003 Path> <Full 97 MDB Path> / convert <Full 2003 MDB Path>

You could create a macro in the database that will convert the MDB to an MDE (or call the code that does it)
<Full Access 2003 Path> <Full 2003 MDB Path> /x <macroname>

The macro could call some code that would tell what the file name should be, based on the version of the software, so it would be somewhat flexible.

I'm sure that you also know that to make an MDE, the MDB must be in the native format too (ie. A2K will only make MDE's that work on A2K)

Danny

0
 
cacomputerguyAuthor Commented:
Thanks guys.  cwood-wn-com got me past the compile step.  All three of these methods worked and got it past the compile error, however it didn't create the MDE.  Flavo and dannywareham both had good advice.  Guess I just need to suck it up and use the menus or spend more time to get a batch routine going.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now