Private Sub cmdplus_click()

            Txtresult.text=val(txtfirst.text)+val(txtsecond.text)

End sub

 

Private sub cmdrec_click()

            Frmcalculation.backcolor=&hff&

End sub

 

Private sub cmdrigh_mousemove()

            Cmdright.left=cmdright.left+10

If cmdright.left>2000 then

Cmd right.left=100

End if

End sub

 

Private sub cmdup_mousemove()

Cmdup.top=cmdup.top -10

If cmdup.top=>0 then

Cmdup.top=4000

End if

End sub

 

 

Password

Table field

Username

Password

Leve;

 

            Right click:

            -choose connection stric

                        -browse database

            -recordsource tab

                        -type of connection

                                    =unknown

            -sq

                        select form tablename

 

 

Splash Form

Private sub form_key press (key ascii as integer)

            Unload me

End sub

 

Private sub form_load()

            Lbl version.caption=”version” & app. Major & “,” & app. Minor & “,”

 & app. Revision

            lbl productname.caption=app.title

end sub

 

private sub frame1_()

            unload me

            frm login.show

end sub

 

private sub timer1_timer()

            if timer1.interval=2000 then

            frm login.show

            unload me

end if

end sub

 

private sub timer2_timer()

            timer3.interval=100

            timer2.interval=0

            timer4.interval=0

            imglogo.visible=false

            image1.visible=true

            image2.visible=false

end sub

 

private sub timer3_timer()

            timer4.interval=100

            timer2.interval=0

            timer3.interval=0

            imglogo.visible=false

            image1.visible=false

            image2.visible=true

 

private sub timer4_timer()

            timer2.interval=100

            timer3.interval=0

            timer4.interval=0

            imglogo.visible=true

            image1.visible=false

            image2.visible=false

end sub

 

Complete 100%

 

1.)    Get progressive bar

 

Private sub timer1_timer()

      Pgb1.value=pgb1.value+1

Label5.caption=pgb1.value & “%complete”

If pgb1.value=100 then

End

End if

End sub

 

Search

 

Private sub txtsea_change()

      Dim s as string

S=” ‘ “ & txtsea.text & “%” & “ ‘ “

Adodc1.recordsource=”select from admin where username like “& s

Adodc1.refresh

 

Move_previous

Private sub command_click()

Adodc1.recordset.moveprevious

If adodc1.recordset.boy then

Msgbox “first record”

Adodc1.recordset.movefirst

Exit sub

Else

Endif

End sub

 

Move.next

 

 Adodc1.recordset.movenext

If adodc1.recordset.eof then

Msgbox “last record”

Adodc1.recordset.movelast

Exit sub

Else

End sub

 

Private sub cmdadd_click()

With frmadmintransaction

            .show vbmodal

            . caption =”add record”

if .blnok then

adodc1.recordset.addnew

adodc1.recordset(“username”)=.txtusername.txt

adodc1.recordset(“password”)=.txtpassword.txt

adodc1.recordset(“level”)=txtlevel.txt

adodc1.recordset.update

else

msgbox “transaction cancelled”

end if

unload.frmadmintransaction

end with

end sub

 

public blnok as Boolean (general)

private sub frmadmintransaction_load()

blnok=false

end sub

 

*code that will enable the user to ligin if found in the table

 

dim s as string

s=” ‘ “ & txtpassword.text & “ ‘ “

adodc1.recordsource=”sekect * from admin where password=”& s

adodc1.refresh

if adodc1.recordset.eof or adodc1.recordset.eof then

msgbox “no record”

exit sub

end if

if adodc1.recordset (“password”)=txtpassword.text then

addmain.show

unload me

else

msgbox=”wrong password”

end if

 

delete

 

if adodc1.recordset.eof or adodc1.recordset.eof

then msgbox=”no record”

exit sub

else

adodc1.recordset.delete add effect current

end if

 

 

edit

with frmadministration

            .show vbmodal

            .caption =”edit recod

            .txtusename.text=adodc1.recordset(“username”)

            .txtpassword.text=adodc1.recordset(“password”)

            .txtlevel.text=adodc1.recordset(“level”)

 

if .blnok then

adodc1.recordset (“username”)=txtusername.text

adodc1.recordset(“password”)=.txtpassword.text

adodc1.recordset(“level”)=.txtlevel.text

adodc1.recordset.update

else

msgbox “transaction cancelled”

end if

unload frmadmintransaction

endwith

public:

blnok =true

 

public blnok as Boolean(general)

private sub cmdok_click()

blnok=true

me.hide

end sub

 

pribate sub cmdcancel_click()

unload me

end sub

load blnok=false

 

 

password:

 

priate sub cmdok_click()

dim s as string

dim u as string

s=” ‘ “ & txtusername.text & “ ‘ “

u==” ‘ “ & txtpassword.text & “ ‘ “

adodc1.recordsource= “ select 8 from admin where username= “& s and “password=” &u

 

adodc1.refresh

 

if adodc1.recordset.eof or adodc1.recordset.eof then

msgbox “invalid password or username”

exit sub

end if

 

if adodc1.recordset (“username”)=txtusername.text and adodc1.recordset (“password”)=txtpassword.text then frm MDIMain.show

end if

 

 ok (before sa blnok=true)

dim jay as control

for each jay in me

if type of jay is textbox then

if jay.text=” “ then

msgbox “please don’t leave a space”

exit sub

else blnok=true

me.hide

end if

endif

next

 

 

how to set focus

private sub txt username ()

if keyoycii= 13 then

txtpassword.setfocus

end if

end sup

txtarray (index+1).setfocus

 

SEARCH WITH COMBO BOX

Dim s as string

S=” ‘ “ & txtsearch.text & “ %” & “ ‘ “

F=clsofield.text

Adodc1.recordsource=”select * from adminwhere “ & f “ LIKE “ & S

Adodc1.refresh()

 

NOT ACCEPTING CHARACTER

Mask edit control (__*#)

 

 

SEARCH SA TEXTBOX

Dim s as string

S=

Select * from table where field=”&s.refresh

Txtdescription.text=adodc1.recordset(“description”)

 

*keypress (array structureJ

 

dim x as integer

on error goto x

if keyascii=13 then

text1(index+1).setfocus

end if

exit sub

x:

command1.setfocus

 

*Package and deployment wizard*

 

TERMS:

Package-consist fo the .cab file or files that contain any compressed project files and any other files necessary to install and run your application

 

Standard packages-packages created for disk, floppy or via network share

 

Internet packages-package created or distributed via internet or internet site

 

Packaging script-allows you to choose a previously save packaging script to use in the current packaging session

 

Dependency files (.def)-file contains information about the runtime requirements of an application or component

 

Two types of dependency files:

  1. component dep. Files-a dep. File lists needed by a particular control or component
  2. YB6 dep.ini-a list of dependency files for the entire visual basic development environment

 

Three way to Add necessary dependency information

  1. Edit the YB6dep.ini
  2. Create a .dep file for the component with the package and deployment wizard
  3. Request from the software vendor

 

Types of cab files for standard packaging

  1. Single cab-use for creation of one large cab file
  2. Multiple Cab-use multiple cabs and specify a cab size which size could not exceed to the size you specify

 

Primary Cab contains:

  1. Application’s Components(Active x Control, Active XDLL, or Active Exe)
  2. Inf. File-contains installation information and links to other .cab files
  3. Reserved space for Digital Signatures
  4. All Files that are not in other .cab files

 

Digital Signature provides the way to verify the ff:

-         contents of a file

-         that the file comes from a responsible source

 

Steps: Packaging Application Development

  1. Click Add-Ins Menu
  2. Click Add-Ins Manager
  3. Click Add-In Manager Dialog navigate for package development wizard
  4. check load /unload check box
  5. ok
  6. select a project (browse)
  7. choose package
  8. select a package type (standard package; dependency)
  9. choose folder where package will be assembled
  10. list of files needed for your application (u can add files)
  11. select a cap options
  12. enter title for application
  13. choose a start menu group and items that will be created by installation process
  14. location for each file :  can be changed
  15. share file option
  16. enter a script name
  17. report of packaging

 

dim s as string

s=” ‘ “ &txtpo.text & “ ‘”

select * from table where po= “&s

 

dim x as simgle

dim sum as single

sum=0

 

for x to adodc1.recordset.recordcount()

sum=sum +adodc1.recordset (“borrowed amount”)

adodc1.recordset.movenext

 

next x

txttotal.text=sum

txtbalance.text=loan_sum

do

sum=sum+adodc1.recordset (“borrowed amount”)

adodc1.recordset.movenext

 

loop until adodc1.recordset.eof

txttotal.text=sum

 

private sub cmdok_click()

dim s1 as string

dim s2 as string

dim s3 as string

s1=Adodc1.recordset(“a”)

s2=Adodc1.recordset(“b”)

s3=Adodc1.recordset(“c”)

 

Do

Adodc2.recordset.AddNew

            Adodc2.recordset(“a1”)=s1

            Adodc2.recordset(“b1”)=s2

            Adodc2.recordset (“c1”)=s3

Adodc2.recordset.update

Adodc1.recordset.movenext

Loop until adodc1.recordset.eof

End sub

Dim reply as string

Reply= msgbox (“are you sure you want to add this information?”,

If reply=vbyes then

On error goto errorhandler

Frmaddcustomer.adodcq.recordset.addnew

Txtguessid.setfocus

Else

Exit sub

End if

Msgbox (“successful ly added”,

Exit sub

Errorhandler

Msgbox (“duplicate value”’

Txtguestid.setfocus

Exit sub

End sub

 

 

Duplicate value

Dim s as string

S=

Adodc2.recordsource=”select * from order 1 where po=

Adodc2.refresh

If adodc2.recordset.recordcount>0 then

Msgbox (“duplicate value”)

Else

Txtdate.text=date

Txtsuplier_id.setfocus

End if

 

Searching of reports

Dim s as string

S= “ ‘ “ & text1.text& “ ‘ “

Data environment1.command1.sourc= “ select * from order 1 where po like “&s

Dataenvironment1.rxcommand1.open

Datareport1.refresh

Datareport1.show

Dataenvironment1.rscommand.close

 

 

Inner join

Select * from table 1 inner join table 2 on table1.field =table1.field

=select *, * from order, suborder

 

automatic the computer give the id number*

dim idgen as integer

private sub command1_click()

.addnew frmform1.ado.recordset

!id=id.text

!lastname=lname.text

!firstname=fname.text

!idgeneration=idgen

.update

endwith

msgbox(“record added”)

unload me

 

private sub form_load(0

ado.refresh

if ado.recordset.recordcount<1 then

id.text=1

idgen=1

 

else

ado.recordset.movelast

id.text=ado.recordset! id generation +1

idgem=val (od.text)

endif

 

 

blank first the data grid

ado.refresh

adodc1.recordsource=”select * from suborder where po

=’x’ “

 

 

report search one record

dim s as string

s=”

data environment1.rscommand1.source=”select * from ord inner join suborder on ord.po =suborder.po where ord.po=”&s

dataenvironment1.rscommand.open

datareport1.refresh

datareport1.show

dataenvironment2.rscommant1.close

end

add group header

 

 

Hosted by www.Geocities.ws

1