query in another database

  • Thread starter Thread starter asc4john
  • Start date Start date
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?
 
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.
 
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"
 
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
 
Back
Top