Re: Module / Class to access database

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Weavedev" <Weavedev@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5D9B6A85-3093-4610-A5A0-702D0153C5FE@xxxxxxxxxxxxxxxx
> Well, in reply to both of you' I would actually like to do this using a
code
> only method. Rather than using ADO and DAO components. Neither the
> DataEnvironment.
>
> Thanks
>
>
> "Veign" wrote:
>
> >
> > "Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
> > news:ZZOdnUTFVqB6hLXeRVn-jg@xxxxxxxxxxxxxxx
> > >
> > > "Weavedev" <Weavedev@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:63B68E4E-A5A4-4887-9C4E-E74DCD334892@xxxxxxxxxxxxxxxx
> > > > Hi
> > > >
> > > > I'm doing an application with VB 6. Need to create a module or a
class
> > to
> > > > access the MS Access database that I'm using. So that I can use the
> > > methods
> > > > in that class to access and manipulate the database.
> > > >
> > > > Please let me know of any material which may help me to get this
done.
> > > >
> > > > Thanks
> > >
> > > You probably need to be a little clearer on what you want. Both the
DAO
> > and
> > > ADO data object libraries do exactly what you are requesting.
> > >
> > > The DataEnvironment is class built ontop of ADO (kind of a ADO-Lite)
that
> > > may also be appropriate.
> >
> > I would stay away from the DataEnvironment as it has limitations and
just
> > adds several dependencies to the application. I would recommend
learning
> > the code-only way so the OP doesn't fall into the trap of using the
> > DataEnvironment.
> >
> > Just my .02
> >
> > >
> > > hth
> > > -ralph
> > >
> > >
> >
> > --
> > Chris Hanscom - Microsoft MVP (VB)
> > Veign's Resource Center
> > http://www.veign.com/vrc_main.asp
> > --
> >
> >
> >

Well, I won't say it is impossible just d**n inconvenient to do so. If you
were using C/C++ you could talk directly to the Jet engine, but why?

As you said in your OP, "[I] Need to create a module or a class to access
the MS Access database". That is exactly what the DAO and ADO data 'access'
libraries provide. The alternative is to use MSAccess automation, but even
then you will likely be using one or the other object libraries.

Several years ago I was involved with a project to 'speed' up a client
server application, by converting to whole suite to C++ and using OLE DB
directly. The app did turn out marginally 10-15% faster, but almost all of
that came from being written in C++. When it came down to our nifty OLE DB
routines - they weren't much faster and in many cases slower, until we
stubbled on some optimizations that were already in use in the published ADO
libraries. Wire wait time was the same, file i/o was the same, we
accomplished little but getting paid to find out that overall it wasn't
worth getting paid to do it. <g>

There were a few exceptions for some processes. And we did learn where to
apply OLE DB and where not to bother. But I walked away with the general
feeling unless you had a major business reason to go there, don't.

That is just a long-winded way of saying, don't go off and pre-optimize, use
the simplest tools available. If something turns out to be a problem then
address it.

For best access to MSAccess use DAO.

-ralph


.



Relevant Pages

  • Re: access 2003
    ... As you have code in your database that would only run using DAO, ... As you may know, if you have references to both ADO and DAO, then some ... object libraries both contain a Recordset object. ... The question is, if you have references to both ADO and DAO, which recordset ...
    (microsoft.public.access.conversion)
  • Re: Favorisierter Zugriff auf Access DB
    ... > Wenn du schon mit DAO gearbeitet hast sollte dir die Umstellung auf ADO ... ähm bei welchem Typ muss ich mich mit den Variant Typen herumschlagen? ... OLE oder? ... Ich nehme an, den Klassenassi zum Erstellen von "RecordSet" Klassen (wie bei ODBC, DAO) kann ich nicht nutzen. ...
    (microsoft.public.de.vc)
  • Re: Connecting to SQL Server 2005
    ... DAO? ... ADO? ... OLE? ... code - this sort of topic is the subject of books, ...
    (microsoft.public.vb.database)
  • Re: Word Form Fields - Can you Export to Excel Spreadsheet?
    ... supply an "OLE DB provider". ... The other possibility is a DAO connection. ... with Excel than ADO, IMO. ...
    (microsoft.public.word.docmanagement)
  • Microsoft database technologies
    ... And what are all the DB programming paradigms available? ... Like DAO, ADO and OLE DB. ...
    (microsoft.public.data.oledb)