P. 1
Visual Basic 6 Projects Tutorial With Source Code

Visual Basic 6 Projects Tutorial With Source Code

|Views: 2,161|Likes:
Published by mepcoman

More info:

Published by: mepcoman on Feb 22, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/02/2013

pdf

text

original

PD

F -X C h a n ge

O W !

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
.c

O W !
w
.d o

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

w

o

.d o

c u -tr a c k

c u -tr a c k

.c

Tutorials

Next

Welcome! Visual Basic 6.0 programming for beginners!
Class for: Tuesday, January 05, 2010
Today we will start our study of Mic rosoft Visual Basic projec ts through a number of sample assignments and described sourc e c ode to master the fine points of using the VB language in a commercial environment ...

Visitors from all over the world!

¡Bienvenido! Bienvenue! Willkommen! Howdy, Mate! First of all, let me say Hello! to my many, many, loyal students particularly in India, the Philippines and Malaysia. Over the years you have proven to be among the best consumers or my VB tutorials and
http://www.profsr.com/vb/vbintro.htm… 1/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

w

.d o

c u -tr a c k

.c

I appreciate it. My statistic s tell me that on the other side of the world from here (here being Canada) students and programmers in tec hnic al colleges and software training centres are studying my courses and that makes me glad. I'll really try to do as muc h as I can for you. Now, I just want to apologize that the tone of most of the referenc es and lessons is so NorthAmerican. I would love to give you examples, samples and situations based on your c ultural norms but the truth is that I don't know enough about them, yet. For example, I have absolutely no idea how a cric ket game is

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
w
.d o

O W !
c u -tr a c k
.c

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

http://www.profsr.com/vb/vbintro.htm…

2/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

played!
m
C lic k

N

y

bu

to

C

lic

k

to

bu

y

N
w
.d o

O W !
c u -tr a c k
.c

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

w

.d o

c u -tr a c k

.c

In my defense, pic ture to yourself, if you c an, that as I write this I see outside my window that there is a metre of fresh snow on the ground and the temperature is a windy 12o C. The only subjec t of discussion by sports fans is yesterday's hockey game (ic e hoc key, that is).

o

However, as a French-Canadian I do have a few things in c ommon with you in that I am not an American either and I too have to get by with English as a sec ond language. If you have suggestions that would make the tutorials more interesting, please do not hesitate to pass them along.

About the Visual Basic 6 tutorial
What kind of programming projec t do you have in mind? Do you intend to launch a million-dollar business on the Internet? Maybe just a simple dating service?
http://www.profsr.com/vb/vbintro.htm… 3/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

N

y

bu

w

.d o

c u -tr a c k

.c

Or do you just want to get your hands on that college degree and then head-out into the urban jungle? I'll tell you a secret - in all those c ases, computer programming skills will really help! You don't really have to be a geek to be in computers. But since you're here and reading this, I guess you know that already. Whether you're a beginner at the programming game or a programmer who as some experience with other languages, you'll find that Visual Basic 6 is just about the best way to start getting the right training with the objec ts approach to programming. Want to try the great Linux OS without risk? There's a small distribution that will run from within Windows - you c an explore as much as you want. Visit Linux4Windows for the free tutorials, downloads and articles. Mic rosoft boasts that there are 3.2 million users of Visual Basic 6 in the world. Sometimes it seems that at least half of them have written a book, a magazine or a tutorial on the subject. The amount of information available is overwhelming. The problem is that everything

to

k

lic

C

m

C

lic

k

to

bu

y

N
w

O W !
.d o

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

c u -tr a c k

.c

http://www.profsr.com/vb/vbintro.htm…

4/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

w

.d o

c u -tr a c k

.c

you need to know is there, somewhere, but when you're just a beginner you can't even know where to begin to look. So, why another tutorial?

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
w
.d o

O W !
c u -tr a c k
.c

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

Well, this Visual Basic tutorial is different. For one thing it's meant for the real beginner - the one who doesn't know his Form from a hole in the ground. It c overs all the basic s to get you programming a real applic ation and sets you on the road to bigger and better things. And it has lots of easy to follow examples, sample projec ts and Visual Basic 6 source c ode that you can evaluate and adapt to your own needs. Also, it's organized like a textbook, not a reference manual. You do not have to know what you're looking for in order to find it. If you follow the lessons, in order, you go through all the fundamentals required to start produc ing real c ode. For game programmers ... If you're into games development, in Visual Basic , C# or any other language, here's a new site that's very promising. The site is not fully developed yet but it will soon have a lot of resources for the game programmers c ommunity. Check it out at: Game developers' Web.

Top

About VISUAL BASIC 6
Visual Basic 6 is not your grandfather's BASIC! If your knowledge of programming is limited to the QBASIC you toyed with in high sc hool, you'll think you've landed on a different planet. You may still see the oc casional GoTo hanging around but, for the most part you will be in unfamiliar territory. For one thing, the word Basic in Visual Basic is not an ac ronym anymore. It used to be. When the language was invented in the early 70's, BASIC stood for Beginners' All-purpose Symbolic Instruc tion Code, thus the acronym (word formed from the first letter of several words, in upper-c ase). It is c ertainly not just
http://www.profsr.com/vb/vbintro.htm… 5/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

w

.d o

c u -tr a c k

.c

for beginners, and although it is quite versatile, I don't know if I'd call it exac tly All-purpose. And while it is still Instruction Code, it is more than Symbolic now. But THE big differenc e is the Visual aspec t of it where you work with windows and ic ons and pic tures and multimedia. It really is a lot of fun! Before you start developing a Visual Basic 6 applic ation you should be aware that some programming knowledge is useful. If you have used BASIC or Pascal or C before you got here, that's OK. If you did learn one of those languages, you were working in a procedural fashion: when you type RUN the program starts at the beginning and basically follows the instruc tions going down the list, skipping here and there acc ording to c ontrol instruc tions until it finds some kind of END statement. That is not how Visual Basic operates. Rather than proc edural it is event-driven. There will be more on that subject in the next lesson. However, you do have to write Visual basic 6 c ode to program

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
w
.d o

O W !
c u -tr a c k
.c

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

There's money to be made with this! If you're developing VB applic ations, there may be a big market for them. There are all kinds of ways to sell your knowledge on the Internet. Why don't you take a look at our free Internet marketing course. Even if it's just for a hobby, you'll be amazed at what you
6/11

http://www.profsr.com/vb/vbintro.htm…

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

w

.d o

c u -tr a c k

.c

the events there are loops and c onditions and arrays. We will not be c overing the fundamentals of programming as suc h you should be familiar with the basic c onstructs suc h as the IF...THEN...ELSE or the FOR...NEXT statements.

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
w
.d o

O W !
c u -tr a c k
.c

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

at what you didn't know you c ould do!

o

Top

About Visual Basic versions
You may be aware that there are several dialects of the Visual Basic language in use. This tutorial is on standard Visual Basic . It uses the VB IDE (Integrated Development Environment) to let you c reate standalone Visual Basic applic ations that c an be distributed as .EXE files. Visual Basic for Applications (VBA) is the language used to tie Mic rosoft Offic e products together. It links Word and Excel applications, for example. Although it is very similar to standard VB, it does have several partic ular tec hniques that must be learned on their own. VBScript is a small subset of Visual Basic, with limited instruc tions, mostly used in Internet applications. As for version, this tutorial is based upon Visual Basic 6.0. You may have ac cess to version 4 or 5 in your environment. Don't worry about it. Of c ourse Mr. Gates would like us to rush out to the store and buy the latest release as soon as it hits the shelves but we are not all as, shall we say, fortunate, as Mr. Gates when it c omes to spending money. Right now, when a new version is announced, most of the improvements cover Internet acc ess or Class libraries, etc. At this level of training, we will not be using most of those fac ilities and so, one version is just about as good as another. A form is a form and a button is a button. There may be slight differences in the interfac e between versions but those will not matter muc h. The only problems oc c ur when you try to run an applic ation on a lower version of the software. It normally doesn't work. But the hardest part of creating an applic ation is usually in writing the c ode. Some sc ripts c an run into the 100's of line. Fortunately the script is just text and you c an work around the version problem with Cut and Paste operations. You will have to
http://www.profsr.com/vb/vbintro.htm… 7/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

w

.d o

c u -tr a c k

.c

redraw the forms, buttons and so on but, that is a minor inc onvenienc e when you can paste in the c ode for all those objec ts. In order to be as acc essible as possible, the code downloads at the end of the tutorial will all be in the form of text files that can be pasted into any version of VB. Visual Basic .NET is now available. Although very similar in most ways to Visual Basic 6, Visual Basic .NET does have signific ant differences in its approac h. For one thing, VB .NET is now completely objec t-oriented, whic h isn't the case with Visual Basic 6. An applic ation that runs well in VB 6 will have to be converted, using a conversion wizard to run on VB .NET. Mic rosoft tell us that the c onversion wizard will convert 95% of the code (an optimistic estimate?). Regardless, that leaves at least 5% that will have to be converted manually. That means that a lot of people will wait to see further improvements before jumping to the new version. And add to that the fac t that Visual Studio .NET, the parent framework for VB has a huge infrastruc ture. It requires lots of system resourc es. For example, you need at least 128 meg of RAM. Exc use me! When I look at the real world I see thousands upon thousands of perfec tly good computers with less than 128 meg of memory. Before too long we'll be doing a tutorial on "Converting Visual Basic 6 to Visual Basic .NET" and eventually we will c onvert this tutorial to VB .NET also. Here's your lead to a great new Visual Basic training site! If you need more information and examples of VB 6 in action, you might want to visit this site for Free VB 6 tutorials and sample source code samples.

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
w
.d o

O W !
c u -tr a c k
.c

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

However, if you are just getting into programming or into VB, the basic stuff doesn't c hange. You still need to know how to c reate a form, how to put c ontrols on a form, how to write a loop or a decision struc ture. That hasn't c hanged in ages and that you c an still learn with Visual Basic 6. I see installations out in the real world still doing tons of interesting work with versions 4 or 5 of Visual Basic ! All about food and wine ... If you're now ready to take a break, visit this great website devoted to wine and food. From a Web developer's viewpoint, one of the interesting aspects of the site is that it is developed entirely using PHP programming. For all kinds of useful info: The Ultimate fine wine and food pairing guide. Top
http://www.profsr.com/vb/vbintro.htm… 8/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

N

y

bu

to

k

lic

C

m

C

lic

k

to

bu

y

N
.c

O W !
w
.d o

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

w

o

.d o

c u -tr a c k

c u -tr a c k

.c

Visual Basic 6.0 Tutorial Content
Lesson 1 The Visual Basic 6 environment Defining terms Creating a Visual Basic Project Prac tice project - Building a Football Sc oreboard Lesson 1b Improving the VB applic ation Using a step-by-step approach Writing a VB procedure Calling procedures Lesson 2 Using the Visual Basic 6 c ode editor Adhering to programming standards Data types, variables and c onstants in Visual Basic Using operators Control struc tures - IF...THEN, Select Case, DO...LOOP, FOR...NEXT Prac tice assignment - Upgrading the Sc oreboard Lesson 3 Designing the Visual Basic Applic ation Working with users Guiding princ iples Choosing a Visual Basic interfac e style Lesson 4 Defining the Visual Basic Form Standard c ontrols: Pic ture, Frame, CommandButton, Label, TextBox, Chec kBox, etc . Visual Basic prac tic e assignment: Creating a Payroll Form Lesson 5 Arrays More c ontrols: ListBox, ComboBox Properties and Methods of objects in Visual Basic Building a file search application: DriveListBox, DirListBox, FileListBox Lesson 6
http://www.profsr.com/vb/vbintro.htm… 9/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

N

y

bu

w

.d o

c u -tr a c k

.c

Building a Menu Debugging Visual Basic code Error trapping Lesson 7 Manipulating text - string functions Visual Basic func tions for dates, numbers Using the Windows Clipboard and Screen objec ts Creating Copy, Paste, Cut, Delete functions Pictures, Graphics and Drawing c ontrols in Visual Basic Multimedia - inc orporating sounds and pic tures Building a CD player in c ode Lesson 8 Working with Visual Basic files Writing and reading a Sequential-acc ess file Sample projec t: the Address Book Creating a sequential output form Creating and using a Random-ac cess file Lesson 9 Creating a Mic rosoft Ac c ess database - refer to SQL tutorial The Projec t Management example The Data c ontrol Visual Basic Bound c ontrols - TextBox controls linked to database Validating data - ensuring database integrity Finding a spec ific rec ord in the database Lesson 10 Using multiple tables from the database Creating multiple data c ontrols Using Data Bound List Controls Using VISDATA - the Visual Basic Data Manager Lesson 11 Downloads - sample Visual Basic 6 c ode and database with new examples Lesson 12

to

k

lic

C

m

C

lic

k

to

bu

y

N
w

O W !
.d o

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

c u -tr a c k

.c

New sample application: Projec t management Visual Basic 6 ADO database programming with c onnec tion to MySQL database server.

http://www.profsr.com/vb/vbintro.htm…

10/11

o

m

w
w

w
w

PD

F -X C h a n ge

O W !

N

y

bu

to

k

lic

w

.d o

c u -tr a c k

.c

If you haven't found the Visual Basic resource you're looking for, use our Google Search box for more information.

C

m

C

lic

k

to

bu

y

N
w

O W !
.d o

1/5/2010

Visual Basic 6 Projects tutorial with sour…

PD

F -X C h a n ge

o

c u -tr a c k

.c

Search

Top

Home | Tutorials | Contact | Sitemap | Add URL | Privacy policy

http://www.profsr.com/vb/vbintro.htm…

11/11

o

m

w
w

w
w

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->