MDE 2 MDE 
Author Message
 MDE 2 MDE

Hi,

I have three databases (main.mde, sub_a.mde, sub_b.mde) I want to be able to
call a function say (MyFunction) from main.mde that resides in both
sub_a.mde or sub_b.mde

Someone suggested the following code but when tried I got the error message
'Method or data member not found'

    Dim DB as Database
    Set DB = DBEngine.Workspaces(0).OpenDatabase("sub_a.mde")

    DB.MyFunction()

Any ideas !!!

Thanks in advance

Mark



Fri, 11 Apr 2003 03:00:00 GMT  
 MDE 2 MDE
better add a reference to both subs in main.mde, then you can call public
functions directly

alternatively you can use automation:

set oAccess=createobject("access.application")
oAccess.opendatabase("...")
oAccess.Run "MyFunction"
...

Alex


Quote:
> Hi,

> I have three databases (main.mde, sub_a.mde, sub_b.mde) I want to be able
to
> call a function say (MyFunction) from main.mde that resides in both
> sub_a.mde or sub_b.mde

> Someone suggested the following code but when tried I got the error
message
> 'Method or data member not found'

>     Dim DB as Database
>     Set DB = DBEngine.Workspaces(0).OpenDatabase("sub_a.mde")

>     DB.MyFunction()

> Any ideas !!!

> Thanks in advance

> Mark



Fri, 11 Apr 2003 03:00:00 GMT  
 MDE 2 MDE
Alex,

Thanks for your response, as the number of sub databases may grow overtime,
and the main database will be an .mde on a client site, I didn't want to go
the references route. I had a go with what you said but that syntax didn't
work for Access 2000. After playing around for a while, have come up with
the following code that works.

Thanks again for the quick response and putting me on the right track.

Best regards

Mark Taylor

    Dim oAccess As New Access.Application
    oAccess.OpenCurrentDatabase ("C:\MyData_USA.mdb")
    MsgBox oAccess.Run("MyFunction")

    Set oAccess = Nothing


Quote:
> better add a reference to both subs in main.mde, then you can call public
> functions directly

> alternatively you can use automation:

> set oAccess=createobject("access.application")
> oAccess.opendatabase("...")
> oAccess.Run "MyFunction"
> ...

> Alex



> > Hi,

> > I have three databases (main.mde, sub_a.mde, sub_b.mde) I want to be
able
> to
> > call a function say (MyFunction) from main.mde that resides in both
> > sub_a.mde or sub_b.mde

> > Someone suggested the following code but when tried I got the error
> message
> > 'Method or data member not found'

> >     Dim DB as Database
> >     Set DB = DBEngine.Workspaces(0).OpenDatabase("sub_a.mde")

> >     DB.MyFunction()

> > Any ideas !!!

> > Thanks in advance

> > Mark



Sat, 12 Apr 2003 14:38:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How do you create .mde?

2. DAO code with MDE files

3. MDE Issue

4. Release Locks on Library mde

5. Making an MDE

6. References to MDE files

7. Cannot make MDE

8. subform from mde file

9. tables in an MDE file

10. .mdb or .mde?

11. MDE error message

12. Embed Application Icon in MDE?

 

 
Powered by phpBB® Forum Software