View Full Version : Query with user-defined func called from VB


ccarpediem
12-17-2001, 09:54 AM
I have a query that uses a user defined function (defined in a module). This runs fine when I run the query directly in Access 2000, but when I create a QueryDef in my VB program and try to open a recordset using this query I get an error saying the function does not exist. Is there a way to run this query from my VB app?

Thanks!

Pat Hartman
12-17-2001, 10:09 AM
Possibly, if you add the function to your VB app. There is no way to reference a function in an Access db from a querydef you define in a VB application.

The other alternative, is to add the function to your VB app and then build the SQL in VB so that the function will be evaluated by VB and a value will be assigned before the SQL is sent off for processing.

ccarpediem
12-17-2001, 10:25 AM
Thats what I was afraid of.

Unfortunately, the function cannot be in VB to do what it needs to do.

SQL server (MSDE) does what I need to do, but as the code and database started out being developed for Access I was hoping to avoid the change.

Thanks!