473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

ht use MS Access like a stored procedure?

I cannot figure out how to:

1. call an Access query from C# and consume the recordset, where the query
uses a user defined function. for example

select rowid, GetBreedOfCat([rowid]) from tblCats;

2. call an Access function from C# and consume the returned value. For
example, how to consume the returned recordset:
Public function getAllcats() as recordset
end function
Thank you for your help,

John
Jul 21 '05 #1
2 1391
In the same way as with any other COM component: you must use automation and
COM Interoperability to achieve things like that by opening an Access
application object and making your call from this object.

An Access database is split into two entity: the Database part, with the JET
driver and the VBA/GUI part. When you open an access database with the JET
ADO.NET driver, you don't have access to the VBA/GUI part. If you want to
have access to a VBA functionf, you must first open the Acces application as
a COM object and ask it to make the required call to the JET driver on your
behalf.

Obviously, unless you already know your way in and out of Access automation,
this is probably not worth the energy to try it.

S. L.

"Rigid Kitten" <mr********@comcast.net> wrote in message
news:z4********************@comcast.com...
I cannot figure out how to:

1. call an Access query from C# and consume the recordset, where the
query
uses a user defined function. for example

select rowid, GetBreedOfCat([rowid]) from tblCats;

2. call an Access function from C# and consume the returned value. For
example, how to consume the returned recordset:
Public function getAllcats() as recordset
end function
Thank you for your help,

John

Jul 21 '05 #2
On Mon, 21 Feb 2005 07:58:41 -0700, "Rigid Kitten" <mr********@comcast.net> wrote:

¤ I cannot figure out how to:
¤
¤ 1. call an Access query from C# and consume the recordset, where the query
¤ uses a user defined function. for example
¤
¤ select rowid, GetBreedOfCat([rowid]) from tblCats;
¤

User defined (VBA) functions are not supported through Jet OLEDB or ODBC. They're only supported
when running under Access. Only the sandbox functions are supported:

http://support.microsoft.com/default...b;en-us;294698

¤
¤
¤ 2. call an Access function from C# and consume the returned value. For
¤ example, how to consume the returned recordset:
¤ Public function getAllcats() as recordset
¤ end function

This isn't supported unless you use Access automation as Sylvain pointed out.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #3

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

Similar topics

3
by: 8leggeddj | last post by:
Hello, I am having a problem when using access xp as a frontend for sql server 2000. I have been trying to update a number of stored procedures (Just simple adding fields etc) which results in...
0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
2
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. ...
1
by: Lauren Quantrell | last post by:
I have read the newsgroups and see this is a common issue but I saw no resolution for it: I have an Access2K frotn end and SQL Server 2K backend. In access, I create a temp table using code in a...
8
by: lauren quantrell | last post by:
When I open an Access form I can have no recordset specified, then in the form's OnOpen event I can do something like: Me.paramaters = "@SomeColumn = 22)" Me.recordsource = "dbo.sproc123" But I...
15
by: brettclare | last post by:
I have linked a large SQL Server table to Access, however 'only' 2,195,439 records are shown and are available to query. Can I increase the size (cache??)/number of records showing in Access? ...
0
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The...
6
by: Peter Neumaier | last post by:
Hi, I am trying to select some data through a stored procedure and would like to store the result in a local access table. Is that possible? Can somebody provide an example? Thanks&regards!...
2
by: acw | last post by:
On a SQL Server 2000 db I would like to setup a stored procedure that accesses couple tables and runs the extended stored procedure xp..cmdshell. The goal is to grant users with limited privileges...
23
by: Gloops | last post by:
Hello everybody, Is anyone able to give me some indications about how to develop an Access interface for an Oracle database ? I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i 9.2.0.1.0...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.