Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a function in a SQL statement

Status
Not open for further replies.

petevick

Technical User
Jul 25, 2001
131
GB
I am trying to add a function into an SQL statement. I did this in an Access DB where the function was defined in a code module. If I try the same thing from within VB I get an error regarding the function I am trying to use. I've got the function in a module and made it public, still no joy. Could it be that funtions (apart from VB functions) are not allowed in a VB driven SQL statement??
 


The use of Functions in a SQL statement depend on what functions are provided by the DBMS.
User defined functions need to be implemented on the DBMS level.
So, No, you cannot reasonably do what you want.

What type of function are you trying to create which cannot be done using the DBMS provided functionality?

In those cases where the DBMS may not provide enough functionality for you, you will need to open a recordset with-out the particular function, and loop through the records, calling your function to do what is needed for each record.
Pretty "simple" in most cases.

 
Thanks for the respose CCLINT. Thats more or less what I had assumed, you have just confirmed it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top