VBA and runtime access2007

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I use vba6 in bentley microstation.
when i use an .accdr in the runtimeversion I get an error at:

Set AppAccess = CreateObject("Access.Application")

runtime error 429 ActiveX component can't create object

How can I solve this problem?
 
Hi, Fra.
How can I solve this problem?

You have some detective work to do. Please see the following Web page:

http://support.microsoft.com/kb/828550/en-us

If that doesn't help, earlier versions of the Access Runtime couldn't open
without a database file, so I suspect Access 2007 Runtime has the same
problem. You have several choices:

1.) Pass a database file name to the CreateObject method; or
2.) Open the database file beforehand and then use the GetObject method to
set focus to it; or
3.) Use the OpenDatabase method.

For more information and example code, please see the following Web pages:

http://support.microsoft.com/kb/295179/en-us

http://support.microsoft.com/kb/147816/en-us

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Fra Malarvegi said:
Hello,
I use vba6 in bentley microstation.
when i use an .accdr in the runtimeversion I get an error at:

Set AppAccess = CreateObject("Access.Application")

Unfortunately you cannot use automation is with the runtime. The reason for
this limitation is that when you launch a copy of access you must provide a
database.

The result of this limitation you can't use automation with the runtime.

However you can use the shell command and launched a copy of MS access with
the correct command line parameters to specify the database.name to open. At
that point you might be able to use "getobject" to pick up been our running
copy of MS access.

If you must use automation, you won't be able to do with the runtime.
(unless above kludge works -- been meaning to try it for some time now).
 
If you must use automation, you won't be able to do with the runtime.
(unless above kludge works -- been meaning to try it for some time now).

Well I just gave the above idea a try and it does work.

So presumably you could execute a shell command want to to launch a copy of
the file running as a runtime. This also means you'd skip the open database
step in your VB code also.

You'll just need:
Set objAccess = GetObject(, "access.application")

The above code will pick up the running copy of MS access.

If you just need to read mdb data then you actually don't really need to
automate ms access.

It really depends on which trying to accomplish here.
 
Back
Top