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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO CALL ACCESS FUNCTIONS EXTERNALLY THROUGH ODBC

Status
Not open for further replies.

Kurtic20

Programmer
Jul 16, 2002
3
US

I have made user defined functions in Access that I want to call externally through ODBC. I am trying to emulate the same functionality that Oracle has with stored procedures, and replace them with the Access equivalent. These functions are used inside SQL queries. It works when I am working within Access, however, when called through ODBC I get a 'undefined function' error. Is there any possible way to get around this problem. I have tried everything I can think of...any help would be greatly appreciated.

Here is example code:

Public Function to_date(ByVal date_str As String, ByVal form_str As String) As String
to_date=Format(date_str, form_str)
End Function

SELECT STATE, to_date("12/10/1879", "yyyy-mm-dd") FROM SOME_TABLE;

Curtis Wesley
"Party on, dude."
 
Jet SQL is simply a component of Access that is usable through ODBC. Forms, reports, and modules are outside this realm. Unless there is some trick I don't know about you have to use some sort of Automation and give up on ODBC. I'm assuming your above example is over simplified and that you can't really just use format directly in the query.
 
I can use the format function directly in the query, provided that I set up the module and tables correctly. Unfortunately, I have to go through ODBC. Is there anyway that this can be accomplished with a dll?
Curtis Wesley
"Party on, dude."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top