I use MS Access to create a database, then I create a module and a
function in there. Then I try to use that function in the query and it
works fine.
Eg: SELECT * FROM myTable WHERE myFunction(myFieldInTable)
It works fine ... the result is displayed as expected.
But when I convert it to MS Access 97 format ... then I use VB and add
in a DataGrid and ADO control, then the ADO control's datasource ... I
set it to the query like above, it fail. It give me an error like
"undefined function 'myFunction' in expression".
Is there any solution I can do with that?
======================================================
Actually this is my situation where I need such a self-define function
in the query. I got a number, says "123" in the "NUMBER" field in the
table "NUMBER_TABLE", then I want a query like:
"SELECT * FROM NUMBER_TABLE WHERE combination(NUMBER, 312)"
will return the record with "123" in the "NUMBER" field. The
'combination(xxx, yyy)' will actually make any possible combination of
the "xxx" and match it with "yyy", if the one of the combination match
"yyy", then it will return true. Eg: 123, 132, 213, 132, 312, 321 ...
will be used to match with the number 312, then it will return true
and make the query return the record "123".
It works when I execute that query in MS Access 2000.
But fail when I convert it to MS Access 97 format and use it with the
ADO and Datagrid control.
======================================================