|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Calling Access based Modules from Vb.NetHi,
I have defined a module called "Utility Functions" in MS-Access. In that module, I have defined a function called NullToZero. I used this function in one of my stored Queries in Access. This works fine when I run the query in Access itself. Now, when I call the query from Visual Basic through an OleDbCommand and an OleDbConnection, I get the exception: "undefined function in expression" Is there a special way to call Modules in Access from Visual Basic? If I call the query from Visual Basic without NullToZero, it works fine. But, I require that the values updated by my stored query writes 0 instead of Null values. Is there a way out? Or do I have to run the query and then record by record update null values to 0? Please let me know. Thanks! Sorry, not going to happen, you will need to come up with another solution.
If it was SQL server, I woud use the COALESCE function. When you query a MDB file using DotNet, you are using the Jet SQL engine. Access need not even be installed on the system being used, therefore Visual Basic for Applications may not be available, therefore the modules, macros and forms are totally ignored by OleDbCommand. Show quoteHide quote "Nikhil" <nkark***@gmail.com> wrote in message news:1145439108.523404.108650@z34g2000cwc.googlegroups.com... > Hi, > I have defined a module called "Utility Functions" in MS-Access. In > that module, I have defined a function called NullToZero. > I used this function in one of my stored Queries in Access. This works > fine when I run the query in Access itself. > Now, when I call the query from Visual Basic through an OleDbCommand > and an OleDbConnection, I get the exception: "undefined function in > expression" > Is there a special way to call Modules in Access from Visual Basic? > If I call the query from Visual Basic without NullToZero, it works > fine. But, I require that the values updated by my stored query writes > 0 instead of Null values. Is there a way out? Or do I have to run the > query and then record by record update null values to 0? > Please let me know. Thanks! >
How to call IE to open a new page.
Listview SubItems image index Writing INI section failing webbrowser System.IO.FileNotFoundException SQL Connection help needed 1.1 and 2.0 .Net framework in same application? how to move a form that FormBorderStyle is None How to prevent "Input string was not in a correct format" in DataGridView button with drop down how to extract icon (or resource) ? |
|||||||||||||||||||||||