Re: Best Way to Open Access Database from VB6

Tech-Archive recommends: Fix windows errors by optimizing your registry



Great.. thanks for the inputs.
I knew enough to stay away from ODBC... but I guess it is a difference
between ADO and DAO. Efficiency isn't as critical as the robustness so
based on averaging the comments... it looks like ADO/Jet is a reasonable
approach and probably the easiest to implement.

I'll follow the lnks provided and "edumacate" myself!

Thanks,
Brian


"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:7pudnXCQ1J0aPlLZnZ2dnUVZ_tidnZ2d@xxxxxxxxxxxxxxx

"Brian" <bkstigler@xxxxxxx> wrote in message
news:%23NYaSUZtGHA.4080@xxxxxxxxxxxxxxxxxxxxxxx
What is the most efficient (best) way to open an Access 2003 database
using
VB.

Should I use Jet4.0, Microsoft Access DB Driver, other? The database
isn't
big... maybe 20 tables and 500 to 1000 records in the main table.

The option must allow for connecting with a password. Also... is there a
good place to get info on the various connect strings used to create the
connection?

Just wondering as I see many variations on the web.

Thanks for the inputs...


In many cases using DAO and the native Jet Driver may be more "efficient"
especially for local databases, and infrequent sharing in a multiple
client/single server scenario. ADO/Jet OLE DB tends to be more robust
otherwise.

[As you can tell, comparing this comment with Paul's, opinions will vary.
It
is always best to just try both and see which works best for you.]

In any case avoid using ODBC, period!

Connecting to an Access file using the JET OLE DB Provider:
Using limited security:
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\\DatabasePath\\Database.mdb;" & _
"User Id=admin;Password=;"
Using a Workgroup (System database):
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\\DataBasePath\\database.mdb;" & _
"Jet OLEDB:System Database=MySystem.mdw;"
With password:
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\DataBasePath\database.mdb;" & _
"Jet OLEDB:Database Password=MyPassword;","admin", ""

An easy way to build and play with variations is to use a .UDL file and
dialog. (Windows Help::Topic:"Using Data Link"). You can build/select
options and test all in one place.

While there is an 'official' "Connection String" document somewhere. The
atributes and values are generally only meaningful to specific providers,
drivers, or scenarios. It can occasionally take a little digging to find
information on obscure key::value pairs, and then a bit more to determine
if
they have anything to do with versions or the problem domain you are
working
with. Best not to go there until you discover a need. <g>

This might be helpful...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/adoproperties.asp

-ralph






.



Relevant Pages

  • Re: Informix and ODBC
    ... sysdbopen allows you to execute sql when connecting to the db. ... Subject: Informix and ODBC ... Are you using the latest version of MSN Messenger? ...
    (comp.databases.informix)
  • Re: SQL Server 2005 Connection Only By ODBC
    ... that I would like to restrict it from connecting with SSMS only ... connecting with ODBC. ... user account was connection to SQL Server instance? ...
    (microsoft.public.sqlserver.security)
  • Re: MS Access and ODBC/OLE DB
    ... Generally speaking, Access uses ODBC when connecting from an .mdb, ADO ... when it executes is anyone's guess since it is compiled in the ... >If it uses OLE DB, is there a need to confure OLE DB? ...
    (microsoft.public.sqlserver.odbc)
  • Re: Intermittent SQLNET errors
    ... You mention App Servers, ODBC, SQLNET, BEQ. ... How precisely are the clients connecting? ... clients are either CFM or ASP pages that are connecting using Microsoft ... DB server uses dedicated server technology, ...
    (comp.databases.oracle.tools)
  • Re: date formatting in query string
    ... Is the field actually defined as Text or is it a Date/Time type? ... (ADO, DAO, RDO,...) ... Jet and I'm connecting through ...
    (microsoft.public.vb.general.discussion)