473,408 Members | 2,009 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,408 software developers and data experts.

Launch MS Access from C#

Hi,

This may not be possible, but here goes. I would like to be able to start
up Access from C# and have it open up a specific object (in my case a Table)
in the database. Access doesn't seem to have a command line option to do
this, although one can create a shortcut to do this.

Any suggestions? TIA,

Dan
Aug 15 '06 #1
4 1985
Dan,

You will have to access Acess through automation. If you look in the
COM tab when adding a reference, you should see something for the Access
object library, or something to that effect. Set a reference to that, and
then you will be able to do it programatically.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DanK" <Da**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.com...
Hi,

This may not be possible, but here goes. I would like to be able to start
up Access from C# and have it open up a specific object (in my case a
Table)
in the database. Access doesn't seem to have a command line option to do
this, although one can create a shortcut to do this.

Any suggestions? TIA,

Dan

Aug 15 '06 #2
Nicholas,

Thanks for that tip. I'm probably going to have more questions regarding
automation, but hopefully I can figure it out from here.

Dan

"Nicholas Paldino [.NET/C# MVP]" wrote:
Dan,

You will have to access Acess through automation. If you look in the
COM tab when adding a reference, you should see something for the Access
object library, or something to that effect. Set a reference to that, and
then you will be able to do it programatically.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DanK" <Da**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.com...
Hi,

This may not be possible, but here goes. I would like to be able to start
up Access from C# and have it open up a specific object (in my case a
Table)
in the database. Access doesn't seem to have a command line option to do
this, although one can create a shortcut to do this.

Any suggestions? TIA,

Dan


Aug 15 '06 #3
Hello Nicholas,

Well, as expected here I am asking another question. I can open the
database and see it using the "OpenCurrentDatabase" and "Visible" methods,
but I don't see how to open a particular table. Any thoughts?

Thanks again.

Dan

"Nicholas Paldino [.NET/C# MVP]" wrote:
Dan,

You will have to access Acess through automation. If you look in the
COM tab when adding a reference, you should see something for the Access
object library, or something to that effect. Set a reference to that, and
then you will be able to do it programatically.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DanK" <Da**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.com...
Hi,

This may not be possible, but here goes. I would like to be able to start
up Access from C# and have it open up a specific object (in my case a
Table)
in the database. Access doesn't seem to have a command line option to do
this, although one can create a shortcut to do this.

Any suggestions? TIA,

Dan


Aug 15 '06 #4
I found it! I had to look in the VB help under the Access Help menu, but
there it was in the DoCmd method. Only 3 hours and 4 lines of code to get it
to work

Dan

"Nicholas Paldino [.NET/C# MVP]" wrote:
Dan,

You will have to access Acess through automation. If you look in the
COM tab when adding a reference, you should see something for the Access
object library, or something to that effect. Set a reference to that, and
then you will be able to do it programatically.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DanK" <Da**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.com...
Hi,

This may not be possible, but here goes. I would like to be able to start
up Access from C# and have it open up a specific object (in my case a
Table)
in the database. Access doesn't seem to have a command line option to do
this, although one can create a shortcut to do this.

Any suggestions? TIA,

Dan


Aug 15 '06 #5

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

Similar topics

0
by: Trips | last post by:
Hello Folks I have been having headache solving this and now I need your help I have developed an windows application which access network resources under differnt authenticated identity and...
0
by: Matt Fox | last post by:
All, After installing sp2 I have this issue where if I try to launch an .MDB (Access database) file off any network share through explorer, that is open by multiple users, it will not launch...
1
by: Michael Howes | last post by:
I have a c# windows form that talks to a web service on a server that then can talk to multiple "agents" on different machines using web service calls. I want to be able to launch an application...
4
by: Dave Kolb | last post by:
If I make ASPNET a member of the admins group it can launch my COM+ object but I do not want to do that. What permissions do I need to set for the lowly ASPNET user so that it can launch a COM+...
2
by: c.verma | last post by:
I have a web based (forms based authentication) asp.net application that uses .NET remoting. It has web.config.remoting with all the required settings in it. As soon as it tries to access the...
0
by: c.verma | last post by:
I have a web based (forms based authentication) asp.net application that uses .NET remoting. It has web.config.remoting with all the required settings in it. As soon as it tries to access the...
8
by: Marcus | last post by:
I have this application I have made that I launch when the user logs into Windows XP. I would like to delay the launch of the application so that it starts 1 minute after the user has logged in. ...
7
by: dongarbage | last post by:
Hi there, I'm very new to activex controls and c# programming. I'm writing a c# application and I want it to be invoked when my users click a button on a web page. Its an application with a...
1
by: ben.brearley | last post by:
Hi All, Does anyone know of any way to launch C# forms from an MS Access application? Weird question I suppose, but the reason is that I am wanting to rewrite a MS Access application into a...
3
by: tombrogan3 | last post by:
Hi, I'm writing a service which has to monitor a database looking for new feeds (basically a few hundred thousand rows with a common id). When it finds a new feed I can either: 1) Process it on...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
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
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...
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,...

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.