Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# App get open Access

Status
Not open for further replies.

aTekTipsUser

Programmer
Nov 8, 2004
68
US
I have an MSAccess database. It launches a C# application. Is there a way for the C# application to get a reference or somehow access the MSAccess application that launched the C# application. I want the C# application to open up reports and/or other forms within the MSAccess application. Thanks in advance for the help.
 
i can think of a simple way.

your c# application can get an argument that tels it where the access file is. for example suppose your apication name is myProgram.exe and the access file is c:\mdb1 you should call it from your access file
myProgram.exe c:\mdb1

int the main function of the c# application you can go to the args[] and so you know where is the access file that called you.

the second thing is to access the mdb file from c#.
for that you have to add a refferance to microsoft access librery, wich is COM (rater then .NET). and then you can do many things with yor access file. try finding samples on the interner about ms access automation.

Zeev
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top