vb6 ms-access 2003 design phonebook 2

MS-Access 2003 Database design

vb6-ms-access-2003-project
vb6 MS Access 2003 Database Design for Phonebook project

In this part of the tutorial we will design the database according to the VB6.0 Project Requirements, we have 3 TextBoxes and 1 Image control, so we will need 4 fields in the database table. We will create only one table because there is no need to create two, just simply like that.

Note, there are several ways to store data from Visual Basic windows application project on the hard drive, using MS-Access 2003 is one of the easiest ways to accomplish this task, considering your are creating a personal windows desktop application, also it is a very handy and effective method considering creating this application for some else (client).

If you don't have Microsoft Access 2003, then download it included in MS Office 2003 package from Microsoft. Access 2003 Database is the most well known database ever used with Microsoft Visual Basic 6.

Microsoft Access 2003 (*.mdb) file capacity is 2GB, of course this is nothing in comparison MS Sql Server, however, MS Access 2003 is better in case of running locally (on the same machine) while MS Sql Server is better to work on multiple machines at the same time (Networking).

In our VB6.0 example (Phone-Book), in order to design the perfect MS Access 2003 database you need to know what do you want to store and what do you want to retrieve and what is ability of the database you have (MS-Access 2003) that runs on your machine (i.e. WinXp, Win7, Win8 or Win10).

Our example is small, so, special requirements are not considered, so I choosing MS-Access 2003 as a database with VB6 to create a desktop application on MS-WinXp is a perfect choice.

Navigate to your main folder then using the mouse right-click choose from new (Microsoft Office Access Application) as shown in .......... shape (1)

      Shape (1)
      Using MS-Access 2003 in VB6 Project

  • Rename the files from (New Microsoft Office Access Application) to (MyBook), open [MyBook].
    1. MS-Access2003 in VB6
      vb6 Phonebook Database Design
  • Create new table like this, and name the new table as (Phones). Save the table.
      New MS-Access 2003 Table
      vb6 phonebook Database Design

Open our VB6 Project, navigate to (Project) then (References) then from the list, choose (Microsoft ActiveX Data Object 2.8 Library or ADO 2.8 Library) as shown in the following photo.


Insert photo into access 2003 from VB6
vb6 Ado 2.8 MS Access 2003

Why ADO 2.8 Library ?

ADO 2.8 was included in Windows XP and Windows Server 2003, as part of the Microsoft Data Access Components (MDAC) 2.8. A redistributable version of MDAC 2.8 is also available; note that this redistributable version should only be installed on Windows 2000. ADO 2.8 addresses several security-related concerns:
Hard drive access is not allowed outside a trusted zone.
    In cross-domain scripting involving non trusted sites, the following operations are disabled: Stream.SaveToFile, Stream.LoadFromFile, Recordset.Save, and Recordset.Open, used in conjunction with the adCmdFile flag or with the Microsoft OLEDB Persistence Provider (MSPersist).
    Recordset.Open , Recordset.Save , Stream.SaveToFile , and Stream.LoadFromFile operate on physical files only. These methods now verify that file handles point to physical files only.
    Source : Microsoft
Now we have finished designing the Database according to the logic of saving and retrieving data into/from our Phone-Book project. The Ole Object will be used to store the Picture of the friend which will be loaded in the Image (Timg) control placed on the (MainFrm) form.
 Visual Basic 6.0 Course Online : 

Comments

VB6 Popular Posts

Visual Basic Online Course - Excel 2003 Part 1

VB 6.0 Crystal Report With MS-Access 2003 - PassWord Problem

Visual Basic Online Course - Analog Clock in VB6