Last post Jul 07, 2009 09:41 PM by hans_v
Jul 07, 2009 07:46 PM|calinetfan|LINK
I have an Access database and a VBA function in a module.
I need that function for my query to work but when I call the query from ASP.NET, it won't work. I get an error "function not defined". I browsed through the net and I found out this doesn't work in ASP.NET. Is it true and if it is, how can we get around
Jul 07, 2009 09:41 PM|hans_v|LINK
Yes, it is true. When you're using a mdb file in an ASP.NET environment, you should realize that you're not dealing with a Access database (Application), but with a Jet Database Engine. You can only access the tables, relations and stored queries, not the
forms, reports and modules. So any self made VBA function isn't accesible and cannot be used. In fact, even some build in functions in which you can use in Access cannot be used either, because they are not supported by Jet, like for example the Nz and Replace functions.
Also a common mistake, when you want to select records using the LIKE operator, you should use '%' as the wildcard character instead of '*' which is used in Access.
The only Build in Functions you can use in your queries you can find here under the header 'Use Sandbox mode operations with Jet 4.0 Service Pack 3 and
So how to get around it? Well, retrieve the database fields that you need and create a function in ASP.NET (VB.NET or C#) to do some logic with it