views:

3375

answers:

5

I am currently using an MSAccess mdb file for a redistributable app.

A while ago I found out about SQLite, as an alternative to my solution, but the binaries they provide do not offer the possiblilty of using them as an object in VB6. (Or at least I couldn't figure it out how).

Does anyone has a link, or could write a little about connecting to a SQLite DB from VB6, and its differences with using ADO?

+2  A: 

Here is a link with code examples:

http://www.freevbcode.com/ShowCode.asp?ID=6893

Ben Hoffstein
+1  A: 

Just a clarification:

If you're using VB6 for your application, then you aren't using Access at all -- you're only using the Jet database engine.

So, this isn't really an ms-access question at all, and shouldn't have that tag.

--
David W. Fenton
David Fenton Associates

David-W-Fenton
+3  A: 

Or try DHSqlite http://www.thecommon.net/2.html from Datenhaus..

"...developed as a fast alternative to ADO, encapsulating the super-fast SQLite-engine..."

"...With only two Dlls you get a complete Replacement to the whole ADO/JET-environment - no dependency-hazzle anymore..."

..it's free (but not opensource).

gobansaor
+4  A: 

I've been working on a VB6 app with SQLite for a while and I've tried a couple of methods of connecting.

So let me summarize and give, what in my opinion is, the best answer.

Methods mentioned by Ben Hoffstein, gobansaor and David W. Fenton are good, but they rely on proprietary interfaces to sqlite.

OLEDB provider by CherryCity is good because it's using a standard interface, but they have a per installation royalty system, which makes it really, really expensive. And their website does not state upfront that the product has royalties. You only find out when you actually bought the product for development and want to distribute it.

Finally there is the absolutely free as in both beer and speech, SQLite ODBC driver at http://www.ch-werner.de/sqliteodbc/ . It works pretty well and I haven't encountered any major issues just yet. The only minor issue I've encountered is that it won't allow multiple statements in one call, so you just have to separate it. In addition, the driver allows the DSN-less approach, which makes everything so much easier.

So, imo, the ODBC driver is really the best solution.

AngryHacker
+1  A: 

Just an FYI on this topic/question ...

The FreeVB code link posted uses AGS_SQLite.dll which only supports SQLite 2.x (limited functionality)

The DHSqlite link provided supports SQLite 3.x as well and is a better recommendation for anyone doing SQLite development with VB6 (Classic) ... There are code examples for this SQLite engine at http://www.thecommon.net/3.html

Hope that helps!

Robert French