Use VB6 to connect to mdb file

P

Pete

Is there a vb6 newsgroup??

I wished to develop a vb6.0 app to connect to an access
db (.mdb file).
Could someone please give me an overview with the
following in mind:-
Can I install the Access driver onto a non-Access ready
PC and still connect to the mdb file (therefore negating
the need for an Access license)?
If so, which is the driver file and how is it installed
during installation (setup)?
I wish to use ADO to make the connection, so what will be
the additional files to install for this and the
connection string etc.

I realise this is not the place to raise the above, so if
someone would kindly answer either the above or direct me
to an appropriate site please.

If this query was previously answered, could you please
supply details to locate it.

Many thanks.
 
R

Ron Weiner

Pete you probably want to try microsoft.public.vb.database.ado for a VB
newsgroup that might be of more help. But from my understanding all you
will need is VB and ADO to be able to read and/or write data to/from a MDB
file. An Access license for each workstation should not be needed.

Good luck with your project.

Ron W
 
P

Pete

Hi Ron,

Many thanks for the reply.

Which files would be needed? Is ADO encompassed within
MDAC?
-----Original Message-----
Pete you probably want to try
microsoft.public.vb.database.ado for a VB
 
D

Douglas J. Steele

Actually, ADO alone isn't enough: newer versions of MDAC don't include the
Jet drivers, so you need to install the Jet Service Pack for it to work
(check http://msdn.microsoft.com/data/downloads/updates/default.aspx#jet )
However, if you're strictly going against a Jet database (i.e.: an MDB), DAO
is better than ADO.

In any case, no, you don't need any additional license, and yes, ADO is part
of MDAC.
 
P

Pete

Many thanks for the reply Doug,

A couple more questions if I may:-

Why the preference of DAO over ADO and is this part of
MDAC?
Also, must I always connect to tables only or can I
connect to a stored Access query e.g.Crosstab. If not,
how could you mimic a crosstab within vb6 (perhaps not
the place to raise this but if you can direct me to a
relevant site, I would appreciate it)?

Thanks.
-----Original Message-----
Actually, ADO alone isn't enough: newer versions of MDAC don't include the
Jet drivers, so you need to install the Jet Service Pack for it to work
(check
http://msdn.microsoft.com/data/downloads/updates/default.a
spx#jet )
 
D

Douglas J. Steele

DAO was designed specifically for Jet databases. With ADO, you're going
through additional levels of abstraction. As well, there are things that can
only be done with DAO, not ADO (check
http://www.trigeminal.com/usenet/usenet025.asp if you want more information
on what)

If you use DAO, you won't have to worry about MDAC at all. Installing the
Jet SP should be all you need to be able to set the reference to Microsoft
DAO 3.6 Object Library.

I've never tried using a cross-tab from VB, but I can't think of any idea
why it wouldn't work. A cross-tab is done through SQL.

A warning, though: you cannot include any functions in your SQL. When you're
attaching to a Jet database from outside of Access, you're strictly going
through the Jet engine, which doesn't know anything about user-defined
functions (and, in fact, doesn't know about many VBA functions)

Another thing. You didn't mention what version of Access you're planning on
connecting to, and what service pack of VB6 you're on. You may end up
needing the following:

PRB: Error "Unrecognized Database Format" When You Upgrade to Access 2000 or
2002:
http://support.microsoft.com/?id=238401
FIX: The Data Form Wizard May Not Open an Access 2000 Database:
http://support.microsoft.com/?id=242010
HOWTO: Modify the Visual Data Manager (VISDATA) to Work with Access 2000
Databases:
http://support.microsoft.com/?id=252438
FIX: Unrecognized Database Format Error with Data Control or Data Form
Wizard:
http://support.microsoft.com/?id=257780
 
D

david epsom dot com dot au

Also, must I always connect to tables only or can I
connect to a stored Access query e.g.Crosstab. If not,

The stored queries are in the same name space as the
tables. Just 'connect' to them the same way you 'connect'
to a table. You can't 'seek' on a query or open it
in dao.dbOpenTable mode at all, but otherwise it works
the same.

(david)
 
M

M.L. Sco Scofield

Unless there are VBA functions used in the query.

The Jet engine does not run VBA functions when the query is accessed outside
of Access.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Useful Metric Conversion #17 of 19: 1 billion billion picolos = 1 gigolo
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top