C#/VS and Access Data Engine?

  • Thread starter Thread starter David
  • Start date Start date
D

David

Is the Access Data Engine part of the VS/.net install.

Eg. I need to write a stand alone Form app for which a small DB would
be helpful. IN VB 6, I would use ADO to call the Access engine. I
know that OLE is part of C# v1.1,but does MS ship the single engine as
part of the install? If not, can I download it and install it? If
yes, what am I looking for on the MS web site?

Thanks
 
I've had it recommended to use the MSDE, you might look that up. I posted
recently a question about whether there are pitfalls in using MSDE in a
small app like that but so far no takers on the question!!
 
If you do not want to create an Access Database you can use OleDb for
everything else (Excel-Tables can be created).
OleDb is part of the Framework should allways be on a PC where Framework is
installed (not true for ODBC where you must supply the
Microsoft.Data.Odbc.dll supplied by Microsoft.

In my DataBase Class I use Interop.ADOX.dll (offered for free from
http://www.herdt.de in their C# Courses) to create
an Access Database.

To read an Access Database to a DataSet you do the following :

///private const string s_DataSetNamespace = "MainFrame";
///private const string s_mj10777_Company = "mj10777.de.eu";
///private const string s_mj10777_Folder = "\\My
Documents\\"+s_mj10777_Company+"\\";
///private const string s_DocumentFolder =
s_mj10777_Folder+s_DataSetNamespace+"\\";
///private int ip_EngineType = 5; // 5= Access
;ServerType=1 : OleDb
///private DataBase db_DataBase = null;
///
///public FormMainFrame()
///{
/// InitializeComponent();
/// i_Language = 1; // Call Method to create
sa_CreateTables, if needed
/// db_DataBase = new
DataBase(s_DocumentFolder,s_DataSetNamespace,ip_EngineType,1,ip_Language);

To create an Access Database form a DataSet do the following :

mj10777.DataBase.DataBase db_Table= new
mj10777.DataBase.DataBase(s_DocumentFolder,dset_MainFrame.Namespace,ip_Engin
eType,ip_ServerType,ip_Language);
db_Table.OnCreateDBfromDataSet(dset_MainFrame,true);

The Class takes care of all Connections strings, but there is not
User/Password support yet.

Both .dll's are include in the source of my DataBase class on :

http://www.codeproject.com/useritems/NetDbExplorer.asp

There is a help file include where everything is documented.

Hope this helps

Mark Johnson, Berlin Germany
(e-mail address removed)
 
Sorry forgot one line in the reading code :

mj10777.DataBase.DataBase db_Table= new
mj10777.DataBase.DataBase(s_DocumentFolder,s_DataSetName,ip_EngineType,ip_Se
rverType,ip_Language);
dset_MainFrame = db_Table.OnReadDBtoDataSet();
dtable_MainFrame00 = dset_MainFrame.Tables[0];

Mark Johnson, Berlin Germany
(e-mail address removed)
 
Will look into this. May use Datasets and save into XML format.
Would like to use a database engine for this project.

Thanks
 
This would be the way to do this.

DB_DataSet.ReadXml(s_FileName);
DB_DataSet.WriteXml(s_FileName,XmlWriteMode.WriteSchema);

But I often recieved read errors on Compact, so I moved to SqlCe because of
this.

Mark Johnson, Berlin Germany
(e-mail address removed)
 
Back
Top