Visual Basic 6.0 Phone-Book Project
Microsoft Visual Basic 6.0 help and Tutorials
MS-Visual Basic 6.0 & MS-Access 2003 - Crystal Reports to create a desktop software professionally
Custom Search
(2) MS-Access 2003 Database design
      • In this part of the tutorial we will design the database according to the visual basic 6 project needs, 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-Access2003 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 effictive 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 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-Access2003) that runs on your machine (i.e. WinXp). 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.
    1. Navigate to your main folder then using the mouse right-click choose from new (Microsoft Office Access Application) as shown in .......... shape (1)
    2. Shape (1)
      Using MS-Access2003 in VB6 Project

    3. Re-name the files from (New Microsoft Office Access Application) to (MyBook), open [MyBook].
    4. MS-Access2003 in VB6

       

    5. Create new table like this, and name the new table as (Phones). Save the table.
    6. New MS-Access 2003 Table

       

    7. 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.
    8. Insert photo into access 2003 from VB6

       

    9. 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 nontrusted 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 OLE DB 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

    10. 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.

Part (3) - Visual Basic 6.0 codes for design

Thanx for reading, please feel free to leave a suggestion.

Labels :

Visual Basic, learning visual basic, visual basic training, visual basic for dummies, learn visual basic 2010, visual basic classes, visual basic coding, learn visual basic programming, learn visual basic online, visual basic programmer, visual basic help, help with visual basic, visual basic programming help, visual basic 2010 help, microsoft visual basic help, microsoft visual basic 6.0 help, vb programmers, Visual Basic 6.0, visual basic 6.0 software, visual basic 6.0 training, learn visual basic 6.0, ms visual basic 6.0, visual basic 6.0 pro, visual basic 6.0 learning edition, software of visual basic 6.0, how to learn visual basic 6.0, learning visual basic 6.0, visual basic 6.0 price.

Back
Free Web Hosting