Passing a missing ParamArray to ExecuteSQL and friends

I always have a shim around the database methods since I want to log any problems that occur. Now I like the new ExecuteSQL where you can pass in a ParamArray of Variants, to be used for the prepared statement. This in fact is just what I was doing in my shim: passing in a ParamArray and then binding all those to the statement I prepared inside the shim, before doing the SQLExecute. In the new model I can just pass the array straight through.

But the ParamArray is optional, both when calling my shim method and then, inside that, ExecuteSQL. But if the parameters that would go into the ParamArray are left off, what gets passed into my shim method, and what does it then pass to ExecuteSQL? I did a quick test with no extra parameters and it seems to work but I’d like to know that that’s intentional, not just by chance.

Sort of like this:

Call to my shim with no extra args:

Result = MyDBShim (dbh, sql)

Then, inside my shim:

[code]Function MyDBShim (dbh as sqlitedatabase, sql as string, ParamArray args as Variant) as Boolean

try

dbh.ExecuteSQL (sql, args)
return true

Catch error as DatabaseException

dblogmsg (error.ErrorNumber, error.Message, sql)
return false

end try
[/code]

Do I need, inside my shim method, to check whether any args have been passed in?

args would be an empty array

OK - that would explain it - thanks.