GetObject in Access 2007 Beta 2

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

Guest

The GetObject method seems to intermittently fail in Access 2007 Beta 2. A
code snippet is below:

Dim oApp as Object
Set oApp = GetObject(“C:\Example.mdbâ€)

Sometimes this correctly sets oApp to the access database and sometimes it
fails with Run-time error -2147467259 (80004005), Automation error,
Unspecified error.

Does anyone know of a solution for this problem?
 
I have not done this with Access, but I use GetObject and
CreateObject with Excel -- here is an idea you can adapt

'if Excel is already open, use that instance
'this will generate an error if it is not open
'so we will ignore it
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
On Error GoTo error_handler

'What did we find?...
If TypeName(xlApp) = "Nothing" Then
'Excel was not open -- create a new instance
Set xlApp = CreateObject("Excel.Application")
End If


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Back
Top