dbTalk Databases Forums  

Cannot retrieve data via Excel if Access query got user-defined function

comp.databases.ms-access comp.databases.ms-access


Discuss Cannot retrieve data via Excel if Access query got user-defined function in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lane
 
Posts: n/a

Default Cannot retrieve data via Excel if Access query got user-defined function - 01-04-2012 , 07:35 AM






Hi Access experts,

I would like to retrieve data from Access using Excel VBA through ADO.
This was successfully done in the past until a user-defined function
was added to one of the fields in the Access query. On Access, the
query can run successfully. On Excel, an error "Microsoft Access
Database Engine -> Undefined function in expression" is returned.

Has someone encountered similar problem before? Any workaround? I
think using user-defined function in queries should be quite common
because it is so useful.

Thank you.

Reply With Quote
  #2  
Old   
Phil
 
Posts: n/a

Default Re: Cannot retrieve data via Excel if Access query got user-defined function - 01-04-2012 , 11:17 AM






On 04/01/2012 13:35:11, Lane wrote:
Quote:
Hi Access experts,

I would like to retrieve data from Access using Excel VBA through ADO.
This was successfully done in the past until a user-defined function
was added to one of the fields in the Access query. On Access, the
query can run successfully. On Excel, an error "Microsoft Access
Database Engine -> Undefined function in expression" is returned.

Has someone encountered similar problem before? Any workaround? I
think using user-defined function in queries should be quite common
because it is so useful.

Thank you.

Yes and the most annoying one is that Excel doesn't recognise Nz() function,
but fortunately it does recognise IsNull() so there is sometimes a work
around

Phil

Reply With Quote
  #3  
Old   
Bob Barrows
 
Posts: n/a

Default Re: Cannot retrieve data via Excel if Access query got user-defined function - 01-04-2012 , 12:55 PM



Lane wrote:
Quote:
Hi Access experts,

I would like to retrieve data from Access using Excel VBA through ADO.
This was successfully done in the past until a user-defined function
was added to one of the fields in the Access query. On Access, the
query can run successfully. On Excel, an error "Microsoft Access
Database Engine -> Undefined function in expression" is returned.

Has someone encountered similar problem before?
Yes. Everyone who has tried.

Quote:
Any workaround? I
think using user-defined function in queries should be quite common
because it is so useful.

Yes, but they can also lead to security problems so MS prevented their use
from external apps.
http://support.microsoft.com/default...98&Product=acc

Note: the article seems to imply that a registry change can enable external
apps to use udfs, but I've never seen anyone successfully do it.

Reply With Quote
  #4  
Old   
Lane
 
Posts: n/a

Default Re: Cannot retrieve data via Excel if Access query got user-defined function - 01-04-2012 , 06:21 PM



Thank you for the replies. Now, I know that this is a limitation of
Access. This is so inconvenient. If UDF could be used, a lot of work
could be done at the Access side.

On Jan 5, 2:55*am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:
Quote:
Lane wrote:
Hi Access experts,

I would like to retrieve data from Access using Excel VBA through ADO.
This was successfully done in the past until a user-defined function
was added to one of the fields in the Access query. On Access, the
query can run successfully. On Excel, an error "Microsoft Access
Database Engine -> Undefined function in expression" is returned.

Has someone encountered similar problem before?

Yes. Everyone who has tried.

Any workaround? I
think using user-defined function in queries should be quite common
because it is so useful.

Yes, but they can also lead to security problems so MS prevented their use
from external apps.http://support.microsoft.com/default...us%3B294698&Pr...

Note: the article seems to imply that a registry change can enable external
apps to use udfs, but I've never seen anyone successfully do it.

Reply With Quote
  #5  
Old   
Bob Barrows
 
Posts: n/a

Default Re: Cannot retrieve data via Excel if Access query got user-defined function - 01-05-2012 , 08:38 AM



Yep, it's one of the big factors in deciding to move to SQL Server backends.
SS stored procedures are so much more powerful than the Jet equivalent.

Lane wrote:
Quote:
Thank you for the replies. Now, I know that this is a limitation of
Access. This is so inconvenient. If UDF could be used, a lot of work
could be done at the Access side.

On Jan 5, 2:55 am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:
Lane wrote:
Hi Access experts,

I would like to retrieve data from Access using Excel VBA through
ADO. This was successfully done in the past until a user-defined
function was added to one of the fields in the Access query. On
Access, the query can run successfully. On Excel, an error
"Microsoft Access Database Engine -> Undefined function in
expression" is returned.

Has someone encountered similar problem before?

Yes. Everyone who has tried.

Any workaround? I
think using user-defined function in queries should be quite common
because it is so useful.

Yes, but they can also lead to security problems so MS prevented
their use
from external

apps.http://support.microsoft.com/default...us%3B294698&Pr..
..
Quote:
Note: the article seems to imply that a registry change can enable
external
apps to use udfs, but I've never seen anyone successfully do it.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.