Visual Basic Projects

I have put together these pages as a result of answering questions on the Forums at Visual Basic Explorer and VBForums, where a great many posts are made about the problems with when to use DAO or ADO, How to do XYZ to a database, etc. The greater part is concerned with the comparison of DAO and ADO, with a bit extra thrown in on the subject of DDE (Dynamic Data Exchange).

DDE (Dynamic Data Exchange) And Network DDE

Downloads for updating Data Access:

VB6 Service Pack 5

MDAC 2.7 And Jet 4 Service Pack 3


Just Starting Out With Databases?

Simple Database For Beginners Using DAO or ADO/ADOX Code

For beginners finding out about using code intead of Data Controls, a simple project using Code (Both DAO and ADO/ADOX) only instead of Data controls Try this Sample Database Note if you get an error "Can't find Installable ISAM" when using the DAO version of this project, upgrade your VB6 to SP4 or SP5. See Microsoft Knowledge Base for details. Also change the .Connect property of the Data Control to "Access" instead of "Access 2000"

Simple Replicated Access Database For Beginners
Using Both DAO AND ADO/ADOX/JRO Code

An extension to the Sample Database, using Access Design Master and Replicas, with both DAO and DAO/ADOX/JRO code, Code Pages and Download.

Find And Open Any .MDB Database To See Its Tables and Fields

This project uses only the controls found on the standard VB Toolbox, and references to the ADO and ADOX libraries. It shows how to combine and use the Drive, Dir and File Listboxes to locate a file, then open the selected database and display a list of the tables it contains. A different approach than the Sample Database above, but useful, and with minimal code. Code Pages and Download.


**NEW** Orders Project

This project was written in response to a post on the VBExplorer Data Access Forum asking about a simple database for creating a store allowing users to log in to the store and create an order.(Probably a student assignment). It uses ADO and ADOX code only so is NOT Suitable for use with Access 97 format databases.(The .Seek method does not function in ADO with 97). It demonstrates the following features:

- Public database variables declared in a code module for use in the whole project.
- Use of Sub Main instead of a start-up form whent the project is started
- Database creation using ADOX code:
- - AllowZero Length fields
- - Autonumber fields
- - Primary Key Index
- Login form with use of password characters in textbox, Adding new users.
- Use of a Flexgrid with floating editing textbox to alter the unbound grid cell contents and write the changes directly to the database.

Orders Project


Passwords And Access

These pages and the downloadable project show how you can:

  1. Create a new database with DAO or ADOX with a password included
  2. Open a database with DAO or ADO code that is password protected
  3. Change the password, add a password to an existing database, or remove a password using DAO or ADO
  4. Open a password protected database with a DAO Data Control and change the password if required
  5. Open a password protected database with ADODC

  Passwords And Access


Manipulating Tables

Demo for manipulating tables using DAO or ADO/ADOX

DAO vs. ADO

I have included the DAO vs ADO database project and listings on the DAO vs ADO code pages to explain how each process works.

Completed project available for download (VB6 SP5) Here or VB5 SP3 Here.

You will need MDAC 2.7 and latest Jet 4.0 Drivers from Microsoft. Here

This project compares the time taken and the methods used to carry out the following operations on Access 97/2000 databases using both DAO and ADO:

Create a database from scratch using code.
Copy a database with the option or converting a 97 version to 2000
Copy a replica / Design master database and remove replication fields and tables
Compact and repair
Turn a database into a Design Master and create a replica
Create a replica from an existing replica set
Synchronise any two members of a replica set
Show the structure of a database Tables, Fields and Indexes
Add a table to an existing database
Use the .Seek method to locate a record in the fastest possible time

Children's Game Launcher *NEW*

Download and description of project including source code here.

Features:

This application was designed for pre-school children who are able to control a mouse and play simple games / use child-friendly websites, but cannot read or write.

Takes advantage of Virtual CD Drives and Virtual CD images to launch their favourite games without the danger of damaging the original CD disk, and with the speed of a HDD drive.

Once installed and the applications added to it by a parent or older child, all they have to do is click on the image of their favourite game and it starts automatically.

Up to nine images per tab, and between 6 and 15 tabs (depending on use of images/text) giving a total of up to 135 applications/websites can be launched.

Uses Access 2000 database to store settings, applications, and image paths


Peer To Peer Chat using Catalyst Socket Wrench Control (Freeware)

If you have used winsock controls to make a chat application over a LAN, and have looked at the examples on MSDN, you will know that the normal way of setting it up is to have a Server, and a number of clients, using the TCP connection protocol.

As part of a project I am working on to remotely control database synchronisation over a LAN, I needed a peer to peer type of chat program. I use a third party control called Winpop at the moment, but its author and his website have disappeared, so I could not use this control for the demonstration applications.

I have managed to run a test application that uses Catalyst SocketWrench Control, and the app is BOTH Server and Client, so you run the same app on as many computers on the network as you like. When started, it enumerates all the machines currently connected, and creates a control array of sockets, text boxes and command buttons, one for each computer. A timer tries to connect every 15 seconds, and when successful, the Send command button becomes active for that computer.
You can then send messages directly to whoever you like, without having to route each message through a central server.

The cEnumNetwork Class was downloaded from PlanetSourceCode consisting of API network routines. The rest of the project is original. WARNING You must download and install the Catalyst control before tring to use the project, otherwise errors during loading will occur.

It is Infinitely better than the MS Winsock control and it is FREE!

Check it Out


Storing Images In Access Databases

Use DAO Code / DAO Data Control or ADO Code / ADODC to store images in an Access Database

Code Pages and Download


Any suggestions, comments, error reports mail me gab[AT]gab2001uk[DOT]com (Substitute the [AT] and [DOT] with correct symbols. Fuck you spammers)