Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 62,273 times

Contents

Related Categories

DAO 3.6 Library - Getting Started

LouisRose

Getting Started

Right, first things first... to be able to use MS Access 2000, Visual Basic needs a way to communicate with it. This can be done in many ways, but as some of you may have guessed by looking at the title of this article, I'll be using DAO 3.6.

So for our code to work, we first need to start VB and add a reference to the DAO 3.6 Library. To do this, click Project and then References and browse for the library. It should be called "Microsoft DAO 3.6 Object Library" or similar. Check it and click Ok.

So what has this done? Basically, we can now define new types of variable, such as a database object. This allows Visual Basic to understand and manipulate the complex structures that Access uses to store our data.

At this point, it may be worth noting some things I always adhere to when using Access - first of all, whenever I make a table in Access, I always create a field which is used as a unique identifer for that record and I always call this field ID. This is usually known as the primary key. A lot of people select Access' special Autonumber field type for this field. Personally, I like to be in control of this field so I set it to a pure Number field type. All of my tables start with record number 1. This way I can count the number of records more easily. This may not suit some people, so you may need to alter the following code.

Everybody has their personal preferences, so set out your database however suits you. Just make sure you're consistent!

Comments

  • Re: [2527] DAO 3.6 Library

    Posted by BarbStewart on 12 Jun 2008

    I am working in VB6 with an Access db and would like to delete records from a join table. Can you help me? I have a table of Products, and table of Materials and a table to join the...

  • Re: [2527] DAO 3.6 Library

    Posted by faisalwadood on 20 Feb 2007

    hi sir!


    i hav read your article fully,i also read many articles on vb databases i understand it well yet i hav have a problem if you kindly help me.


    i want to develop a vb applicati...

  • Re: [2527] DAO 3.6 Library

    Posted by Nishantha on 13 Jul 2006


    Dear Sir,


    <...

  • Bad Type

    Posted by StevoMc on 14 Jul 2004

    This tutorial has been really good for helping me understand how to use access databases, which is really cool, but unfortunately I'm having a problem.

    When writing the code for moddefaultdatabase...

  • Posted by bruwmac on 22 Jun 2004

    What? Where the heck did that come from?

    :eek: :confused: :D