hi everyone...i needed to find a code that opens a database directly....kindly assist.

Regards,

What do you mean?

Do you want to connect the Access DB?

http://www.connectionstrings.com/access-2007

Or Maybe you want to open the .mdb File?

using System.Diagnostics;

Process myProc = Process.Start("filename");

myProc.CloseMainWindow();

i get this error...i put the code on button click and that files truly is at the address given
The system cannot find the file specified

you have to replace "filename" with your path.

C:\Document and Setting\My Documents\etc.

I assume you understand this goes at the very top;

using System.Diagnostics;

This goes Where you want to call it.

Process myProc = Process.Start("filename");

and this goes where you want to close it

myProc.CloseMainWindow();

hey...you are the bestest ever!!!!!it worked....so well...thanks a mil

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.