Launching and controlling MS ACCESS through my windows form

  • Thread starter Thread starter NathanJ
  • Start date Start date
N

NathanJ

I am trying to open a MS Access Front end through my windows form app.
It opens fine when the file doesn't need a password.

System.Diagnostics.Process.Start("C:\DBFrontEnds\Employee.mdb")

Is there a way I can pass the password to Access in this case? I have
looked into the startprocessInfo but I am not sure if thats the right
direction to head in. Any help or suggestions are much appreciated.

Also if this is something that is not possible is there a way to
terminate any MS Access application running on the machine so that I
could then delete the file?
 
You can use COM interop to automate MS Access easily. You create an
Access.Application object and use that object to open an *.mdb file. If the
*.mdb file is password-protected, you can pass the password in
Access.Application.OpenCurrentDatabase() method.
 
Back
Top