Discussion:
SQL database for use with VB6
(too old to reply)
Sarah M. Weinberger
2008-09-27 01:06:40 UTC
Permalink
Hi All,

What is a good SQL database to use with VB6? My first thought was the
Microsoft Jet database (i.e. Microsoft Access by any other name) for use
with VB6, but Microsoft basically discontinued the line and it is not
exactly present with the Vista version of the ADO / Jet install. Without
tying itno a server, is there a nice stable, not shareware, SQL database
engine that VB6 users can tie into and/or distribute along with an
application.

Thoughts?

Thanks in advance,

Sarah Marci
Sarah M. Weinberger
2008-09-27 01:19:49 UTC
Permalink
Hi Again,

I was reading in Wikipedia about the history of Microsoft Jet. I pretty much
knew the history, but it was nice to read. Anyways, Microsoft now touts ACE
(Microsoft Access Engine) for what seems like 32-bit and 64-bit platforms.
The following questions come immediately to mind:

1. Is there something better, more stable, and non-Microsoft? Microsoft has
a known history of obsoleting technology. I am not exactly crazy for being
tied to Microsoft's ever changing mood swings.

2. If ACE is the only game in town, is it distributable as easily as
Microsoft Jet was with MDAC? If so, how? Is it a nice merge module?

3. Other thoughts?

Thanks in advance.
Ralph
2008-09-27 02:34:54 UTC
Permalink
Post by Sarah M. Weinberger
Hi Again,
I was reading in Wikipedia about the history of Microsoft Jet. I pretty much
knew the history, but it was nice to read. Anyways, Microsoft now touts ACE
(Microsoft Access Engine) for what seems like 32-bit and 64-bit platforms.
1. Is there something better, more stable, and non-Microsoft? Microsoft has
a known history of obsoleting technology. I am not exactly crazy for being
tied to Microsoft's ever changing mood swings.
I find that rather amusing. Since up till the turn of the century MS was
well-known for preserving backward-compatibility. Often to a fault, where
newer technologies were tied too much to the past. How times have changed.
Post by Sarah M. Weinberger
2. If ACE is the only game in town, is it distributable as easily as
Microsoft Jet was with MDAC? If so, how? Is it a nice merge module?
ACE is a combination of an 'advanced' data access library (actually only a
newer version of Jet/DAO) and a new database format. You can still use a Jet
4.0 formatted database. You can now also connect to ACE from VB6 using the
Microsoft.ACE.OLEDB.12.0 provider. Unfortunately you can not distribute
applications using the Provider unless you also provide or the user already
has an MSAccess 2007 license. ie, owns a copy of MSAccess 2007. So it is
definitely less-distributable (is that a word? <g>) than Jet 4.

ACE (or Jet 4) is certainly not the only game in town. You might take a look
at SQL-Lite
http://www.sqlite.org/download.html
If you like it then also get a copy of Olaf Schmidt's COM-wrapper:
www.datenhaus.de/Downloads/dhRichClientDemo.zip
It consists of three Binaries, placed in the
Public Domain:
dhRichClient.dll (COM-Dll - ADO-like WrapperClasses)
sqlite35_engine.dll (StdCall-Dll, based on SQLite 3.5.7)
DirectCOM.dll (Std-Dll, allows regfree COM-instancing)
Support for the wrapper is very good as Olaf is a frequent visitor to this
forum.

I played with it and it works very well.

Others highly recommend MySQL (http://www.mysql.com/) and it seems very
popular. My experience with it haven't been that good, but I was probably
holding my mouth wrong. <g>

hth
-ralph
Sarah M. Weinberger
2008-09-27 05:52:22 UTC
Permalink
Hi Ralph,

MySQL is for purchase and installation on a server and not for distribution
with a shareware application. I need a local database engine. Sadly, if ACE
requires the purchase of Access, then that leaves that out as well. :-(

Sarah
Schmidt
2008-09-27 11:05:38 UTC
Permalink
Post by Sarah M. Weinberger
MySQL is for purchase and installation on a server
and not for distribution with a shareware application.
I need a local database engine. Sadly, if ACE
requires the purchase of Access, then that leaves
that out as well. :-(
Then you should seriously try SQLite (Public Domain
license - usable for any purpose).
The engine has a very clean structured codebase
(covered by a huge Test-Set) - an active developer-
community (new releases every 2 months or so) -
it is small and fast and can be used on a very broad
range of Operating-systems and Processors (e.g. on
ARM-devices as the iPhone) - but of course it is not
limited to these "embedded environments".
E.g. Firefox or the new Google-Browser use it as
their local "Desktop-Engine", to support Offline-
Modes and other things.

Combined with my wrapper-classes you can achieve
ca. factor 1.5-3 better Read-Performance with your
Selects - and a much better Write-Performance regarding
Inserts (ca. factor 15 - 40) compared with ADO/JET.
The single-file-DB has no size-limit (as you see on
*.mdbs) - it supports triggers (which are not available
with the JET-engine) and of course Views, you can easily
work with InMemory-DBs, to use and handle your larger
local Data-Structs not in Arrays, but over SQL-statements
regarding fast sorting or filtering if you want, etc..

Regarding the functionality of my wrapper-classes -
they are nearly similar to use as the ADO-Objects
(Connection-, Recordset- and Command-Objects)
and the wrapper also enhances the original SQLite-
engine with builtin VB-Functions, which you can use
in your Selects as e.g. IIf(), Instr(), Format$(), Left$(),
Mid$, Trim$, CLng(), CDate(), DatePart() and many
others, which behave exactly the same way as they
are defined in the VB-Runtime (its a simple redirection).
And other than in *.mdbs (when used over VB5/6)
you can define your own userdefined functions or
aggregate-functions in plain VB-Code.

Some other nice features of the wrapper-classes:

The Recordsets can be serialized to ByteArrays
very fast (ca. factor 6-8 faster than ADO-Rs) with:
Dim B() as Byte
B = Rs.Content

'(now store B in a File or send it over sockets -
or whatever)

'deserialization goes this way
Set Rs = New cRecordset
Rs.Content = B

You can also store the current content of a Recordset
with ease e.g. in a (Temp-)Table of your DB or
directly in an InMemoryDB-Cnn as shown below:
(with autocreation of the appropriate table-structure)
Dim B() as Byte, Cnn as cConnection
B = Rs.Content 'Rs e.g. retrieved from a filebased DB

Set Cnn = New cConnection
Cnn.CreateNewDB 'without arguments creates an InMem-DB
Cnn.CreateTableFromRsContent B, "MyTableName"

The above can come very handy e.g. inside CD-based
"catalog-Apps" - if you don't want to expose your DB
on your distributed CD or whatever.
You would simply have to store the TableContents of
your real DB-Tables inside Byte-Arrays (over the Rs-
serialization-feature described above) and bind these
ByteArrays statically into your App.exe as a resource
and create an InMemory-DB from this Rs-content on
App-startup using 'CreateTableFromRsContent'.

But the single-file-DBs can also be encrypted with
strong encryption, offering nearly similar performance
as unencrypted DBs (only ca. 10-15% loss).

All in all a very nice alternative to ADO/JET which
works on every current Win-OS and also on Linux/Wine.
Simple MultiUser-Mode over Network-Shares is
also possible in the same way as with *.mdbs - but
you can also switch to a real "SQLServer-Mode" using
the Application-Server which is also built into the
small set of three Dlls - this allows you to create
high performance nTier-Applications with your own
"stored procedures" which you can formulate in plain
VB6-classes, sitting inside an VB-AX-Dll-Project.

Just let me know, if you have problems with the
installation/usage of the DemoSet - maybe the
best place to ask questions regarding SQLite-
over VB6 is microsoft.public.vb.database.

Olaf

P.S. @Ralph - thanks for the "backup"
Bob Riemersma
2008-09-27 05:43:25 UTC
Permalink
Post by Sarah M. Weinberger
What is a good SQL database to use with VB6? My first thought was the
Microsoft Jet database (i.e. Microsoft Access by any other name) for use
with VB6, but Microsoft basically discontinued the line and it is not
exactly present with the Vista version of the ADO / Jet install. Without
tying itno a server, is there a nice stable, not shareware, SQL database
engine that VB6 users can tie into and/or distribute along with an
application.
Both ADO and Jet are part of Vista and Windows 2008 Server. ACE was
introduced with Access 2007 but should generally be avoided for the reasons
mentioned by others.
Sarah M. Weinberger
2008-09-27 05:55:34 UTC
Permalink
Hi Bob,

64-bit was / is an issue, and there were / are issues. I had to jump through
hoops to get my VB6 app working on Vista. In 1990 there were no databases
for Windows. In 2008, it seems that the same is true. They exist for
enterprise, but not at the shareware / commercial software level.

Sarah
Ralph
2008-09-27 13:48:10 UTC
Permalink
Post by Sarah M. Weinberger
Hi Bob,
64-bit was / is an issue, and there were / are issues. I had to jump through
hoops to get my VB6 app working on Vista. In 1990 there were no databases
for Windows. In 2008, it seems that the same is true. They exist for
enterprise, but not at the shareware / commercial software level.
Sarah
What's 64-bit O/Ss have to do with it?

As a programmer who was working with Windows in 1990 I am very surprised to
learn there were no shareware or commercial databases available for the
desktop. I seem to remember using about a dozen of them. But then, I abused
cola and pizza back then so my memory may be faulty. In fact I still use one
on occasion - but that may only be a horrid flashback.

You seem to be teetering on the brink of a serious rant. What's really going
on? You can tell us. We are all friends here. (with two exceptions <g>)

-ralph
mayayana
2008-09-27 15:00:20 UTC
Permalink
I've used .msi files. Windows Installer is partially
an SQL engine, .msi files are actually SQL-style
database files, and Windows Installer is installed
virtually everywhere.
But while an MSI file works fine, it is of course
a rather unorthodox method to use in shareware. :)

www.jsware.net/jsware/msicode.php5#zipf
Post by Sarah M. Weinberger
64-bit was / is an issue, and there were / are issues. I had to jump through
hoops to get my VB6 app working on Vista. In 1990 there were no databases
for Windows. In 2008, it seems that the same is true. They exist for
enterprise, but not at the shareware / commercial software level.
Sarah
Bob Riemersma
2008-09-27 20:16:04 UTC
Permalink
Post by Sarah M. Weinberger
Hi Bob,
64-bit was / is an issue, and there were / are issues. I had to jump
through hoops to get my VB6 app working on Vista. In 1990 there were no
databases for Windows. In 2008, it seems that the same is true. They exist
for enterprise, but not at the shareware / commercial software level.
Sarah
Well I'm confused, Sara.

I would think a VB6 application running on XP or Vista 64 would have to run
under WOW64 and thus would have no problem using the existing 32-bit Jet
Provider and Engine. Are you saying these are not even present in a Vista
64 installation?

I'd expect that using other compilers you'd have to be sure to target a
32-bit architecture in order to use Jet. VB6 is 32-bit only of course, so
it seems it shuld work fine.

But I don't have a 64-bit Windows installed right now so I can't test this
or even browse for the DLLs.
Bob Riemersma
2008-09-27 20:23:12 UTC
Permalink
My apologies for the typo in your name below. I know several Saras and
Sarahs and I know it can be a sensitive issue.

Bob
Post by Bob Riemersma
Well I'm confused, Sara.
Ralph
2008-09-28 01:53:43 UTC
Permalink
Post by Bob Riemersma
I'd expect that using other compilers you'd have to be sure to target a
32-bit architecture in order to use Jet. VB6 is 32-bit only of course, so
it seems it shuld work fine.
But I don't have a 64-bit Windows installed right now so I can't test this
or even browse for the DLLs.
On a 64-bit box, running a 32-bit app depending on 32-bit components is
essentially transparent to the user.
Bob Riemersma
2008-09-29 13:42:13 UTC
Permalink
Post by Ralph
On a 64-bit box, running a 32-bit app depending on 32-bit components is
essentially transparent to the user.
I agree this shouldn't be a problem. I was more concerned that maybe the
64-bit OSs didn't include 32-bit Jet, Jet OLE DB Provider, etc.
Ralph
2008-09-29 14:12:42 UTC
Permalink
Post by Bob Riemersma
Post by Ralph
On a 64-bit box, running a 32-bit app depending on 32-bit components is
essentially transparent to the user.
I agree this shouldn't be a problem. I was more concerned that maybe the
64-bit OSs didn't include 32-bit Jet, Jet OLE DB Provider, etc.
It do, in the sense that everything MS provides with 32-bit Vista you get
with 64-bit. This is generally true with most 3rd party components as well,
since MS requires that every 32-bit driver/etc submitted for certification
must also be accompanied by a 64-bit version and vice-versa. (However, there
are loop-holes and administrators can perform optional/custom installs to
reduce space.)

-ralph
Sarah M. Weinberger
2008-11-14 18:05:50 UTC
Permalink
Hi Bob,

I apologize for the delay, but I just read your postings. Things have been
hectic. Anyways, getting my VB6 application to read the Jet database was not
easy, as that component is not shipped. I forgot the exact steps that I
took. Basically, Microsoft stripped out the component from their ADO
distribution that enables VB6 to access the Microsoft Jet Database. Vista
does not provide that natively. VB6 is 32-bit, but runs under 64-bit. The
problem is that driver's have to exist in both.

The solution is to go away from ADO/Jet. I am pursuing SQLite with a VB6
wrapper. I had someone recommend me a wrapper, which I started to try, but
got on a different project.


Sarah
Ralph
2008-11-14 21:02:19 UTC
Permalink
Post by Sarah M. Weinberger
Hi Bob,
I apologize for the delay, but I just read your postings. Things have been
hectic. Anyways, getting my VB6 application to read the Jet database was not
easy, as that component is not shipped. I forgot the exact steps that I
took. Basically, Microsoft stripped out the component from their ADO
distribution that enables VB6 to access the Microsoft Jet Database. Vista
does not provide that natively. VB6 is 32-bit, but runs under 64-bit. The
problem is that driver's have to exist in both.
Most of that is a little off base, but I can understand your confusion.
(Aren't you the same person that stated there were no databases for PCs in
the 90's?)

1) MS removed Jet Providers from the MDAC years ago (As fully noted on their
download page). They supply separate O/S specific Jet Packages for obtaining
those components. Available for years. There is no problem accessing an
MSAccess Jet4 formatted database using ADO from VB6.
2) Vista doesn't use the MDAC. It comes with its own DAC.
3) While access to the new ACEDB format was slow in coming, you can now also
access it from VB6. Just as easily. If you installed MSAccess recently you
already have the necessary 'drivers'. If not they are easily downloaded.
4) VB6 produces 32-bit applications. There is no reason to have both 32-bit
and 64-bit 'drivers' for a VB6 application.
5) There is currently no 64-bit 'drivers' for 64-bit applications to use
Jet/ADO, and MS has strongly suggested there won't be any. However, they
said the same thing about providing 32-bit ADO providers for ACEDB. <g>
6) And if you did have a 64-bit Application that needed to access a Jet4
formatted database - there is no reason they would have to use the same
'bit-versioned' drivers, or for that matter, even the same data access
library. We have several 64-bit applications that are accessing legacy Jet4
databases and they work just fine.
Post by Sarah M. Weinberger
The solution is to go away from ADO/Jet. I am pursuing SQLite with a VB6
wrapper. I had someone recommend me a wrapper, which I started to try, but
got on a different project.
The only thing you said that makes a tad bit of sense, but not for any
reason you stated. (Are you perhaps dealing with a pointy-haired boss who is
insisting on using Jet/ADO, and you are trying to come up with reasons not
to?)

Jet is quite useful for the things it is useful for <g>. But it isn't for
everybody or for all situations. There are a dozen good reasons to not use a
Jet database and an equal number of good alternatives. SQLite is one of the
good ones.

Try Olaf's free COM-Wrapper at
www.datenhaus.de/Downloads/dhSQLite-Demo.zip

Olaf is a frequent visitor in this group and provides excellent support.

I have no idea if 64-bit support is available, or even if it is an issue.

-ralph
Schmidt
2008-11-15 01:24:03 UTC
Permalink
There are a dozen good reasons to not use a Jet database
and an equal number of good alternatives. SQLite is one
of the good ones.
Try Olaf's free COM-Wrapper at
www.datenhaus.de/Downloads/dhSQLite-Demo.zip
That was my initial wrapper-release - the new wrapper-
classes are hosted inside dhRichClient.dll - but wait
before any download-attempts - there's a new version
(3.0), coming out the next days - containing bug-fixes;
and the sqlite-engine which is used under the hood, is now
the newest one (3.6.5 - released on sqlite.org just a few
days ago).

Beside that, dhRichClient.dll contains many other
"VBRuntime-enhancements", e.g. beside the registry-free
instantiation-support for AX-Dlls and the SortedDictionary
now also a calling-compatible DropIn-Replacement for the VB-
Collection, which also works with the sorted Keys-approach
under the hood, but keeps the Item-AddOrder intact (Parameters
Before, After, etc can be used in the usual way) - enumeration,
respective iteration on this new container is then possible
in two ways: in Add-Order (which is the default) and also
in SortedKey-Order.

I will post an announcement to the group, when I'm ready
with the new release.
I have no idea if 64-bit support is available, or even if it is an issue.
The wrapper-AX-Dll is generated with the VB6-compiler and
therefore a 32Bit-Binary (now who'd have expected that) ;-)
The sqlite-engine from sqlite.org can be compiled for 64Bit-
environments, but for my wrapper I compile it to 32Bit too.

So I see not the slightest problem using all these 32Bit-Binaries
in Win64 (from inside the 32Bit WOW-layer each MS 64Bit-
system supports natively - and it does that also with regards
to fully transparent Calls into the FileSystem, which any DB-
Engine needs).


Olaf

Paul Clement
2008-09-30 21:11:50 UTC
Permalink
On Fri, 26 Sep 2008 18:06:40 -0700, "Sarah M. Weinberger" <***@hotmail.com> wrote:

¤ Hi All,
¤
¤ What is a good SQL database to use with VB6? My first thought was the
¤ Microsoft Jet database (i.e. Microsoft Access by any other name) for use
¤ with VB6, but Microsoft basically discontinued the line and it is not
¤ exactly present with the Vista version of the ADO / Jet install. Without
¤ tying itno a server, is there a nice stable, not shareware, SQL database
¤ engine that VB6 users can tie into and/or distribute along with an
¤ application.
¤

I believe that SQL Server CE has an OLEDB provider that you can use with VB 6.0.

http://www.microsoft.com/sql/editions/compact/default.mspx


Paul
~~~~
Microsoft MVP (Visual Basic)
Continue reading on narkive:
Loading...