Your code will never work because you're not using the function correctly. You need to specify the connection object and utilize DBConnOpen(). See the UDF header example for detailed usage. Or preferably, use DBCommand(), as it is easier to use.
_________________________
There are two types of vessels, submarines and targets.