automation problem

helmat

New member
Local time
Today, 10:19
Joined
Oct 3, 2006
Messages
3
hello, i'm working with an external database via automation, the code goes quite like this example:


'Declaration of variable in a module.
Public app1 As Access.Application

...

'and then this in a sub()
Set app1 = CreateObject("Access.Application")
app1.Application.OpenCurrentDatabase GetThePath()

'where GetThePath() is just a function returning the correct path to the
'.mdb file
End Sub


i know that it was working like this, but now it is not and i dont know why. all it does is an error message saying:

run-time error '-2147417851 (80010105)'
Method 'OpenCurrentDatabase' of object 'Application' failed

can you help me please? :confused: is there any possibility how to find out the more understandable explanation of that error from the number? where can i get the list of objects which can be created by the CreateObject() function and what does it depend on? could my problem be just a problem inside a MS SQL Server? thanx a lot & enjoy a day :D
 
Last edited:
One thing jumps out at me right away.

You dimmed the object as "appAccess" but tried using "App1" to do the work. Try using appAccess instead.
 
yeah, it would be really great if it was as simple as this. but this mistake was just in the thread, not in the program code.... so repairing a thread was easy, but what about the rest?
 
the access help for Access 97 gives similar code to you, except that the syntax is

CreateObject("Access.Application.8")

is the suffix 8 significant?


---------------------------
The path per the help also includes the fully specified database, with .mdb on the end - I presume this isn't the problem though
 
Last edited:

Users who are viewing this thread

Back
Top Bottom