Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pros and cons of the Access database engine. Life after SQLite

Tags:

c#

vb6

ms-jet-ace

I asked a question a while ago about which local DB was right for my situation. I needed to access the DB from both .NET code and VB6. The overwhelming response was SQLite. However, I decided to pass on SQLite, because the only OLE DB provider for it charges royalties for every deployed copy of my software. It also requires an activation procedure to be run on every single PC.

After evaluating other options (SQL Server Compact edition - barely functional OLE DB provider, Firebird - don't want to have to pay for another driver, etc...), I've come to conclusion that the only viable choice is using .MDB files created by Microsoft Access (or the Jet engine).

I haven't used it since late 90s, so I have the following questions to those who have experience with it.

  1. Have they resolved the problem where the database would corrupt every now and then.
  2. Is access to the MDB from c# accomplished via the ADO.NET OLEDB Provider or is there a native solution (i can't seem to find it).
  3. Is there a viable alternative to the really crappy SQL Editor in Access?

Thanks.

like image 444
AngryHacker Avatar asked Mar 25 '09 06:03

AngryHacker


People also ask

What are the advantage of Access database over SQL database?

Large Amounts of Data You can query and analyze large amounts of data without the knowledge of Structured Query Language (SQL). The total size for an MS Access database including all database objects and data is 2 GB.

What are the pros and cons of SQLite?

One of the pros in our SQLite pros and cons list is that it's serverless, boosting speed and lowering complexity. However, it also means that the database is confined to the machine it's stored on only. It doesn't allow for remote work on another PC, for instance.

Is Access still relevant 2022?

Is Microsoft Access still available in 2022? Microsoft Access is still available and continues to be supported. A proven product for 25+ years it is still the most widely used desktop, team, and small/medium sized business database product.


2 Answers

Rather then going "back" to Access, I'd stick with SQLite and use the System.Data.SQLite provider for SQLite data access within the .NET code.

Then I'd just create a simple COM interop .NET class for use by VB6 that wraps any required SQLite data access functionality. Finally, just reference and use it like a standard COM object from your VB6 projects.

My knowledge of Access is probably a bit dated and biased by bad experiences, but within reason I would try most other options before resorting to the Access route.

like image 53
Ash Avatar answered Sep 24 '22 12:09

Ash


Have you considered SQL Server 2008 Express Edition (as oppose to SQL Server CE)?

1) Personally, I found that most times that Access DBs corrupted it was due to code that didn't clean up after it self, or there was a faulty Network card involved.

2)

string connectionString = @“Provider = Microsoft.Jet.OLEDB.4.0; " + 
                          @"Data Source = C:\data\northwind.mdb; " +
                          @"User Id = guest; Password = abc123”


using (OleDbConnection oleDbConnection = New OleDbConnection())
{
    oleDbConnection.ConnectionString = connectionString;

    oleDbConnection.Open();

    ...
}

3) SQL Server 2008 Express Edition

like image 41
Mitch Wheat Avatar answered Sep 26 '22 12:09

Mitch Wheat