
MS-Access module function call from VB
Hi Val,
unfortunately it did not work in a query called by a VB
program. I get an "Undefined function 'MyModule' in
expression" error. The query works fine if called directly
from Access.
The query looked like:
SELECT MyModule() AS Test FROM TestTable;
And the VB code:
With dbCmd
.ActiveConnection = dbCon
.CommandType = adCmdStoredProc
.CommandText = "Query2"
Set rst = .Execute
End With
Ewald K. Rieger
Quote:
>-----Original Message-----
>Hi Ewald,
>No, you cannot call user-defined function from VB.
Provider will not allow
Quote:
>to do that. What you could try to do is to store your
query, which calls
>user-defined function, in Access and call it from VB same
way as we call
>stored procedures. In that case you will not pass any
user-defined function
Quote:
>names in your query string to provider. It may work
>--
>Val Mazur
>Microsoft MVP
message
>> Hi,
>> I'm looking for a possibility to call a function defined
>> in a MS-Access DB module from a VB program using ADO.
>> I tried to call this function from within a query of the
>> database which works fine if executed from Access but
>> delivers 'unknown function' when executed via ADO from a
>> VB program. Some ideas ?
>> Thanks
>> Ewald
>.