1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials...

17
1/26/2004 1/26/2004 PPCC - Introduction to PPCC - Introduction to VB6 VB6 Copyright ©2004, Tore Copyright ©2004, Tore Bostrup Bostrup 1 Introduction to VB6 Introduction to VB6 Materials & Prerequisites Materials & Prerequisites Course Outline Course Outline Background Information Background Information

Transcript of 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials...

Page 1: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright ©2004, Tore BostrupCopyright ©2004, Tore Bostrup 11

Introduction to VB6Introduction to VB6

Materials & PrerequisitesMaterials & Prerequisites

Course OutlineCourse Outline

Background InformationBackground Information

Page 2: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 22

Materials & PrerequisitesMaterials & Prerequisites

Book:Book: Sam’s Teach Yourself Visual Basic in 24 Sam’s Teach Yourself Visual Basic in 24

HoursHours By Greg Perry with Sanjaya HettihewaBy Greg Perry with Sanjaya Hettihewa ISBN 0-672-31533-5ISBN 0-672-31533-5 3 copies at Barnes & Noble (Harbison) on 3 copies at Barnes & Noble (Harbison) on

1/27/20041/27/2004

Page 3: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 33

Materials & PrerequisitesMaterials & Prerequisites

Software:Software: Visual Basic 6.0Visual Basic 6.0

A Working Model in included with the bookA Working Model in included with the book Course will target the VB 6 Professional EditionCourse will target the VB 6 Professional Edition Check with MS for free 90 day trial editionCheck with MS for free 90 day trial edition

Participant CDParticipant CD VB 6 Service Pack 5VB 6 Service Pack 5

http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.aspxhttp://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.aspx Microsoft Jet 4.0 Service Pack 8Microsoft Jet 4.0 Service Pack 8

http://www.microsoft.com/downloads/results.aspx?productID=3D99F106-AA6D-http://www.microsoft.com/downloads/results.aspx?productID=3D99F106-AA6D-4113-AE45-30B61394B1E0&freetext=&DisplayLang=en 4113-AE45-30B61394B1E0&freetext=&DisplayLang=en Get the one that matches your system!!!Get the one that matches your system!!!

Microsoft Data Access Components (MDAC) downloads can be found from:Microsoft Data Access Components (MDAC) downloads can be found from: http://msdn.microsoft.com/data/downloads/updates/default.http://msdn.microsoft.com/data/downloads/updates/default.aspxaspx

Microsoft Data Access Components (MDAC) 2.7 SP1 RefreshMicrosoft Data Access Components (MDAC) 2.7 SP1 Refresh http://www.microsoft.com/downloads/details.aspx?familyid=9ad000f2-cae7-493d-http://www.microsoft.com/downloads/details.aspx?familyid=9ad000f2-cae7-493d-

b0f3-ae36c570ade8&languageid=f49e8428-7071-4979-8a67-b0f3-ae36c570ade8&languageid=f49e8428-7071-4979-8a67-3cffcb0c2524&displaylang=en3cffcb0c2524&displaylang=en

MDAC Buffer Overrun Secrity Patch MS04-003MDAC Buffer Overrun Secrity Patch MS04-003 http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/

Bulletin/MS04-003.aspBulletin/MS04-003.asp

Page 4: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 44

Materials & PrerequisitesMaterials & Prerequisites

Software, Continued:Software, Continued: MSDN Library (October 2001 recommended)MSDN Library (October 2001 recommended)

This contains the latest Online help for VB6This contains the latest Online help for VB6 Included with VB6 Professional EditionIncluded with VB6 Professional Edition

Page 5: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 55

Materials & SoftwareMaterials & Software

Recommended – not required:Recommended – not required: MS Office Professional (Microsoft Access)MS Office Professional (Microsoft Access)

Version 2000, XP, or 2003 should be OKVersion 2000, XP, or 2003 should be OK Version 97 can be used, but beware of some minor Version 97 can be used, but beware of some minor

differences in project setup and files required.differences in project setup and files required. Icon EditorIcon Editor

If you want to create of customize icons for your If you want to create of customize icons for your applications. You can also use the icons included with VB applications. You can also use the icons included with VB or download icons from the web. Watch for copyrights, etc.or download icons from the web. Watch for copyrights, etc.

Graphics editorGraphics editor Any application to create and/or edit graphics (images) if Any application to create and/or edit graphics (images) if

you want to “spiff” up your apps. Again, VB and the web you want to “spiff” up your apps. Again, VB and the web are alternative sources.are alternative sources.

Page 6: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 66

Materials & SoftwareMaterials & Software

Bring (blank) Media for copying your Bring (blank) Media for copying your workwork Floppy DisksFloppy Disks USB drivesUSB drives

Watch for cheap keychain USB drives from local Watch for cheap keychain USB drives from local stores (OfficeMax have had them as low as $9.99 stores (OfficeMax have had them as low as $9.99 after rebates, I didn’t see any specials this after rebates, I didn’t see any specials this week).week).

NOT CD-R’sNOT CD-R’s The computers do not have CD burners.The computers do not have CD burners.

Page 7: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 77

Course Outline, Week 0Course Outline, Week 0

Background InformationBackground Information Computer Science BasicsComputer Science Basics

Binary NumbersBinary Numbers Data TypesData Types Instructions and DataInstructions and Data Compilers and InterpretersCompilers and Interpreters Variables and AssignmentsVariables and Assignments

Object Orientation BasicsObject Orientation Basics What is an objectWhat is an object Visual Basic built-in “Objects”Visual Basic built-in “Objects”

Windows Environment BasicsWindows Environment Basics Message-based and Event-Driven ArchitectureMessage-based and Event-Driven Architecture

The different VB’s (VB, VBA, VBScript)The different VB’s (VB, VBA, VBScript)

Page 8: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 88

Course Outline, Week 1Course Outline, Week 1

Getting Started with VB6Getting Started with VB6 Installation & Setup of VB6 for Installation & Setup of VB6 for

developmentdevelopment Launching VB6Launching VB6 VB6 SettingsVB6 Settings The VB6 IDEThe VB6 IDE

Page 9: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 99

Course Outline, Week 1Course Outline, Week 1

Your first app (Hello World)Your first app (Hello World) Running the applicationRunning the application

Calculating an approximation of PICalculating an approximation of PI Very simple – use 22/7, but use controls Very simple – use 22/7, but use controls

for input/outputfor input/output Designing a user interfaceDesigning a user interface

Page 10: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1010

Course Outline , Week 1Course Outline , Week 1

Adding code to your applicationAdding code to your application Visual Basic StatementsVisual Basic Statements

Simple Variable and Constant DeclarationsSimple Variable and Constant Declarations Assignment Statements and ExpressionsAssignment Statements and Expressions If … Then … Else … End IfIf … Then … Else … End If

Accessing controls on the formAccessing controls on the form Control Properties, Methods, and EventsControl Properties, Methods, and Events

Simple controls:Simple controls: TextBox, Label, CommandButton, TimerTextBox, Label, CommandButton, Timer ListBox and ComboBoxListBox and ComboBox File, Directory, and Drive – example of control File, Directory, and Drive – example of control

interactioninteraction

Page 11: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1111

Course Outline, Week 2Course Outline, Week 2

LoopsLoops Select CaseSelect Case Operator PrecedenceOperator Precedence ArraysArrays Data Type ConversionData Type Conversion Variable Naming ConventionsVariable Naming Conventions Object Reference VariablesObject Reference Variables Object InstantiationObject Instantiation String ManipulationString Manipulation More controls (Option Button, CheckBox, Frame)More controls (Option Button, CheckBox, Frame) Control ArraysControl Arrays

Page 12: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1212

Course Outline, Week 3Course Outline, Week 3

DebuggingDebugging Error HandlingError Handling CommentsComments The App objectThe App object Procedures and ParametersProcedures and Parameters Using multiple formsUsing multiple forms

Launching a second formLaunching a second form Passing data to and from a formPassing data to and from a form Multiple instances of a formMultiple instances of a form MDI formsMDI forms Unloading formsUnloading forms

Adding Modules to projectAdding Modules to project Variable ScopeVariable Scope Variable Naming ConventionsVariable Naming Conventions

Page 13: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1313

Course Outline, Week 4Course Outline, Week 4

File I/OFile I/O Intrinsic VB StatementsIntrinsic VB Statements Scripting and the FileSystemObjectScripting and the FileSystemObject Common DialogsCommon Dialogs

Adding References and ControlsAdding References and Controls Coding Exercise:Coding Exercise:

A simple text editorA simple text editor An error logging procedureAn error logging procedure

Page 14: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1414

Course Outline, Week 5Course Outline, Week 5

GraphicsGraphics The PictureBox controlThe PictureBox control The Image controlThe Image control IconsIcons Graphics formatsGraphics formats A simple picture viewerA simple picture viewer Using a picture as a background on a formUsing a picture as a background on a form Drawing shapesDrawing shapes

PrintingPrinting

Page 15: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1515

Course Outline, Week 6Course Outline, Week 6

DatesDates Caution: A date is not a date is not a Caution: A date is not a date is not a

datedate The Gregorian CalendarThe Gregorian Calendar

Drag-and-dropDrag-and-drop CollectionsCollections ClassesClasses

Page 16: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1616

Course Outline, Week 7Course Outline, Week 7

Database ApplicationsDatabase Applications ADO – the ActiveX Data ObjectADO – the ActiveX Data Object Relational Database basicsRelational Database basics The DataControlsThe DataControls The Data Environment DesignerThe Data Environment Designer The Data Report DesignerThe Data Report Designer Developing an Unbound database appDeveloping an Unbound database app The DataGrid controlThe DataGrid control Dates – Again…Dates – Again… SQL InjectionSQL Injection

Page 17: 1/26/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Materials & Prerequisites Course Outline Background Information.

1/26/20041/26/2004PPCC - Introduction to VB6PPCC - Introduction to VB6

Copyright Copyright ©2004, Tore Bostrup©2004, Tore Bostrup Page Page 1717

Course Outline, Week 8Course Outline, Week 8

Advanced topics:Advanced topics: Different types of projects:Different types of projects:

ActiveX Exe/DLLActiveX Exe/DLL ActiveX ControlActiveX Control Add-insAdd-ins OtherOther

Windows API’sWindows API’s Active Server Pages – what are they?Active Server Pages – what are they? Best PracticesBest Practices