Opening Access 2010 database with VB.Net 2008

I use this to open earlier versions of access.  Obviously doesn't work with Access 2010.  How do you open an "accde" file with vb.net?  Do you have to convert it to a .mde or .mdb first?  

Dim objAccess As Access.Application
objAccess = New Access.ApplicationClass()
objAccess.OpenCurrentDatabase("database path", False, "")

objAccess.Quit(Option:=Access.AcQuitOption.acQuitSaveNone)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess)
objAccess = Nothing

Any help would be great!

Thanks.

Jim
transstatesAsked:
Who is Participating?
 
CodeCruiserCommented:
Did you try Process.Start("path of the file")?
0
 
DhaestCommented:
What do you want to do ? I don't recommend to use access.application, ... but use ado.net

See Data Programming with Access 2010

http://msdn.microsoft.com/en-us/library/ff965871.aspx
0
 
transstatesAuthor Commented:
Thanks for the help.

What I'm trying to do is just open and access database, "accde" file.  This db contains a list of reports to print.  So I just need to open it and then close the msaccess.exe when the user is finished.

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
transstatesAuthor Commented:
When this access database opens, it has a startup form that will guide the user the rest of the way. I just need to open it like you would a regular .mdb.  The above code opens the startup form for previous versions of access.
0
 
transstatesAuthor Commented:
Dhaest, I only gave lower points becuase the process.start actually did what I need for the quick fix.  Your link is very helpful for doing more work with access.  

I thank you both so much for the help!!

Jim
0
 
CodeCruiserCommented:
Glad to help :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.