query in another database

A

asc4john

From one Access Database to another, I do SELECT * FROM query IN "C:\DB
\other\database.mdb"
This usually works well. I created a function to use in the other
database and it works great.
But now when I do SELECT * FROM query IN "C:\DB\other\database.mdb",
I get an error "Unrecognized Function"

How to get around this?
 
A

asc4john

From one Access Database to another, I do SELECT * FROM query IN "C:\DB
\other\database.mdb"
This usually works well. I created a function to use in the other
database and it works great.
But now when I do  SELECT * FROM query IN "C:\DB\other\database.mdb",
I get an error "Unrecognized Function"

How to get around this?

Apparently you can't do this.
So I tried, plan B, opening the purchase database and running the
function with
Dim accapp As Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase "C:\DB\other\purchase\purchase.mdb"
' run a user defined function
Me.Text10 = accapp.Run("getMaterialDescription", 75) ' 75 here is a
material ID
This works but is slow.

I can bring the records into the first database from the second
database with a query and then process them, plan C.
I would rather not do that as there are three other databases that
will need to do essentially the same thing.
I just want to say "getMaterialDescription" from the purchase database
and be done.
I have also tried, plan D, a temp table in the purchase database and
then queried it and that also works, but has a number of
other disadvantages.

Looks like plan C will be the choice. unless there are better
suggestions.
 
D

Douglas J. Steele

Is there any way you can put the user-defined function in the database in
which you've got the SELECT * FROM query IN "C:\DB\other\database.mdb"?
Something like:

SELECT Field1, Field2, MyFunction(Field1, Field2), Field3 FROM query IN
"C:\DB\other\database.mdb"
 
A

asc4john

Is there any way you can put the user-defined function in the database in
which you've got the SELECT * FROM query IN "C:\DB\other\database.mdb"?
Something like:

SELECT Field1, Field2, MyFunction(Field1, Field2), Field3 FROM query IN
"C:\DB\other\database.mdb"

--
Doug Steele, Microsoft Access MVPhttp://www.AccessMVP.com/djsteele
Co-author: "Access 2010 Solutions", published by Wiley
(no e-mails, please!)







- Show quoted text -

Not really, hence plan C. Or really a variation which now seems to
works quite well.
But I will have to maintain that same code in several databases.
But I might be able to work around that also.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top