Re: Best Way to Open Access Database from VB6
- From: "Brian" <bkstigler@xxxxxxx>
- Date: Tue, 1 Aug 2006 12:45:19 -0700
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 databaseusing
VB.isn't
Should I use Jet4.0, Microsoft Access DB Driver, other? The database
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
.
- References:
- Best Way to Open Access Database from VB6
- From: Brian
- Re: Best Way to Open Access Database from VB6
- From: Ralph
- Best Way to Open Access Database from VB6
- Prev by Date: Re: Invalid use of Null
- Next by Date: Re: Invalid use of Null
- Previous by thread: Re: Best Way to Open Access Database from VB6
- Next by thread: Invalid use of Null
- Index(es):
Relevant Pages
|