[AccessD] CreateObject ("Access.Application") is not working

Jim Dettman jimdettman at verizon.net
Mon Dec 10 12:46:50 CST 2012


William:

You receive a "ActiveX component can't create object" error message when
using Access
http://support.microsoft.com/kb/319844

Usually it's DAO that's the culprit and it simply needs to be re-registered.

Jim.


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Benson
Sent: Monday, December 10, 2012 12:12 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] CreateObject ("Access.Application") is not working

I have a function that I cannot seem to get to create an instance of
microsoft access even though it is installed on my machine I am getting
error 429 which is "ActiveX component can't create object". I do have
references set to both DAO and Microsoft Access 14.0 but I think that is
irrelevant


Public Function GetDB(strLoc As String) As Object
Dim Ac As Object
Dim GetDBEngine As Object
Dim strName As String
On Error Resume Next
Set Ac = GetObject(, "Access.Application")
If Ac Is Nothing Then
    Set Ac = CreateObject("Access.Application")
End If

If Ac Is Nothing Then

Set GetDBEngine = CreateObject("DAO.DBEngine.120")
If Err.Number <> 0 Then 'try 36
  Err.Clear
  Set GetDBEngine = CreateObject("DAO.DBEngine.36")
  If Err.Number <> 0 Then
    Set GetDBEngine = CreateObject("DAO.DBEngine.35")
  End If
End If
If Not GetDBEngine Is Nothing Then
    Set GetDB = GetDBEngine.Workspaces(0).OpenDatabase(strLoc)
End If
End Function
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list