Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Access Object and Bypass Autoexec

Status
Not open for further replies.

dpfeffer

Programmer
Mar 26, 2001
4
AU
Hi

I have created an object that points to another Access database. I am then trying to assign the results of a function in the newly opened database to a local recordset. The following code does this...

Dim appAccess As Access.Application
Dim rst as Recordset

Set appAccess = GetObject(strDatabasePath)

Set rst = appAccess.Run("fnReturnData")

However, when I call the GetObject, Access opens the required database and runs the Autoexec macro.

Is there a way to bypass the autoexec macro of this database when I link to it, so that I can simply call the function that is contained within it..??

Thanks
 
Now let me make sure what you want to accomplish here. You are defining a database as another object and then opening that object all to execute one function in that object. If that is the reason; the execution of a function, you’re doing a bit too much work.

In your database set a reference to the database having the function and then just call the function from your database.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Oooops...I left out one key item in the description. I am doing this from within VB6, and am unable to create a reference to the .mdb file.
 
Well, then you certainly have a valid question here. If you are starting from VB6 my idea won't work at all...but...unfortunately....I think you may be out of luck here. When you open that object you are going to execute the autoexec macro.

You might post this in one of the VB groups. Perhaps someone has already done it over there.

Good luck. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top