Calling Access based Modules from Vb.Net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nikhil

    #1

    Calling Access based Modules from Vb.Net

    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!

  • Jim Hughes

    #2
    Re: Calling Access based Modules from Vb.Net

    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.


    "Nikhil" <nkarkare@gmail .com> wrote in message
    news:1145439108 .523404.108650@ z34g2000cwc.goo glegroups.com.. .[color=blue]
    > 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!
    >[/color]


    Comment

    Working...