PDA

View Full Version : can i use UDF in sql when i programing with VB?Thanks


tshm
07-05-02, 04:47
i want to use a user defined function in my sql statment,like this:

mydb.EXECUTE "SELECT myfunc(tbl1.fld1) INTO tbl2 AS newfld FROM tbl1"

myfunc is a UDF like this:

Public Function myfunc(abcd as string)
If abcd="a" Then myfunc="1" ELSE myfunc="0"
END Function


i put the UDF in a module,but i get a error undefined function in sql err=3085

how can i avoid the error?

Thanks!

rnealejr
07-05-02, 10:31
Which database are you using ?

tshm
07-07-02, 21:16
microsoft access ,sql server