Undefined function in expression

S

Salomon Reyes

I hope someone helps me with this (I've been bugged by this one):


My environment consists of an Access 2003 database which contains some
stored queries. In particular, the one I'm working with is called
'viewPatient' which contains some Visual Basic functions. The 'viewPatient'
query works within Access fine. Unfortunately, I cannot call 'viewPatient'
from Visual Basic 6.0 nor Visual C++ 6.0. I get the error "Undefined
function 'GetPhone' in expression". viewPatient is a stored query which
contains 'GetPhone' in it's select statement. Now 'GetPhone' is a Visual
Basic public function (not a form) that is accessible wihin Access 2003 but
not to an outside program like Visual Basic 6.0 nor Visual C++ 6.0. I
thought the problem could be a 'sandbox' problem so I disabled it in the
registry (value 0). No luck!!! I even tried to bring the public module
'GetPhone' into my Visual Basic project but no luck either. Can someone
provide me help with this?

Thank you.
(I'm a newbie to VB)

url:http://www.ureader.com/gp/1059-1.aspx
 
M

Marshall Barton

Salomon said:
By design? Poor design then!!


That's absurd.

I doubt that you expect to use Excel, Cobol, etc. function's
so why would you expect to use VB functions.
 
S

Salomon

It's not absurd to expect a Visual Basic program which makes an Access (using
the Dao Library) call on a stored query (which uses Visual Basic standard
function) to work correctly. The call returns the "Undefined function in
expression" error. I believe there should be a valid resolution.
 
S

Salomon

My mistake - it's using the Ado library...

Salomon said:
It's not absurd to expect a Visual Basic program which makes an Access (using
the Dao Library) call on a stored query (which uses Visual Basic standard
function) to work correctly. The call returns the "Undefined function in
expression" error. I believe there should be a valid resolution.
 
M

Marshall Barton

DAO does not include the VBA library. It will use the
Access Expression Service if it's available to connect and
evaluate the VBA and user defined functions. Since you are
not using Access, none of that is available in your
environment any more than any other language's functions.
 
S

Salomon

Hold on, please... I am using Access. Using Ado to make a stored query call
which is in Access... The Ado call is done in VB...

Marshall Barton said:
DAO does not include the VBA library. It will use the
Access Expression Service if it's available to connect and
evaluate the VBA and user defined functions. Since you are
not using Access, none of that is available in your
environment any more than any other language's functions.
--
Marsh
MVP [MS Access]

My mistake - it's using the Ado library...
 

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