Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003

    Question Unanswered: function in query


    I'm trying to connect to a dbase table via MS Excel VBA using ADO and select some records, no problems so far. Where I hit a snag is when I incorporate a function into my SQL query. The function is defined as public and is in the same module as the rest of the code and is pretty simple, accepts a string as argument and returns a string, receiving null values is accounted for.

    I get the following error msg:
    -2147217900 microsoft odbc dbase driver undefined function 'Categorize' in expression

    SELECT Categorize(CategoryCode)
    FROM sometable ......

    Again, running the same query without the function works fine.
    Any ideas?

    I could run the function on the recordset afterwards, but would like to do it all in the query itself....

  2. #2
    Join Date
    Nov 2002
    Hi Suedehead,

    Dim YourString as string

    YourString = Caterogize(CategoryCode)

    "Select " & YourString & "from...."

    This isn't pretty, but it should work.

    Good Luck,
    Bruce Baasch

  3. #3
    Join Date
    Jan 2003
    Thanks for your response but this does not work, I cannot run the function on the field CategoryCode prior to retrieving it with the query.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts