Professional Documents
Culture Documents
VB in 5 Days
VB in 5 Days
VB in 5 Days
Visual Basic:
References:
1)Guide to Visual Basic - Peter Norton
2)Visual Basic study guide- Michael McKelvy
3)Doing Objects with VB- Debora Kurata
4)ActiveX Technology with VB- Dan Appleman
Overview Of Development Process
User Interface
Instruction Set
Application Areas
Database Applications
Front end Tool
ActiveX component Creation tool
Internet Intranet Applications
Windows
Events
Messages
Features Of Visual Basic:
Development Process:
SDI / MDI
Docking
Types of files :
*.frm Form
*.cls Class
*.bas Standard
*.res Resource
*.Doc ActiveX Document
*.Ctl /*.OCX ActiveX Control
*.dsc Active Designer
Project Properties:
General
Type of Project
Startup Object
Make Page
displayable info
Compile
Optimizing the Performance
Component
Debugging
Code Editor
Tools-Option
Overall Appearance
Color coding for keywords,Identifier,Comments
Automatic Word Completion (ctrl+spacebar)
Auto Indent
Auto Syntax Check
Require Declaration
Auto List Members
Auto Quick Info
Auto Data Tips
Visual Basic Data Types
Naming Convention
Must begin with a letter of the alphabet
Must consists only letters digits & underscore
can be as long as 255 chars
can’t be duplicate in same scope
Types of Declaration
Dim
Static
Public
Private
Keyword variable_name as DataType
Declaring Arrays
Using Constants
Type type_name
element_name as Data_Type
End Type
var_name as type_name
Subroutines and Functions
pass by value
pass by reference
Optional arguments
Named argumnets
Calling
Call procedurename(para1,,,,)
procedurename para1,,,,
Program Flow
Conditional Branching
if then
If then else
if then elseif endif
Select case
case 1
case else
end select
Looping
For Next
Exit For
Do Loop Until
Do Loop While
Do While Loop
Do Until Loop
While Wend
Compiler Directives
#Const Indentifier=value
#if #then #Else #end if
What Next?
Exercise:
Objects ,Attributes,Operations
Design time
Run time
Form:
Properties Events
Caption Initialize
Control box Load
Window State Activate
Icon Deactivate
Start Up Position Queryunload
Unload
Terminate
Show
Hide
Controls
Label lbl Display text
Text box txt Display editable text
Frame fra Border or Container
Command Button cmd Button for triggering
Check box chk Selection(optional)
Option button opt Selection(compulsory)
List Box lst Display a list of value
Combo Box cbo Display drop down list
Scrollbar(h/v) (h/v)sb Scrolling
Timer tmr Trigger timed events
Drive List Box drv Drive selection
Directory list box dir Directory selection
File list box fil File slection
Image box img Display images
Picture pic Display images
Data Control dat database connection
OLE control ole OLE container
Label
Properties caption Events --
Wordwrap
Text box
Properties Text Events Validate
MaxLength Change
Multiline
Button
Properties Caption Events Click
Style
Cancel
Default
List
Properties Multiselect Events List click
Column Methods Clear
Itemdata AddItem
List List
ListIndex
Check Box
Properties caption Events Click
value
Style
Frame
Image
Picture
Scroll bar
Properties Value Events Change & Scroll
Timer
Properties interval Events Timer
Drive list
Properties Drive Event Change
Directory list
Properties Path Event Change
Parent
File List
properties File name Event Change
Parent
Path
Shipped Controls
Common dialog control Properties Method Action
File Show---
Font
Microsoft windows common controls
Statusbar Progressbar Imagelist
TabStrip Imagecombo
Stausbar
Panels text,caps,num,ins,scrl,date,time,KANA
key
Minwidth
Autosize no,spring,contents
.panel(index)
.panels.add
Progress bar
min,max,value (similar to scroll)
ImageList
key,picture,tag
Add,remove,clear
Tool bar
ImageList DisabledImageList HotImageList
Boredrstyle Apperance TextAlignment Style
Buttons
key,style,Image
Style default,check,buttongroup,seperator
placeholder,dropdown.
tooltiptext
Treeview Control
Style 0 to 7
Node
.Nodes.add relative,relationship,key,text,image,selected image
relative key value
relationship tvwChild
Children,child,parent,root
List view control
View , ColumnHeaders
data addition
Dim lst As ListItem
Set lst = ListView1.ListItems.Add(, , "Jackson")
With lst
.SubItems(1) = "test2"
End With
Menu bar
menu editor
Popup menu
visible property false
No necessity of additional menu
Miscellaneous control
Calendar
Date time picker
Image combo
Debug
Msgbox
Debug.print
Break point
Stepinto
Stepover
Stepout
Local window
What next?
Day 3
OLE DB technology
High Speed
Low Memory
Ease of use
ADODC
abstraction over ADO
type of connection
Security
Record source
Methods
addnew
delete
move
update
find
Properties
eof/bof
DataList/DataCombo
Source Destination
Bound column List Field
Data field Row Source
Data Source
ADO Object Model
Connection
Command
Parameters parameter
Errors error
Recordset
fields field
properties property
Connection RecordSet
Connectstring Activecommand
provider Activeconnection
Datasource Open/close
Mode dml features(Batchupdate)
cursor location Disconnected recordset
open Lock
executeQuery sqlsatement Cursortype(Dynamic,static--)
begintrans Fields
committrans
rollbacktrans
OpenSchema
Command Parameter
ActiveConnection Attributes
command type Direction
commandtext Name
execute value
Createparameter
parameters
Append
Multiple Recordset
Command
child command
Dataconsumers
data source
data member
data field
Data Report
Data source
Data member
show
Are you comfortable?
YES NO
Levels of coding
Withevents
Interfaces,polymorphism and inheritance
implementation
interface
ActiveX :
Identification of objects
UUID/GUID/CLSID/IID for unique identification
Object Presentation
Object Marshalling
Compound Documents
Ole Automation
InterFace Contract
GUID
The order of the functions
Parameters of the function
Return values
operation that the function performs
Interfaces
Iunknown AddRef,Release,QueryInterface
Idispatch GetTypeInfoCount,GetTypeInfo
GetIdsOfNames,Invoke
Early binding
Late binding
addRef
Iunknown Release
QueryInterface
Gettypeinfocount
IDispatch GetTypeinfo
GetIds
Invoke
Dual Mymethod
Within Application Within ActiveXDLL WithinActivexEXE
AxtiveXDll
ActiveXExe
Registering same as above
Design time same as above
Run time launch the exe
Instancing:
Private
PublicNotCreatable
SingleUse
GlobalSingleUse
MultiUse
GlobalMultiUse
Application Architecture:
Thread Management
State Management
Resource Dispensers
Transaction Management
Security Management