2

I have defined a Function in MS Access database. I am using that function in Query. I saved that query as "Query1". This query runs successfully in MS Access. But, when I call the same query from VB (using ADO), it is giving me error:

Run-time error '-2147217900 (80040e14)':

Undefined function 'Concatenate' in expression.

Below is the code I use to access "Query1":

rs.Open "Select * From Query1", CN1, 2, 2
If Not rs.EOF Then
'Get Data
End If
rs.Close
Chintan Shah
  • 373
  • 1
  • 2
  • 16
  • You haven't made clear whether your VB call is in Access still or another program, if still with Access then I suggest using DAO instead of ADO. – Matt Donnan Feb 13 '12 at 10:32

1 Answers1

3

You cannot use user defined functions (UDFs) outside of Access.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
  • 1
    You can post the UDF if you want SO people to look at an alternative approach. – Fionnuala Feb 12 '12 at 12:39
  • I am using Concatenate function to get comma separated string from one column of rows. Can this be done using normal ms access query? – Chintan Shah Feb 17 '12 at 17:23
  • 1
    @Chintan Shah No, you cannot concatenate without a UDF (http://stackoverflow.com/questions/92698/combine-rows-in-access-2007/93863#93863, http://stackoverflow.com/questions/230241/does-ms-access2003-have-anything-comparable-to-stored-procedure-i-want-to-run/231570#231570) – Fionnuala Feb 17 '12 at 17:27