There is no following code.
First question, though: Do you have all the Service Packs to VB6? VB6 was
released with support for Jet 3.5x databases (the Jet that came with Access
97) , and later versions of Access use Jet 4.0, so there is some possibility
of incompatibility. This issue is addressed in Knowledge Base article
238401. It may, of course, not be the problem you have encountered.
As I recall, the VB6 documentation emphasized ActiveX Data Objects (ADO) for
I/O, and, in fact, led many to believe that Data Access Objects (DAO) was no
longer supported. In fact, DAO was still supported. The "classic ADO" used
in VB6 was another of Microsoft's "dead ends" in "access methods of choice
for the foreseeable future" -- it has already, long since, been superceded
by ADO.NET which it built on a different object model. In new releases of
Microsoft Products, "Classic ADO" is now supported in only in new releases
in Office.
Far more _Access_ developers use DAO than ADO.
And, a VB newsgroup -- one of the microsoft.public... newsgroups available
at news.microsoft.com or comp.lang.basic.visual.misc in USENET -- would be a
better place to discuss using Jet databases with VB than this one. Although
even Microsoft does not always observe the distinction, Access is a UI and
development tool that installs Jet by default, but can be used with any ODBC
compliant database, or any that has an ADODB provider. But, it is easy to be
misled by the documentation which refers to Access databases when it means
Jet databases.
Larry Linson
Microsoft Access MVP
"Database Newbie" <fixer@yahoo.,com> wrote in message
news:fc********************************@4ax.com...
I am trying to do my first database app in VB. I am using the
following code from Mastering Visual Basic 6.
When I start the project, the common dialog to open the database comes
up and I select the Northwind database. If I insert a test line of
code, the app will print the name and location of the database in one
of the text areas.
However, the app will work no further than that. If I try to access
the database name as DB.Name I get an error so apparently the database
has not been opened.
Can anyone point out what is wrong with the code? It is straight from
the disk that came with the book?
Thanks,
Bill.