Re: opening an Access 2000 DB using ODBC...

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

From: Ralph (msnews.20.nt_consulting32_at_spamgourmet.com)
Date: 11/27/04


Date: Sat, 27 Nov 2004 08:30:44 -0600


"Brad Pears" <donotreply@notreal.com> wrote in message
news:O6Sm0Zz0EHA.1260@TK2MSFTNGP12.phx.gbl...
> What exactly does "DSN-less" mean? Is that the opening of a DB within your
> app directly as opposed to referenceing the DSN of say an ODBC driver and
> hence incurring another layer to go through before actually accessing your
> data?
>
> Am I to assume that a DSN less connection would be way faster and hence a
> better way to go?
>
> Brad

The link I gave you explains the difference between DNS/DNS-less
connections. As far as speed goes, I think one could assume that a DNS-less
connection would be a little 'faster' since you are adding an extra file
I/O. But connections are always expensive in terms of time, so I doubt you
would notice much difference on a modern box.

As an aside: Database connectivity has been (and likely will be) a changing
technology. The reason there are so many options available is because while
new technology becomes available, many other modes are still supported to
maintain backward compatibility. Also, just like everything else in
programming, there are various trade-offs with each one. When investigating
each option you need to step back and take look at the broader picture.

For example, DSN files allows your app to not have to know much about 'how'
a connection is made. Only a file name or 'alias' is needed. This makes it
easier in some ways to write your app and distribute it about. You could
even define different DSNs with different providers and possibly different
databases for some boxes. For example, you might create one DSN that looks
at test data and another that connects to production. But as long as the app
just looks for "MyDSN" the code in the app never needs to change. All of
this was more important in the days of networks dependant on 'logical'
drives and different providers, &etc., than perhaps today - but it is still
something to consider.

ODBC is only one method of providing a middle-tier between the database
engine and the application. Appreciate that there is always several layers
between the runtime code of an application and the database. Depending on
where you want to draw the lines - the layers look something like this...
Database (files/struct/) -> Database Engine -> Engine API <- Middle
Adaptor -> Client API <- Runtime Code

In the case of MSAccess using ODBC/ADO you have something like this.
Database (files/struct) = .mdb files
Database Engine = Jet
Engine API = Jet ODBC drivers
Middle Adaptor = ODBC OLEDB
Client API = ADO (ActiveX Data Object Library)
Runtime = VB

When you use DAO you can 'skip' the middle adaptor
Database (files/struct) = mdb files
Database Engine = Jet
Engine API = ODBCDirect
Client API = DAO
Runtime = VB

So this is a long way of saying 'Yes', using DAO is more efficient.

hth
-ralph



Relevant Pages

  • Re: problems with DSN for MS Acess database
    ... >CRecordset derived classes. ... I moved the app on another PC without MS ... So I created System DSN ... >for MS Access Database by hand and my app was working OK. ...
    (comp.databases.ms-access)
  • problems with DSN for MS Acess database
    ... CRecordset derived classes. ... I moved the app on another PC without MS ... So I created System DSN ... for MS Access Database by hand and my app was working OK. ...
    (comp.databases.ms-access)
  • Re: opening an Access 2000 DB using ODBC...
    ... Is that the opening of a DB within your ... Am I to assume that a DSN less connection would be way faster and hence a ... >> connection because in the ODBC driver you can specify the system ... to answer you real question - To open a database using DAO and ...
    (microsoft.public.vb.database)
  • Re: Restricting ODBC access to SQL Server 2000 database
    ... Create an application role, and only give the app role access to the tables ... in the database. ... The user could still use Access, etc. to connect to the DSN, but they won't ... > Is there a way to restrict an ODBC connection to the ...
    (microsoft.public.sqlserver.odbc)
  • odbc error
    ... database I was able to connect to previously. ... which was configured using MS ODBC driver for Oracle ... and same dsn - I also have a fixed ip. ... different I see is the oracle client on my new machine is ...
    (microsoft.public.access.externaldata)