Click here to Skip to main content
15,886,067 members
Articles / Programming Languages / C#
Alternative
Tip/Trick

Create a blank Jet database

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
23 Nov 2010CPOL1 min read 8.8K   3  
I like to use the old JET API to manipulate ACCESS Databases.In C# 4 all you need to create a blank JET database is add a reference to Microsoft.Office.Interop.Access.Dao library in your WINDOWS FORMS project, and two simple lines of code: var engine=new DBEngine(); var...
I like to use the old JET API to manipulate ACCESS Databases.

In C# 4 all you need to create a blank JET database is add a reference to Microsoft.Office.Interop.Access.Dao library in your WINDOWS FORMS project, and two simple lines of code:
var engine=new DBEngine();
var db=engine.CreateDatabase(fileName,locale,option);


fileName: full path of the new blank database file

locale: collating order and password

option: encrypt database and file format version (dbVersion10 for JET 1.0, dbVersion20 for JET 2.0 ...).

JET API is no more called JET.

Sorry, I'm spanish and my english is not good, so I prefer to copypaste from wikipedia to explain:

With version 2007 onwards, Access includes an Office-specific version of Jet, initially called the Office Access Connectivity Engine (ACE), but which is now called the Access Database Engine.

This engine is fully backward-compatible with previous versions of the Jet engine, so it reads and writes (.mdb) files from earlier Access versions.

It introduces a new default file format, (.accdb), that brings several improvements to Access..


If you don't own office 2007 or 2010, you can get several libraries for access here:

download libraries for free

I know JET is a deprecated way, but I'm also near to be deprecated, and JET (or ACE) is an easy and direct way for ACCESS databases.

It's not better, it's just different... and deprecated.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Telefonica de Espana
Spain Spain
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --