Use Access with Automation, from c# program

Hi to all!

for this my first post i ask information on an argument about wich a very poor documentation on the web exists: the office automation.

My problem is about a windows c# program that manage some Access data using classic DataSet.

In the same access mdb file where the tables are stored  i also have some access reports that i want to open in preview mode from the C# program.

unfortunately if i do this, i receive an error exception because "the database is already opened in exclusive mode". I think the DB could be opened from the c# program dataset.

i had the msn Q317114 article where it is explained how to automate MS Access by using Visual C#, but i don't have read anything about it.

Can someone help me

Bye bye!

RobbyAnz

 

 



Answer this question

Use Access with Automation, from c# program

  • Sjon_CA

    Sorry for my bad English,

    the situation is more simple:

    i have some access reports that i want to open in preview mode from a windows form C# program.

    unfortunately if i do this, i receive an error exception because "the database is already opened in exclusive mode".

    why I receive this error

    who are opened the Access db in exclusive mode is possible that the guilty is the dataset that read data table from the same Access DB

    thanks in advice!


  • anngela

    ok, i try...

    thank you.


  • tlin5043

    !
  • Prachi Tyagi

    That could be the culprit.

    Check in the code for the Database Connection object and use the Close() method to close the connection, perhaps that will remedy your problem.



  • Praful

    So..

    your trying to open a form in design view from C#

    If I were you I would use VBA to do that...much more natural then calling it from a C# program, and using it like an API, which it isn't.



  • Use Access with Automation, from c# program