Programming language Visual Basic 6 (Chapter 13 - Database (Database))

Table, Record và Field

Speaking to the database, we immediately think of SQLServer, Access or Oracle. Etc., where contains a lot of data so that we can store or retrieve them conveniently and quickly. Most programs we write will have access to databases, and we use it as a tool to work with a lot of data while focusing on the programming interface to the user (users).

So we need a basic knowledge about the architecture of the database to understand the reasons why we design or access it in certain ways.

We will use biblio.mdb Access Database, located at C: Program FilesMicrosoft VisualStudioVB98 iblio.mdb to illustrate the concepts need to know about databases.
In this database has 4 tables: Authors (author), Publishers (publishers), Titles (section)vaTitle Author.


Programming language Visual Basic 6 (Chapter 12 - Using Graphics (Part III))

Graphics Methods

While Graphical Controls like Shape, Line gives us the design drawing at the  Graphics Methods  to draw these things at run-time. We can also put individual spots (pixels) or copy a Picture from one place to another.

Just a bit of experience you can do animation (animation) or create amazing visual effects without having to touch the  Windows API (Application Programming Interface)  to use the  BitBlt function .

Method PaintPicture

PaintPicture method  allows you to quickly copy a block of data graphics, literally, a region in a graphic image on a form, PictureBox, or Printer to another place. For example, you copy an image from one place to another in the form, or from form / PictureBox to the Printer Object for a while after you print it out.

Programming language Visual Basic 6 (Chapter 12 - Using Graphics (Part II))

Print screen

VB6 is our method for printing Print directly on the Form, PictureBox, or Printer. Threetypes of control is seen as the canvases that the artist painted.

Please start a new VB6 program. Set up a PictureBox named Picture1 and form a button with the name CmdPrintTenLines Caption  Print Ten Lines . DoubleClick on this button and write code below:

Private Sub CmdPrintTenLines_Click() 
   Dim i As Integer 
   ' String variable used for display
   Dim strLine As String 
   ' Write 10 lines, one under the other
   For i = 1 To 10 
      strLine = "This is line " & CStr(i) 
      Me.Print strLine  ' Print on Form
      Picture1.Print strLine  ' Print on Picture1
   Next 
End Sub 

Programming language Visual Basic 6 (Chapter 12 - Using Graphics (Part I))

English proverbs have a saying: "A picture is worth a thousand words (a picture is worth a thousand words)," mean when we use to describe the image will help viewers understand more quickly if we just say it. 


Visual Basic 6 can give us some means of graphics (graphics) to make up for the windows rich, friendly, easy to work with, and interesting. Whether that means the municipality is not fast enough for me to write game programs (games), but relatively well equipped to meet the common needs.

When it comes to graphics, we want to distinguish it from ordinary text. For example we use Notepad to edit a poem in a window. While the poem is being displayed can be changed easily by using the keyboard to type a new word to add, use the button  Delete ,  Backspace  for deleting text. That we did with  text .

Now, while still displaying the poem, we use a program such as Graphic  Capture PhotoImpact  by Ulead  to capture the image of the poem window (active window) look like a photo, then we have a Graphic . Then, to amend the poem from this graphic we have to use a graphic editor such as MSPaint, PaintShopPro . etc. The letters in the picture has the same graphic format as we see a photo, edit, and want to use a brush with paint.

Programming language Visual Basic 6 (Chapter 11 - Using the Dialogs dialog)

DIALOGS (COMMUNICATION DEVICE) IS USED TO DISPLAY INFORMATION AND RECEIVE INPUT FROM MOUSE OR KEYBOARD USERS DEPENDING ON THE SITUATION. THEY ARE USED TO FOCUS ATTENTION ON THE WORK OF CONTEMPORARY USERS OF THE PROGRAM SHOULD BE USEFUL IN OTHER WINDOWS PROGRAMS.


THERE ARE MANY TYPES OF DIALOGS, EACH APPLICABLE TO A PARTICULAR SITUATION. IN THIS CHAPTER WE WILL DISCUSS THE FOUR MAIN TYPES OF DIALOGS AND RESEARCH ON WHEN AND HOW WE USE THEM:

  1. Message Boxes
  2. Input Boxes
  3. Common Dialogs
  4. Custom Dialogs

Message Boxes

Message Boxes  are used to remind what a user, and requires a certain response from the user. For example when we terminate MSWord program without filing the MSWord will prompt you store it with the following Dialog:

Programming language Visual Basic 6 (Chapter 10 - Using the Menu)

Menu in Windows is where all the commands of a program arranged by type in order to make us easy.

There are two common types of menu is:  drop-down (drop down)  menu and  pop-up (up)  menu. We use drop-down menu to menu for main program. Usually it is located above the tip of the screen.Horizontally along the Menu Bar, if you click on a command in the Menu Bar, the program will drop down a menu MenuItems along with the vertical. If you click on any MENUITEM small triangle marked on the right, the program will popup a menu as shown in the picture below (when I click Format | Make Same Size ):
This image has been resized in order to avoid breaking the interface. Click here to view photo in full size (548x258)

Main Menu

Programming language Visual Basic 6 (Chapter IX - Debug (Debugging and error handling))

Bugs are the fault of the program which I discovered when running it. Debug is the work of all types of faults in the program so that it runs smoothly in all circumstances.

Usually want to fix a bug that we must find out why it occurs. Once you know the proper justification, then we'll figure out a solution. Generally, there are two kinds of bugs:
  1. Either the program does not do the right thing to do because the programmer misunderstood Specifications  or given false information or omitted information program is required. We resolve this case by reducing misunderstandings through upgrading communication capabilities.
  2. Program fails to comply programmer as you want. That is a decent programmer but want to do a self insurance program since unknowingly not write properly programmed. This case is solved by using the Software Tools (including programming languages) suitable, and have the system working.
In it, people use a car from  Quality Control  to say regardless of the car has no faults at all. To achieve that, not only need people that the quality control personnel carefully assembled to the main task of quality control is confirmed good results and not finding fault.