SQL call to VBA, named or omitted parameters syntax?

G

Guest

Hi
I have an SQL statement that makes calls to VBA functions, like this
SELECT f1, f2, usrfncCalculate(f3, f4, f5) as f
FROM Table

Where usrFncCalculate is a VBA function that looks like this
FUNCTION usrFncCalculate(P1 as string, OPTIONAL P2 as variant, OPTIONAL P3 as variant) as Strin
if not IMISSING(P2) then...
end functio

Can anyone point me to some documentation about the rules on calling VBA functions from SQL like this
For example the rules on Paramater arrays, named parameters, and missing parameters

Apparently you are not allowed to specify named parameters like this: SELECT usrFncCalculate(P1: = "Larry")
And you are not allowed to omit parameters like this: SELECT usrFncCalculate("Larry", , "Brown"
Can anyone confirm that there is no way to specify named parameters, or missing parameters with the two comma method
Thanks in advance.
 
D

david epsom dot com dot au

Optional parameters are ok if they are followed by another parameter.


Larry Brown said:
Hi:
I have an SQL statement that makes calls to VBA functions, like this:
SELECT f1, f2, usrfncCalculate(f3, f4, f5) as f6
FROM Table1

Where usrFncCalculate is a VBA function that looks like this:
FUNCTION usrFncCalculate(P1 as string, OPTIONAL P2 as variant, OPTIONAL P3 as variant) as String
if not IMISSING(P2) then....
end function

Can anyone point me to some documentation about the rules on calling VBA functions from SQL like this?
For example the rules on Paramater arrays, named parameters, and missing parameters?

Apparently you are not allowed to specify named parameters like this:
SELECT usrFncCalculate(P1: = "Larry").
And you are not allowed to omit parameters like this: SELECT
usrFncCalculate("Larry", , "Brown")
Can anyone confirm that there is no way to specify named parameters, or
missing parameters with the two comma method?
 
D

david epsom dot com dot au

I mean, optional parameters are OK if they are NOT followed
by a parameter value.
 

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