0% found this document useful (0 votes)
53 views40 pages

Tally PGRM

44h RMM 14 40 54 1342 Sadhana 78k CMA 20 60 80 1765 Viji 21c COP 18 58 76 1005 Ruba 56y BANKING 19 55 74 1006 Jinitha 34l VB 20 60 80 1. The document contains coding examples for various VB projects including mouse button identification, changing cursor shape, username and password validation,

Uploaded by

prabhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views40 pages

Tally PGRM

44h RMM 14 40 54 1342 Sadhana 78k CMA 20 60 80 1765 Viji 21c COP 18 58 76 1005 Ruba 56y BANKING 19 55 74 1006 Jinitha 34l VB 20 60 80 1. The document contains coding examples for various VB projects including mouse button identification, changing cursor shape, username and password validation,

Uploaded by

prabhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

1.

MOUSE BUTTON IDENTIFICATION


**********************************************

DESIGN:

CODING:
Private Sub Command1_Click()
End
End Sub
Private Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As
Single)
If Button = 1 Then
Option1.Value = True
MsgBox "Left Button is clicked"
Else

Option1.Value = False
End If
If Button = 2 Then
Option2.Value = True
MsgBox "Right Button is clicked"
Else
Option2.Value = False
End If
End Sub

OUTPUT:

2. Changing cursor shape


****************************

DESIGN:

CODING:
Private Sub Command1_Click()
End
End Sub
Private Sub MSFlexGrid1_MouseMove (Button As Integer, Shift As Integer, x As Single, y
As Single)
For i = 0 To 20
If MSFlexGrid1.MouseCol = i Then
MSFlexGrid1.MousePointer = i + 2
End If
If MSFlexGrid1.MouseRow = i Then

MSFlexGrid1.MousePointer = i + 8
End If
Next
End Sub

OUTPUT:

3. USERNAME AND PASSWORD


***************************************

DESIGN:

CODING:

Private Sub Command1_Click()


If Text1.Text = "Boys" And Text2.Text = "Girls" Then
MsgBox "Welcome to MY claSS"
Else
MsgBox "USERNAME & PASSWORD doesn't match"
End If
End Sub
Private Sub Command2_Click()
End
End Sub

OUTPUT:

4. Students Information
****************************

DESIGN:

CODING:

Public sname, srollno, scourse, saddress, sresult As String


Private Sub Command1_Click()
sname = InputBox("Enter the name")
srollno = InputBox("Enter the rollno")
scourse = InputBox("Enter the course")
saddress = InputBox("Enter the address")
sresult = InputBox("Enter the result")
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Command3_Click()
Text1.Text = sname
Text2.Text = srollno
Text3.Text = scourse
Text4.Text = saddress
Text5.Text = sresult
End Sub
Private Sub Command4_Click()
End
End Sub

OUTPUT:

5. Scrolling the Text


************************

DESIGN:

CODING:
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Label2.Caption = "Have a Wonderful day"
Label2.Font = 100
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()

Label2.Left = Label2.Left + 135


If Label2.Left >= ScaleWidth Then
Label2.Left = 800
End If
End Sub

OUTPUT:

6. Mini calculator
********************

DESIGN:

CODING:
Dim fn As Double
Dim sn As Double
Dim op As String
Private Sub Command1_Click(Index As Integer)
If Val(Text1.Text) = 0 Then
Text1.Text = Command1(Index).Caption
Else
Text1.Text = Text1.Text + Command1(Index).Caption
End If

End Sub
Private Sub Command2_Click(Index As Integer)
fn = Val(Text1.Text)
op = Command2(Index).Caption
Text1.Text = ""
End Sub
Private Sub Command3_Click()
sn = Val(Text1.Text)
Text1.Text = ""
Select Case (op)
Case "+"
Text1.Text = fn + sn
Case "-"
Text1.Text = fn - sn
Case "*"
Text1.Text = fn * sn
Case "/"
Text1.Text = fn / sn
End Select
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Command5_Click()
Text1.Text = ""
End Sub
Private Sub Form_Load()

Text1.Text = "0"
End Sub

OUTPUT:

7. Develop a Notepad
************************

DESIGN:

CODING:

Private Sub Command1_Click()


Dim note
note = Shell("c:/windows/notepad.exe", vbNormalFocus)
AppActivate note:
End Sub
Private Sub Command2_Click()
End
End Sub

OUTPUT:

8. VB PROJECT TO FIND THE RECORD


*************************************
DESIGN:

CODING

Private Sub Command1_Click()


Adodc1.Recordset.AddNew
MsgBox "the record is added"
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Delete
MsgBox "the record is deleted"
End Sub
Private Sub Command3_Click()

End
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.Move First
End Sub
Private Sub Command5_Click()
Adodc1.Recordset.Move previous
If Adodc1.Recordset.BOF Then
MsgBox "this is the first record"
Adodc1.Recordset.Move First
End If
End Sub
Private Sub Command6_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
MsgBox "this is the last record"
Adodc1.Recordset.Move Last
End If
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub Command8_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""

End Sub
SQL> Create table pr8(register_number varchar(10),name varchar(10), course varchar
(5),batch number(5) );
Table created
SQL> Insert into pr8 values(1u14bb041,sadhana,bba ca,2014);
1 row created
SQL> Insert into pr8 values (1u14bb040,ruba, bba ca,2014);
1 row created
SQL>Insert into pr8 values (1u14bb054,viji,bba ca,2014);
1 row created
SQL> select * from pr8;
REGISTER_NUMBER NAME

COURSE

BATCH

1U14BB041

SADHANA

BBA CA

2014

1U14BB040

RUBA

BBA CA

2014

1U14BB054

VIJI

BBA CA

2014

SQL> select * from pr8;


REGISTER_NUMBER
1U14BB041
1U14BB040
1U14BB054
1U14BB038
1U14BB034
SQL> COMMIT;
Commit completed
SQL>EXIT

NAME
SADHANA
RUBA
VIJI
RAMA
PARAMESH

COURSE
BBA CA
BBA CA
BBA CA
BBA CA
BBA CA

BATCH
2014
2014
2014
2014
2014

OUTPUT

9. STUDENTS DATABASE VB AND ORACLE


*****************************************
DESIGN:

CODING:
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
MsgBox "The Record is added"
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Delete
MsgBox "The Record is deleted"
End Sub
Private Sub Command3_Click()

End
End Sub
Private Sub Command4_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
End Sub
SQL>Create table a (name varchar(9),emp_no varchar(9), department
varchar(9) , designation varchar(5),salary number(5));
Table is created
SQL>Insert into a values(sadhana, 1001 , sales,20000);
1 row created
SQL> Insert into a values(ramasree,1002, production,25000);
1 row created
SQL> Insert into a values(ruba,1003,sales,10000);
1 row created
SQL> select * from a;
NAME
SADHANA
RAMA
RUBA
VIJI

EMP_NO
1001
1002
1003
1004

DEPARTMENT
SALES
PRODUCTION
SALES
SALES

DESIGNATION
MANAGER
MANAGER
SUPERVISOR
SUPERVISOR

SALARY
20000
20000
7000
5000

OUTPUT:

SQL>select * from a;
NAME
SADHANA
RAMA
RUBA
VIJI
JINITHA
SHILPA

EMP_NO
1001
1002
1003
1004
1005
1006

DEPARTMENT
SALES
PRODUCTION
SALES
SALES
SALES
PRODUCTION

DESIGNATION
MANAGER
MANAGER
HR
SUPERVISOR
MANAGER
CLERK

SALARY
20000
20000
70000
5000
10000
2500

10.ADVERTISEMENT BANNER
*******************************************

DESIGN:

CODING:

Private Sub Check1_Click()


If Check1.Value = 0 Then
Timer1.Enabled = False
Slider1.Enabled = False
Else
Timer1.Enabled = True
Slider1.Enabled = True
End If

End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Slider1.Max = 100
Slider1.Min = 1
Slider1.Value = 1
Timer1.Enabled = False
Timer1.Interval = Slider1.Value
Timer1.Enabled = False
End Sub
Private Sub Slider1_vcClick()
Timer1.Interval = Slider1.Value
End Sub
Private Sub Timer1_Timer()
Static count As Integer
If (Picture1.Left + Picture1.Width) <= 0 Then
Picture1.Left = Form1.Width
count = count + 1
End If
Picture1.Left = Picture1.Left - 100
End Sub

OUTPUT:

11. Employee Information


*****************************
SQL>COMMAND:
SQL> create table employee (emp_id varchar(5),emp_name varchar(10),dep
varchar(10),salary number(5));
Table created
SQL> insert into employee values (001,alex,hr, 15000);
1 row created
SQL> insert into employee values (002,boopa,system, 20000);
1 row created
SQL> insert into employee values (003,abi,sales, 22000);
1 row created
SQL> insert into employee values (004,gopal,purchase, 15000);
1 row created
SQL> insert into employee values (005,vicky,finance, 16000);
1 row created
SQL> commit;
Commit complete.

SQL> select * from employee;


EMP_ID
-----------

EMP_NAME
-----------------

DEP

SALARY

-------

------------

001

Alex

HR

15,000

002

Boopa

System

20,000

003

Abi

Sales

22,000

004

Gopal

Purchase 15,000

005

Vicky

Finance

16,000

12. Semester mark list


*************************
SQL>COMMAND:
Create table mm(reg_no varchar(10),name varchar(10),sem number(3),sub_code
varchar(5),sub_name varchar(10),cia number(5),eos number(5));
Table created
SQL> insert into mm values (1U14BB001,aarthi,4,33b,rmm,15,30);
1 row created
SQL> insert into mm values (1U14BB008,bala,4,55g,cma,16,44);
1 row created
SQL> insert into mm values (1U14BB013,eniyavan,4,,99v,vb,20,60);
1 row created
SQL> insert into mm values (1U14BB006,arun,4,67c,cop,15,50);
1 row created
SQL> insert into mm values (1U14BB038,rama, 4,54f,banking, 18, 48);
1 row created
SQL> alter table mm add (tot number(5),result varchar(5));
Table altered
SQL> update mm set tot=cia + eos;
5 rows updated
SQL> update mm set result = PASS where tot>40;
SQL> update mm set result = FAIL where tot<40;
SQL>commit;
Commit complete

Select * from mm;


REG_NO

NAME

SEM SUB_CODE SUB_NAME

CIA EOS

TOT RESULT

------------

---------

------ --------------- ----------------

------ ------

------- -------------

1U14BB001 Aarthi

33b

RMM

15

30

45

FAIL

1U14BB001 Bala

55g

CMA

15

44

69

PASS

1U14BB001 Eniyavan 4

99v

VB

20

60

80

PASS

1U14BB001 Arun

67c

COP

15

50

65

PASS

1U14BB001 Rama

54f

BANKING

18

48

66

PASS

13. Students arrear details


******************************
SQL>COMMAND:
SQL>create table ba(regno varchar(10),name varchar(10),sub_code varchar(5),sub_name
varchar(10),int_mrk number(5),ext_mrk number(5));
Table created
SQL> insert into ba values (1234,paramesh,44h,rmm, 14, 40);
1 row created
SQL> insert into ba values (1342,sadhana,78k,cma, 20, 60);
1 row created
SQL> insert into ba values(1765,viji,21c,cop,18,58);
1 row created
SQL> insert into ba values (1005,ruba,56y,banking, 19, 55);
1 row created
SQL> insert into ba values(1006,jinitha,34l,vb,20,60);
1 row created
SQL> alter table ba add (tot number(5));
Table altered
SQL> update ba set tot=int_mrk + ext_mrk;
5 rows updated
SQL> commit;
Commit complete

Select * from ba;


REGNO

NAME

------------ ------------

SUB_CODE SUB_NAME INT_MRK

EXT_MRK

TOT

----------------- ----------------- ---------------- ---------------- ----------

1234

Paramesh

44h

RMM

14

40

54

1342

Sadhana

78k

CMA

20

60

80

1765

Viji

21c

COP

18

58

76

1005

Ruba

56y

Banking

19

55

74

1006

Jinitha

34l

VB

20

60

80

SQL> select name, sub_name from ba where tot<=60;


NAME

SUB_NAME

TOT

-------------

-----------------

--------

Paramesh

RMM

54

14. Pass percentage


**********************
SQL>COMMAND:
SQL> create table js(regno varchar(10),name varchar(10),vb number(5),cma number(5),rmm
number(5),banking(5),edc number(5));
Table created
SQL> insert into js values (6785,Mahesh, 80, 65, 78, 57, 45);
1 row created
SQL> insert into js values (6879,Karthi, 76, 56, 87, 75, 54);
1 row created
SQL> insert into js values (6785,Prabhu, 56, 57, 40, 57, 60);
1 row created
SQL> insert into js values (6978,Rooban, 65, 46, 67, 45, 70);
1 row created
SQL> insert into js values (6543,Surya, 75, 68, 90, 50, 80);
1 row created
SQL> alter table js add (tot number(5),percentage number(5));
Table altered
SQL> update js set tot=vb+cma+rmm+banking+edc;
5 rows updated
SQL> update js set percentage=tot/5;
5 rows updated
SQL>commit;
Commit complete

Select * from js;


REGNO

NAME

VB

CMA RMM BANKING

EDC TOT

-----------

----------

----- -------- -------- --------------- ------- ------- ----------------------

6785

Maheh

80

65

78

57

45

325

65

6879

Karthi

76

56

87

75

54

348

69

6785

Prabhu

56

57

40

57

60

270

54

6978

Rooban

65

46

67

45

70

293

59

6543

Surya

75

68

90

50

80

363

73

SQL> select regno, name from js where percentage >=60;


REGNO

NAME

------------ ----------6543

Surya

6879

Karthi

6785

Mahesh

PERCENTAGE

15. Employees Net pay & Gross pay of a month


****************************************************
SQL>COMMAND:
SQL> create table pass(empid varchar(5),emp_name varchar(8),emp_dep varchar(10),dsngtn
varchar(10),basic_pay number(5),da number(5),hra number(5),pf number(5));
Table created
SQL> insert into pass values(1H1,Shilpa,hr,manager,14500,200,600,300);
1 row created
SQL> insert into pass values (1U2,Rama,sales,supervisor, 11000, 400,400,100);
1 row created
SQL> insert into pass values (1O1,Sadhana,office,manager,14000,200,500,300);
1 row created
SQL> insert into pass values (1O2,Viji,office,clerk,10500,400,500,300);
1 row created
SQL> insert into pass values (1F1,Ruba,finance,manager,13500,400,450,250);
1 row created
SQL> insert into pass values (1F2,Jinitha,finance,asst-manager, 11000, 200,500,300);
1 row created
SQL> insert into pass values (1P1,Jasmine,production,manager, 13000, 300,400,200);
1 row created
SQL> insert into pass values (1P2,Sujitha,production,supervisor,10000,400,300,100);
1 row created
SQL> insert into pass values (1U1,Aarthi,sales,manager,12500,200,300,250);
1 row created
SQL>alter table pass add (grss_pay number(5),net_pay number(5));
Table altered
SQL> update pass set gross_pay = basic_pay+da+hra;

9 rows updated
SQL> update pass set net_pay = grss_pay-pf
9 rows updated
SQL> commit;
Commit complete

SQL> Select * from pass;


EMP EMP _NAME EMP_DEP

DSNGTN

ID

BASIC

DA HRA PF

PAY

GRSS NET
PAY

PAY

------ ------------------ -------------- -------------

--------- ------ ------- ----- --------- ------

1H1

Shilpa

HR

14500

200

600

300 15300 15000

1U2

Rama

Sales

Supervisor 11000

400

400

100 11800 11700

1O1

Sadhana

Office

Manager

14000

200

500

300 14700 14400

Clerk

10500

400

500

300 11400 11100

Manager

13500

400

450

250 14350 14100

Asst-Mangr 11000

200

500

300 11700 11400

Manager

1O2

Viji

Office

1F1

Ruba

Finance

1F2

Jinitha

Finance

1P1

Jasmine

Production

Manager

13000

300

400

200 13700 13500

1P2

Sujitha

Production

Supervisor 10000

400

300

100 10700 10600

1U1

Aarthi

Sales

Manager

200

300

250 13000 12750

12500

You might also like