Link to home
Start Free TrialLog in
Avatar of halfondj
halfondj

asked on

Using MS Access database in VB6 application

I need to access a MS Access 2000 database via my VB6 application and would like to know the best way of doing this.

1) Should I keep the database connection open throughout the lifetime of the application or is it best to open it when I access it?

2) What error handling should I implement, e.g. rollback?

3) I want to use the Jet 4.0 driver, what should I look out for, if anything, when installing my application on clients' PCs, e.g. OS versions, driver versions, etc.?

4) There are quite a few parameters on when opening a connection.  My database access is very simple, how should I implement the connection string?

5) Are there any good sample VB6 applications that access/write to/read from a MS Access database?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of UncleMidriff
UncleMidriff

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you will workd withe different client OS's then I do not  recoomend package and deployment wizard .( lots of compatibalitiy headaches)


Get the Free Inno setup http://www.jrsoftware.org/isinfo.php, it is a far more stable setup uitlity and works much
better (less buggy) agiants dieffernt os's.

Avatar of halfondj
halfondj

ASKER

To Uncle UncleMidriff:  Thanks for the link to the sample.  In the remarks, it says to add the ADO control, then to delete it.  Why does it have to be deleted?

To  unknown_routine:  I agree with you.  We are already using InnoSetup and it's great.

Thanks to both replies.  They were extremely helpful and I did find some good examples using Google.

I'm going to split the points :).
Thanks halfondj, glad to help.

And thank you, unknown_routine, for correcting some of the things I said; I always like being less wrong and more informed.
Whoops...I forgot to answer your question.

I don't really know why it says to add a control and delete it.  I just created a new project, added a reference to "Microsoft Activex Data Objects 2.7 library" and I was able to use intellisense with ADO objects just fine.  If that won't work, you might try the adding and then deleted thing, but it doesn't make a whole lot of sense to me.
I know, it doesn't make sense, but I wanted to ask the experts :).  I'll have to try it.

Thanks again.
heh...me, an expert.  Fancy that.
Hi,

write has obviously little knowlege of ADO.



to work with the database (access or oracle or ...) you need a reference to ADO object.



You have 2 options:

1: go to project refernces and add microsoft activex data object

This is a clean good way to go.


2: goto project COMPONENTS then add Microsoft ActiveX ADO control ( this will created the reference mentioned in step 1)

and delete it( even when you delete the control the reference to activeX data objects mentioned in option 1 remains.)

it say delete it because  you do not need the actual control you only need the reference.


go for option 1. why go with the long way?