473,760 Members | 10,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!

Apr 19 '06 #1
1 2020
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" <nk******@gmail .com> wrote in message
news:11******** **************@ z34g2000cwc.goo glegroups.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!

Apr 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3713
by: Steven Bethard | last post by:
So when I'm writing a class and I define an __init__ method, I sometimes haven't called object.__init__, e.g.: class C(object): def __init__(self, x): self.x = x instead of class C(object):
5
2158
by: Pekka Niiranen | last post by:
Hi there, I have two scripts. The first "main.py" sets some variables and then imports another called "gen.py". The idea is to provide "main.py" that defines some paths, variables etc. without using Windows environment variables. Various other "hackers" will make additional Python scripts (subroutines) like "gen.py" that utilize variables set by the "main.py" and which "main.py" calls. I can do this with "subprocess" module by setting...
1
2137
by: kayakerjess | last post by:
Hi, I have an Access Data Project (.adp) that I am trying to open and execute from Python. I am using the win32com.client, and I have successfully opened the application, but I'm getting an exception when I try to execute the function (actually a "Sub" that returns void, but that shouldn't matter). Here's what I have so far: conn=win32com.client.Dispatch('Access.Application')
1
2853
by: Matt Alanzo | last post by:
On another newsgroup an Access knowledgable party posted: >You should be able to connect an Access ADP to an existing SQLExpress >database running in SQLS 2000 compatibility mode. The only thing you >won't be able to do is access any of the design surfaces for SQLS >objects in the ADP. I checked with the Access team on this :-) > I appealed for clarification but without reply. Maybe somone on this newsgroup can provide insight.
1
2040
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access. Unfortunately, the owner of this company has disappeared even though his website still functions. As the program requires updating, I was wondering whether anyone has any suggestions, as to what I should do. The program allows you to search a public database called PubMed. You can mark abstracts...
6
3441
by: ronwer | last post by:
Hello, The title doesn't completely cover the question I have, but it's a bit more complicated problem we have. We are using a database, based on Acces, but developed by a third party developer who sells it under his own name. So, functionally it's a very specific database for a specific purpose. Now we want to make certain changes in this database, but for reasons of
10
1846
by: Bugs | last post by:
Hi I have distributed an mdb file that works fine on my PC using Access 2003, but when a copy I sent to someone running Access2003 he gets the error message "missing the intranet or the website". This is driving me nuts. Could anyone please shed some light on what is causing this and any possible fixes. Very much appreciated.
55
3561
by: AnandaSim | last post by:
I just had a google through this NG but have not seen mention of Erik Rucker's blog entry and the new Jet: http://blogs.msdn.com/access/archive/2005/10/05/477549.aspx mentioned by Mike Gunderloy http://www.larkware.com/dg4/TheDailyGrind726.html Aside from the Sharepoint feature extension, amazing news.
35
2563
by: robert d via AccessMonster.com | last post by:
I was asked to provide a proposal. I provided a proposal on my application and the prospective client likes what I have but is wary of it having been developed in Access. I don't understand this concern since my front-end application will be linked to a SQL SERVER backend. But there seems to be this "conventional wisdom" among IT people that Access is a toy database. Okay, let's redefine that as "Jet" is a toy database (which I don't...
0
9521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9900
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3863
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.