ADO - Access Undefined function

  • Thread starter waiting to complete an OLE action
  • Start date
W

waiting to complete an OLE action

I am using ADO in and MS Excell Code module / Macro to run some select
queries that exist in an access database.

The access query that I am running uses a custom function named
fFindVendorName that exists in a code module in the access database file.

The acces query runs when it is launched from within access.

When the access query is executed by the ADO code in the excell module I get
the following error message.

"[Microsoft][ODBC Microsoft Access Driver] Undefined function
'fFindVendorName' in expression."

I do not understand why this is happening. The function does exist in a code
module that exists in the access DB. Why does this happen? Can anyone tell me
how they resolved this problem.

Thanks,
Mark
 
D

Douglas J. Steele

Unfortunately, you cannot use UDFs (User-Defined Functions) when querying an
Access database from outside of Access. The query is being interpretted by
Jet, which doesn't know anything about UDFs.

There only work-around I'm aware of is to use Automation (i.e.: instantiate
a reference to the Access application and run your query through that), but
depending on what you're trying to do with the results, that can sometimes
not work either.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"waiting to complete an OLE action"
 
W

waiting to complete an OLE action

Thanks! I think that will work. All I need to do is put the results of the
query into a spread sheet so as long as the query runs and brings the records
into a recordset it will solve my problem.

Thanks,
Mark

Douglas J. Steele said:
Unfortunately, you cannot use UDFs (User-Defined Functions) when querying an
Access database from outside of Access. The query is being interpretted by
Jet, which doesn't know anything about UDFs.

There only work-around I'm aware of is to use Automation (i.e.: instantiate
a reference to the Access application and run your query through that), but
depending on what you're trying to do with the results, that can sometimes
not work either.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"waiting to complete an OLE action"
I am using ADO in and MS Excell Code module / Macro to run some select
queries that exist in an access database.

The access query that I am running uses a custom function named
fFindVendorName that exists in a code module in the access database file.

The acces query runs when it is launched from within access.

When the access query is executed by the ADO code in the excell module I
get
the following error message.

"[Microsoft][ODBC Microsoft Access Driver] Undefined function
'fFindVendorName' in expression."

I do not understand why this is happening. The function does exist in a
code
module that exists in the access DB. Why does this happen? Can anyone tell
me
how they resolved this problem.

Thanks,
Mark
 

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