You are on page 1of 145

AVINASH KUMAR SINGH ENROL-011283067

$

ON




AS

%HE PAR%IAL FULFILLMEN% OF %HE REQUIREMEN%
FOR SUCCESSFUL COMPLI%ION OF
%HE AWARD OF

BACHELOR IN COMPUTER APPLICATION

TO
INDIRA GANGHI NATIONAL OPEN UNIVERSITY



Sulmiiicd Dy.-
AVINASH KUMAF SINCH
Enrollmcni No.-011283067
Siudy Ccnirc Codc- 0516
Fcgion Codc- 05

TuIc O Contcnts

Aclnowlcdgcmcni

Cuidc's Dio Daia

A. Pcrforma For Aroval

D. Fcmuncraiion Form For TIc DCA Cuidc

C. Projcci Traincc Lciicr

D. Ccriificaic Of Originaliiy

Projcci Tiilc

Iniroduciion Aloui ScIool

Oljcciivc Of TIc Projcci

Tools/Plaiforms and Environmcni

Projcci Analysis

Daia Flow Diagram

Flow CIari

Tallc Siruciurc

Sourcc Codc

Inui and Ouiui Scrccns

Sysicm Tcsiing

Sccuriiy Of TIc Sysicm

Limiiaiion and Fuiurc Scoc Of TIc Projcci


DilliograIy & Fcfcrcnccs

ACRNOLDGMNT

I WOULD LIKE TO EXPRESS ME SENSE OF INDEBTEDNESS &


GRATITUDE TO THOSE WHO HELPED ME IN COMPLETING THIS
PRO1ECT. I AM VERY THANKFUL TO Mr. PUNIT KUMAR FOR
PROVIDING ALL THE NECESSARY INFORMATION WHICH HELPS ME
INCOMPLETING THIS PRO1ECT.





THANKS.........













%

Name PUNI% KUMAR



Address C/O Mr. Suresh Prashad
Nasriganj,
Digha
Patna (BIHAR)
PIN-800012

Educational QualiIication M.C.A From University OI Madras In 1999.

PPROFESSIONAL SKILLS



Languages Visual Basic, Java, C and C.

Database Oracle, SQL Server

%ools & Packages Visual Studio,Java Iorte (FOR%E4J) and Crystal Report
8.5

%echnologies ASP, JSP,RMI, EJB

03 ard erv|rorrerl uNlX, w|rdoWs NT & 9 xs.


PPROFESSIONAL EXPERIENCE

1. SoItware Programmer at Digital Infotech & Software Private Limited, Mumbai.

2. SoItware Programmer at Sri Om Consultancy Service, Chennai.

3. Project Manager at POST Direct India Pvt.Ltd, Chennai

4. Developed SoItware in various PlatIorms like VB, Java and C/C.



Date: - 13/09/2004

Place:-Patna
PUNI% KUMAR





"SCHOOL AU1OMA1IOA SYS1EM"



First and Ioremost reasons to computerize any manual system are to
make all oI its subsystem Iast and accurate. Beside, there exist same problems
that hamper smooth Iunctioning oI the system. %he school handles a lot oI
transactions daily and all the transactions are to be maintained daily. So day-to-
day it becomes lengthy to manage all the transactions oI the school as the no oI
Iiles increases.
%hereIore with regard to this project, the main aim is to make School
Automation System Iaster and transparent and to overcome the limitation oI the
existing system. %he Manual Intervention required throughout the existing
system is replaced by automated process.

















$uusuut Vduuu

About the School.-
Saraswati Vidyalay, Gandhi Ghat, Patna is a well-established English
medium school. %his school got its aIIiliation Irom C.B.S.E. New Delhi in
1997. Since it is aIIiliated to CBSE, New Delhi, it Iollows CBSC curriculum.
At present, there are more than 500 students and 30 employees including
teachers are working there.
New Registration starts Irom January every year and its session starts
Irom March onwards.

Existing Systems
At present, all operations regarding students, teachers and the concerned
staIIs do management on papers. It makes the working oI the school in a
systematic manner by separating the procedure into independent modules as
Student related process
Employees` related process
OIIicial process
Operations related to students like admission, there Iee collection and all
inIormation related to students are maintained in registers, related to his class
and year. %he examination procedure also used inIormation about all rooms
Irom school`s inIormation register and then, by analyzing student`s Iee details
which gives total number oI student to appear in the examination arrange the
seat in diIIerent rooms oI school and like wise teacher`s are allocated to
diIIerent rooms.
Employee`s inIormation as their recruitment, daily attendance, their
salary structure and other Iacilities are maintained as a separate record. Like,
analyzing the attendance sheet creates employee`s salary and other Iacilities
avail by them and then accordingly recorded in the attendance register.

So, we see that the existing system makes the whole process more
tedious, costly and time consuming, which degrades the overall perIormance oI
school and diminish its image in educational arena.


Objective of the Project

%he objective oI this project is making the existing system systematic,
Iast, accurate and cheaper. And this can be accomplished by total automation oI
the existing system.
With total computerization and with the help oI required SoItware we
IulIill are objective as:
(i) Large number oI inIormation is handled against their
corresponding heads, which increase space Ior storing and other
processing.
(ii) Updating oI inIormation is possible automatically; on receive oI
updating oI inIormation.
(iii) An instant InIormation display is possible as per requirement.
(iv) It cuts the publishing and other costs, as it is now possible with
the help oI printer and automation soItware.
(v) It gives user-Iriendly environment and thus increases the
perIormance oI employers and school as a whole.
(vi) Searching oI previous records easy and Iast as per requirement.
(vii) %he users obtain various reports any time.
(viii) Only authorized people will be able to entry and updating data
related to their job.






1ools/ Platforms and Environment

It is decided that system is to be develop using SoItware development
technology in windows environment are as Iollows:

Front End : - Visual Basic 6.0 (Enterprise Edition)
Back End : - MS SQL Server 2000
O/S Environment : - Windows XP


ront End:-

Visual Basic is the Iastest and easiest way to create applications Ior
MicrosoIt Windows. %he Visual Basic provides us a complete set oI tools to
simply rapid application development.
Visual Basic has many powerIul Ieatures that are needed in today`s
programming environment some Ieatures are:
Programming object and Event: - %he visual Iorms and
objects like lists boxes and radio button that we use on the Iorms helps us to
interact with the application in order to Iind out the Ilow oI the program. %he
Iorms and object perIorm a speciIic action when an event occurs. %his is
known as event driven programming.
Easy to Develop Application: - %he tools provided by
Visual Basic helps us reducing the time at development oI Application. Visual
Basic is Iaster to create application using the tools available.
Wizard:-Visual Basic includes many wizards that can
automate tasks or events automate coding. Some oI these are the package and
development wizard, the class builder utility and data object generator wizard,
the application wizard and so on.

Functions: - %hese are Iourteen additional Iunctions in
Visual Basic. All oI them deal with String data; some oI these are Call By
Name, Filter, Format Currency and Format Date %ime etc.
Active X Features: - Visual Basic allows us to migrate
application to an Active X Document, which enables the application to install
and run Irom a web browser. %hus developer need not know language like Java
Or H%ML.
Database Enhancement: - Visual Basic contains Data
Access objects (DAO), Remote Data Object (RDO) and Active X Data object
(ADO) as the visual access %ools. Data Access Ieatures allow us to create
database and Iront-end application Ior most popular database Iormat.
Easy to handle: - %he Visual Basic development
environment includes extensive editing and debugging tools.

ack End

SQL Server 2000 is a relational database system that is scaleable Irom
small departmental networks to enterprise-wide networks. It maintains the core
database Iiles Ior use by custom database application using development
language such as Visual Basic and visual C
MicrosoIt inclusion oI a native OLE DB provider Ior SQL 2000
provides several new capabilities Ior the SQL server database developer. OLE
DB along with the ADO (Active X Data Object model, opens up the ability to
perIorm heterogeneous Queries that incorporate data Irom both relational
database like SQL server and non relational source like spreadsheets and even
mail or document management data source.
%he other main Ieatures to SQL Server 2000 are in the area oI data
warehousing. %he query engine used by SQL Server 2000 has been redesigned
to better handle the large and complicated queries that are required by Decision
Support System. SQL Server improved query support is closely tied to its
support Ior now MicrosoIt OLAP Services, which is bundled with SQL Server.



PRO1EC1 AAALYSIS

(1) Requirement Analysis:-

%his activity is the heart oI the system analysis. Using a variety oI
system analysts studies the currents system and keeps documents Ior Iurther
analysis Requirement analysis relieves on FAC% FINDING %ECHNIQUES.
%hese include Interview, Questionnaires, Record Inspection and On site
Observation.
Requirement deIinition involves studying the current system to
Iind out who it works and what the areas that need improvement are. System
studies result is an evaluation oI how current process are working and
adjustment iI any, is required. %hese studies consider both manual and
computer base technique.
Requirement Analysis Iorms core oI the system analyst`s process.
Using a variety oI tools and skills, the system analyst studies the current system
and documents its Ieatures Ior Iurther analysis. Requirement investigation
relies very heavily in Iace Iinding techniques. %hese include interviews,
questionnaires, record inspection and observation.
In this system, these techniques are interview, questionnaires,
record inspection and observation. Interview techniques can be used to collect
the inIormation Irom the individuals or groups.








(2) Interview:-

%he interview is a Iace-to-Iace interpersonal role situation in
which a person called the interviewer asks a person being interviewed question
designed to gather inIormation about a problem area. It is the oldest and most
oIten used to collect the inIormation Irom individual or group to Iind out the
problem with existing system or to extract new ideas, through regarding the
proposed system.
During development oI the system a number oI interviews are
conducted with the staII, who are the responsible Ior said job to get the insight
oI the problem Iaced by the school. Questions are asked clariIy the idea oI a
new system.

(3) Existing System:-

Procedure manuals illustrate the Iormat and Iunction oI various
aspect oI the existing system. Privet Iorm also capture inIormation that explain
the nature oI data Ilow, its source and job status, the department that get them,
their readability and use oI each.

(4) On - Site Observation

Another inIormation gathering tool used in system analysis is on-
site observation. %his inIormation gathering approach gets as close as possible
to real system under study, in its nature network environment. %hese analysis
need not to know what kind oI system it is, who runs it, the history behind it.
How it got to present state and how it relates to other system in the
organization.




Data flow diagrams for the various Modules

Context Level Diagram oI the entire system







































School
Automation
System
Student
InIormation
Employee
InIormation
Examination
InIormation
Student wise
Report
Employee`s
Report
Examination
Report


irst Level DD










































Registration
Student
InIormation
Student
Record
New Student
Fees
Collection
Store &
Retrieval
Monthly Fee
Collection &
VeriIication
Student
X
Fees
Monthly
Fee Report
Y













































Seat Arrangement
& %eacher
Allotments
Employe
e
X
Y
Room
Exam
P
Teachers
Allotment
Exam
Schedule
Seat
Arrangement
Fee Report













































Marks
Calculation
Marks
P
Mark sheet
X

Second Level DD

















































Invalid user
Valid user
User
InIormation
Pass
Error
Message

Validation
Check

Registration

New Student
&
Fee Collection
Student


















































All Data
Internal or
External Query
Database

Query
Query
Feedback

low Chart




































es
No
es
No No No No
es
Start
Display Main Menu
es es es
II
Stude
nt`s?
II
Emp`s
?
II
Exam
?
II
Acount
?
II
Exit ?
1 2 3 E
II
Regis
-
es
A
II
Stude
nt`s
es
No No No
es es es
II
Add
New ?
II
Edit ?
II
Find ?
II
Close
?
X Z C
Z1
X1
N
C






































Input oI new records
II
OK ?
X
X1
1
II
Cancel
?
Update then
Records in DB
Input oI record
to be searched

II
Find ?
Update then
Records in DB
Display the inIo Related
to searched Records
ModiIy the
concerned record
1






































Input oI record
to be searched
Z
II
OK ?
II
Cancel ?
Display the inIo Related
to searched Records
1






































Input oI record
to be searched
B
II
ModiIy
ModiIy the
concerned record
Display the inIo Related
to searched Records
ModiIy the
concerned record
1
II
Find ?
II
Close ?
II
Find ?
N C






































1
II
Close ?
N C
II
Appont
ment

II
Emp`s
InIo ?
B
2
N
II
Exam
Schedule
II
Mark
sheet ?
II
Add
New ?
II
Print ?
S
II
Close ?
C
D isplay Main Menu
I I Exam ?
1







































3
II
Fee
Details
II
Dues
List ?
II
Close ?
C N
II
Add
New ?
II
Print ?
S
E
STOP
S
Display the
print preview
II
print
II
Close ?
Print the
Searched Record
Close the Print
Preview Window


1able Structure

Normalizcd Tallc Siruciurc.-

1. %able: - IdPwd
%his table contains inIormation regarding User names and their
related Password. It has Iollowing Iields.
Id varchar(30) User ID
Pwd nchar(10) Password

2. %able: - School_Info
%his table contains inIormation regarding Structure oI School. It
has Iollowing Iields.
Roomno. Int Room No.
Roomcap
Int Room Capacity
Filledseat Int No oI Admitted Student
Classname Nchar(15) Class Name

3. %able: - Student_Admission
%his table contains inIormation regarding students. It has
Iollowing Iields.
Field name Data type Discription
Regno Nchar(15) Registration no.
Preclass Varchar(50) Previous Class name
Preyear Int Previous Class ear
Preschool Nchar(15) Previous School Name
Preboard Varchar(50) Board name oI Previous school
Doad Datetime Date oI admission
Adinclass nchar(15) Admission in Class (Class name)
Allottedroomno Int Allotted Room No.
Rollno Int Roll No.
Name Varchar(50) Student Name

Dob Datetime Date oI Birth
Sex Char(10) Sex
Fname Varchar(50) Father`s Name
Foccup Varchar(30) Father Occupation
Fquali Varchar(25) Father QualiIication
Mname Varchar(50) Mother Name
Moccup Varchar(30) Mother Occupation
Mquali Varchar(25) Mother QualiIication
Grdname Varchar(50) Guardian Name
Rwgrd Varchar(25) Relation with Guardian
Bgroup Nchar(20) Blood Group
Disease Varchar(50) Major Disease
Knownstu Varchar(50) Any one Known student name
Mconv Varchar(20) Mode oI Conveyance
Paadd Varchar(255) Permanent Address
Paph Varchar(15) Permanent Phone no.
Praddress Varchar(255) Present Address
Prph Varchar(15) Present Phone No.


4. %able: - Employee
%his table contains inIormation regarding all types oI employee.
Following are the Iields it contains.
Ecode Varchar(15) Employee Code
Etitle Varchar(50) Employee %itle
Ename Varchar(50) Employee Name
Dob Datetime Date oI Birth
Sex nchar(10) Sex
Maritalstatus Varchar(20) Marital Status
Religion varchar(20) Religion
Desig Varchar(30) Designation like 'Clerk', '%eacher'
Grade Varchar(20) Grade like 'a', 'b' or 'c'
Dept varchar(20) Department Allotted to employee
Doj Varchar(30) Date oI Joining

Salary Varchar(20) Salary Details
Expr varchar(20) Experiences
QualiIications Varchar(30) Educational QualiIication
%echproI Varchar(20) %echnical ProIiciency
Pradd varchar(255) Present Address
Prph Varchar(15) Present Phone Number
Paadd Varchar(255) Permanent Address
Paph Varchar(15) Permanent Phone no.

. %able: - Exam_Schedule
It contains inIormation regarding exam Schedule taken time to
time in the school. It has Iollowing Iields.
%ermend Varchar(30) Examination Period
Examdate Datetime Examination date
Class Varchar(20) Class name
%otstud Int %otal student in the class
Roomno Int Room no. OI Examination
seatcap Int Seating Capacity in speciIied room
RollIrom Int Roll no From
Rollto Int Roll no %o
sit1 Varchar(50) Name oI the invigilator in 1
st
sitting
Sit2 Varchar(50) Name oI the invigilator in 2
nd
sitting

6. %able: - Mark_sheet
It contains inIormation related to Maximum marks, marks, grade
obtained in various papers in diIIerent exams. It has Iollowing
Iields
Regno Char(10) Registration no oI student
%ermendexam Varchar(30) Name oI term end exam
Subject Nchar(20) Subject
maxmrk Int Maximum marks
passmrk Int Pass marks
mrkobtn Double Marks Obtained
Grade Char(5) Grade


. %able: - Fee_Details
%his table contains data related to various Iee details in the school
Regno Varchar(20) Registration no oI student
Class varchar(20) Class name
billno Int Bill No.
Ieemonth Float Month name oI Iee collection
regIee Float Registration Iee
tuIee Float %uition Iee
ConvIee Float Conveyance Iee
exmIee Float Examination Iee
scnIee Float Science Iee
consolIee Float Consolidate Iee
compuIee Float Computer Iee
devIee Float Development Iee
LibryIee Float Library Iee
lateIine Float Late Iine
oth1Iee Float Other Iee name
oth1Ieevalue Float Other Iee amount
oth2Iee Float Other Iee name
oth2Ieevalue Float Other Iee amount
oth3Iee Float Other Iee name
oth3Ieevalue Float Other Iee amount
totamt Float %otal amount
amtpaid Float Paid Amount
currentdues Float Current dues Amounts
Chqno Nchar(10) Cheque no.
Bankname Varchar(30) Name oI the Bank
Remark Varchar(150) Remark about Fee Details
Due date Datetime Due date within 30 days oI payment
Chqdate Datetime Cheque date
pmtdate Datetime Date oI bill no.













Report
Reports are needed to get detail and relevant inIormation regarding a
particular query. In any oIIice environment, these reports are generated as and
when required / demanded by the management authorities. %his project too,
endeavors to prepare reports that are oI immense help to the management in
decision-making process.
(1) Generation oI Iee details oI new student comprises his/her
uniIorm charges, etc
(2) Dues List.
(3) Seat Arrangement Ior taking Exam (Exam Schedule)
(4) Generation oI mark sheet oI student


$stcn Tcstng

System testing makes a logical assumption that all parts oI the
system are correct and the goal will be successively achieved. Inadequate
testing or no testing leads to error that may not appear until months latter.
Another reason Ior testing is its utility as a user oriented vehicle beIore
implementation.

(1) Forms and Program Testing:-

In System Analysis the system was designed according to the
requirement oI the system. %he system deals with a large number oI states,
complex logic and activities.
So, some error might occur in the system. Error may be in
SoItware, which is known as 'SoItware error i.e. the soItware doesn`t do what
the requirement says. So an exhaustive and through testing has been conducted
to ascertain whether the system produces right result.
%he actual output is compared with expected output. Action
button Save / Edit / Show / Print / Ok / Exit / Close are tested.
Each program module was tested as single program, which is also
known as :39 90893. %o ensure comprehensive test coverage, the tests have
been designed to include the Iollowing Ieature.
Null Date` cases have been covered
Valid Date` case have been covered
Boundary Date` case have been covered
Processing logic checks have been covered
When the individual program modules were working properly,
we combined the module into a working system. %he next modules to be tested
are those that call the previously tested modules.



Function Test:-

Once we were sure that inIormation is passed among modules
according to the design prescription we tested the system to ensure whether the
Iunction described the requirement speciIication were actually perIormed by
the integrated system.

Acceptance Test:-

When the Iunction test was completed, we involved the user to
make sure that system worked according to user`s expectation. %hus the user
did the Iinal acceptance test


Security

A security system oI any project ensures the protection oI data
regardless oI how users gain access to the database. %his soItware protects
Irom unauthorized user t use it using his/her login name and password. II user
account does not exist (who try to use this soItware) exist in a database, he/she
cannot access the soItware.
%his soItware Iacilitates another type oI security that user
password keep in database in encrypted Iorm So in case iI any hacker try to
know the password oI any user, It will be too hectic job.
%he password Iacility is given in this project can be changed at any time
by the project itselI.





Limitation of the Project
%his project Ior School automation has huge Ieature with same
limitations.
(i) In case oI admission structure be change in class wise to section
wise oI a class, database management system will occur a deep
problem.
(ii) In case oI examination schedule and data structure be change, in
that case, this project has not Iacility to handle it. For Example iI
school wants to take examination in diIIerent room oI diIIerent
classes, so, %hey must be know to how much student having
particular class and their corresponding examination hall in
which, they want to take exam.
(iii) Security oI the project only protect the unauthorized user, but not
the authorize user label. So every authorized user can access the
database as well as it modiIy edit and deleting the records.

uture Application of the Project
II user oI this project wants to enhance the previous project them he
should know visual Basic 6.0, SQL Server 2000 and Seagate Crystal Reports,
because this iI doesn`t run in the lesser version oI above mentioned soItware.
%his soItware has also web application.
By adding the Iorms the coding in this project, the project extends to
more applications like web applications Ior the intranet.




login_form
***********************






front_page
************************










school_info


















student_admission
********************************


















seat_arrengment
**********************


















Mark_sheet
*******************







fee_details
******************
















employse_appontment
******************************
















employee_information
******************************








rpt_seatarrangement
******************************

















rpt_marksheet
********************


pt_detail
******************

















duse_list
***************

















Form: - Login.frm
Private Cntemp As ADODB.Connection
Private Rstemp As ADODB.Recordset
Dim struser As String, strpass As String
Private Matchpass, chgpass As Boolean

Private Sub FormLoad ()
Matchpass False
Set cntemp New ADODB.Connection
cntemp.Open "dsn sqlschool
'cntemp.Execute "update IDPwd set pwd'" & code (UCase ("manager")) & "'
where ID 'system'"
End Sub

Private Sub cmdcancleClick ()
II UFound %rue %hen
Unload Frontpage
Unload SASMDI
End II
Unload Me
End Sub

Private Sub cmdokClick ()
CheckIDPASS
End Sub
Private Sub cmdchgpassClick ()
II cmdchgpass.Caption "Chan&Ge Password" %hen
Chgpass %rue

cmdchgpass.Caption "&Ok"
cmdok.Enabled False
lblpassword.Caption "%ype new password"
lblretypepass.Caption "Retype password": lblretypepass.Visible %rue
txtcnIpwd.Visible %rue
txtpwd.%ext "": txtcnIpwd.%ext "": txtpwd.SetFocus: SendKeys
("home} End}")
ElseII cmdchgpass.Caption "&Ok" %hen
II chgpass %rue And matchpass %rue %hen
cntemp.Execute "update IDPwd set pwd'" & code (UCase (%rim
(txtcnIpwd.%ext))) & "' where ID '" & %rim (txtID.%ext) & "'"
Chgpass False
cmdok.Enabled %rue
cmdchgpass.Caption "Chan&Ge Password"
lblpassword.Caption "Password"
lblretypepass.Visible False: txtcnIpwd.Visible False
Else
MsgBox "%ype again to change Password"
End II
End II
End Sub
Private Sub checkIDPASS ()
II %rim (txtID.%ext) ~ "" And %rim (txtpwd.%ext) ~ "" %hen
Set rstemp cntemp.Execute ("select pwd Irom IDPwd where ID '" &
%rim (txtID.%ext) & "'")
II rstemp.BOF %rue %hen
MsgBox "Invalid user."
txtID.SetFocus
Exit Sub
End II
While Not rstemp.EOF

II IsNull (rstemp (0)) False %hen
II UCase (%rim (txtpwd.%ext)) ~ decode (rstemp (0)) %hen
MsgBox "Invalid Password."
txtpwd.SetFocus
Exit Sub
Else
Unload Me
Load Frontpage
Frontpage.Show
End II
End II
rstemp.MoveNext
Wend
rstemp.Close
Set rstemp Nothing
cntemp.Close
End II
End Sub

Private Sub txtcnIpwdGotFocus ()
SendKeys ("Home} End}")
End Sub

Private Sub txtcnIpwdKeyPress (KeyAscii As Integer)
II KeyAscii 13 %hen
txtcnIpwdLostFocus
End II
End Sub

Private Sub txtcnIpwdLostFocus ()
II %rim (txtpwd.%ext) %rim (txtcnIpwd.%ext) %hen

Matchpass %rue
Else
Matchpass False
MsgBox "Password doesn't match. %ry again. vbInIormation
End II

End Sub

Private Sub txtIDGotFocus ()
SendKeys ("Home} End}")
End Sub

Private Sub txtIDKeyPress (KeyAscii As Integer)
II KeyAscii 13 %hen
txtwd.SetFocus
End II
End Sub
Private Function code (strtemp As String) As String
S%R ""
For p 1 %o Len (strtemp)
S%R S%R & Chr (Asc (Mid (strtemp, p, 1)) * 2 5)
Next
Code S%R
End Function
Private Function decode(strtemp As String) As String
S%R ""
For p 1 %o Len (strtemp)
S%R S%R & Chr ((Asc (Mid (strtemp, p, 1)) - 5) / 2)
Next
Decode S%R
End Function




Form: - Frontpage
Private Sub FormActivate ()
classname
End Sub

Private Sub FormLoad ()
Me.Height 8035
Me.Width 11935
For p 0 %o 4
Image1 (p).Visible False
Suboption (p).Visible False
Next
With %ext1 (0)
.BorderStyle 1
.FontSize 18
.ForeColor "&HFFFFFF"
.BackColor "&H000000"
showoptions (0)
End With

End Sub

Private Sub Label1MouseMove (Button As Integer, ShiIt As Integer, X As
Single, As Single)
For p 0 %o 4
suboption (p).ForeColor "&000000"
Next

End Sub


Private Sub suboptionClick (index As Integer)
II %ext1 (0).BorderStyle 1 %hen
II index 0 %hen
Load Irmsudentadmission
Irmsudentadmission.Show
ElseII index 1 %hen
Load IrmstudentinIormation
IrmstudentinIormation.Show
End II
ElseII %ext1 (1).BorderStyle 1 %hen
II index 0 %hen
Load Irmseatarrangment
Irmseatarrangment.Show
ElseII index 1 %hen
Load IrmMarksheet
IrmMarksheet.Show
End II
ElseII %ext1 (2).BorderStyle 1 %hen
II index 0 %hen
Load IrmIeeDetails
IrmIeeDetails.Show
ElseII index 1 %hen
Load IrmduesList
IrmduesList.Show
End II
ElseII %ext1 (3).BorderStyle 1 %hen
II index 0 %hen
Load IrmschoolinIormation

IrmschoolinIormation.Show
End II
ElseII %ext1 (4).BorderStyle 1 %hen
II index 0 %hen
Load Irmempappt
Irmempappt.Show
ElseII index 1 %hen
Load IrmempinIormation
IrmempinIormation.Show
End II
End II
End Sub

Private Sub suboptionMouseMove(index As Integer, Button As Integer, ShiIt
As Integer, X As Single, As Single)
Suboption (index).ForeColor "&H008080"
End Sub

Private Sub Picture2MouseMove(index As Integer, Button As Integer, ShiIt
As Integer, X As Single, As Single)
For p 0 %o 4
Image1 (p).Visible False
II %ext1 (p).BorderStyle 0 %hen
%ext1 (p).ForeColor "&H000000"
%ext1 (p).BackColor "&HC0C0C0"
End II
Next

End Sub

Private Sub Picture3Click ()

End
End Sub

Private Sub %ext1Click(index As Integer)
For p 0 %o 4
Suboption (p).Visible False
%ext1 (p).FontSize 14
%ext1 (p).BorderStyle 0
%ext1 (p).ForeColor "&H000000"
%ext1 (p).BackColor "&HC0C0C0"
Next
With %ext1 (index)
.BorderStyle 1
.FontSize 18
.ForeColor "&HFFFFFF"
.BackColor "&H000000"
showoptions (index)
End With
%ext2.SetFocus
End Sub

Private Sub %ext1MouseMove(index As Integer, Button As Integer, ShiIt As
Integer, X As Single, As Single)
For p 0 %o 4
Image1 (p).Visible False
Next
Image1 (index).Visible %rue
With %ext1 (index)
II .BorderStyle 1 %hen Exit Sub
.ForeColor "&HFFFFFF"
.BackColor "&H808080"

End With
End Sub

Private Sub showoptions (inttemp As Integer)
II inttemp 0 %hen ' For Student
Suboption (0).Visible %rue: suboption (0).Caption "Admission"
Suboption (1).Visible %rue: suboption (1).Caption "InIormation"
End II
II inttemp 1 %hen ' For Marksheet
Suboption (0).Visible %rue: suboption (0).Caption "Exam Schedule"
Suboption (1).Visible %rue: suboption (1).Caption "Marksheet"
End II
II inttemp 2 %hen ' For Accounts
Suboption (0).Visible %rue: suboption (0).Caption "Fee Details"
Suboption (1).Visible %rue: suboption (1).Caption "Dues List"
End II
II inttemp 3 %hen ' For Others
Suboption (0).Visible %rue: suboption (0).Caption "School InIo"
Suboption (1).Visible %rue: suboption (1).Caption "Price List"
End II
II inttemp 4 %hen ' For Employee
Suboption (0).Visible %rue: suboption (0).Caption "Appointment"
Suboption (1).Visible %rue: suboption (1).Caption "InIormation"
End II
End Sub










Form: - School_Information
Private Growno, inttemp As Integer
Private Mrs1, Mrs2, Mrs3, Mrs4, Mrs5 As String

Private Sub cmdexitClick ()
Unload Me
CloseRecordSet
End Sub


Private Sub edit4Click ()
II Flag%extBox (%ext1d, %ext2d, "Class name", "alottedroom") %rue %hen
With Grid4
For totno 1 %o 19
.Row totno
.Col 1
II .%ext ~ "" %hen
II CInt (%ext2d.%ext) CInt (.%ext) %hen
.Col 0
MsgBox "Room No. '& %ext2d.%ext & 'is allready alloted to Class
& .%ext, vbInIormation: edit4.Enabled False: Exit Sub
End II
End II
Next
End With
With Grid5

II .Row 0 %hen MsgBox "Enter Room InIormation First", vbInIormation:
edit4.Enabled False: Exit Sub
Inttemp .Row
Srno CInt (%ext2d.%ext)
For totno 1 %o inttemp
.Row totno
.Col 0
II .%ext srno %hen
Exit For
End II
II totno inttemp %hen
MsgBox "Room No." & srno & 'is Not SpeciIied in Room List.",
vbInIormation
Exit Sub
End II
Next
.Row inttemp
End With
conn.Execute ("UPDA%E schoolinIo SE% classname'" & %ext1d.%ext &
"', alottedroomIrom'" & %ext2d.%ext & "' WHERE classname'" & Mrs4
& "'")
Go%o labelA
Else
II totno 6 %hen
II %rim (%ext4d.%ext) ~ "" %hen
MsgBox %ext1d.%ext & "is already Running in Room No. '& S%R & ".
here. So ou Cann't Delete it."
Go%o labelA
End II
conn.Execute ("DELE%E Irom schoolinIo WHERE classname'" &
Mrs4 & "'")

End II
%otno 100
LabelA:
%ext1d.%ext ""
%ext2d.%ext ""
%ext4d.%ext ""
edit4.Enabled False
NEWVALUES4
End II
End Sub
Private Sub edit5Click ()
II Flag%extBox (%ext1e, %ext2e, "Room Number", "Room Capacity") %rue
%hen
II %ext1e.%ext ~ Mrs5 And (%ext3e.%ext ~ "" Or %ext3e.%ext ~ "0") %hen
MsgBox "ou Cann't Edit it due to One Class Running in this Room with &
%ext3e.%ext & 'Students.", vbInIormation
%ext1e.%ext Mrs5
%ext1e.SetFocus
Exit Sub
End II
conn.Execute ("UPDA%E schoolinIo SE% roomno'" & %ext1e.%ext & "',
cap'" & %ext2e.%ext & "'WHERE roomno'" & Mrs5 & "'")
Go%o labelA
Else
II totno 6 %hen
II %rim (%ext3e.%ext) ~ "" %hen
MsgBox "Some Students are Studung in Room No. '& S%R & ". So
ou Cann't Delete it."
Go%o labelA
End II

conn.Execute ("DELE%E Irom schoolinIo WHERE roomno'" & Mrs5
& "'")
End II
%otno 100
LabelA:
%ext1e.%ext ""
%ext2e.%ext ""
%ext3e.%ext ""
edit5.Enabled False
NEWVALUES5
End II
End Sub
Private Sub FINISH4Click ()
%ext1d.%ext "": %ext2d.%ext "": %ext4d.%ext ""
Mrs4 ""
NEWVALUES4
add4.Enabled False: edit4.Enabled False
CloseRecordSet
%ext1d.SetFocus
End Sub
Private Sub FINISH5Click ()
%ext1e.%ext "": %ext2e.%ext "": %ext3e.%ext ""
Mrs5 ""
NEWVALUES5
Add5.Enabled False: edit5.Enabled False
CloseRecordSet
%ext1e.SetFocus
End Sub
Private Sub FormActivate ()
Mrs1 "": Mrs2 "": Mrs3 "": Mrs4 "": Mrs5 ""
NEWVALUES4

NEWVALUES5
add4.Enabled False: edit4.Enabled False
Add5.Enabled False: edit5.Enabled False
End Sub

Private Sub FormLoad ()
With Grid4
.ColWidth (0) %ext1d.Width: .ColWidth (1) %ext2d.Width: .ColWidth
(2) 700
End With
With Grid5
.ColWidth (0) %ext1e.Width: .ColWidth (1) %ext2e.Width - 300
End With
End Sub
Private Sub ADD4Click ()
II Flag%extBox (%ext1d, %ext2d, "Class Name", "Room No.") %rue %hen
With Grid4
For totno 1 %o 19
.Row totno
.Col 1
II .%ext ~ "" %hen
II CInt (%ext2d.%ext) CInt (.%ext) %hen
.Col 0
MsgBox "Room No. '& %ext2d.%ext & 'is allready alloted to
Class & .%ext, vbInIormation: edit4.Enabled False: %ext2d.SetFocus: Exit
Sub
End II
End II
Next
End With
With Grid5

II .Row 0 %hen MsgBox "Add Room InIormation First.", vbInIormation:
add4.Enabled False: Exit Sub
Inttemp .Rows - 2
Srno CInt (%ext2d.%ext)
For totno 1 %o inttemp
.Row totno
.Col 0
II .%ext srno %hen
Exit For
End II
II totno inttemp %hen
MsgBox "Room No." & srno & 'is Not SpeciIied in Room List.",
vbInIormation
%ext2d.SetFocus
Exit Sub
End II
Next
End With
conn.Execute ("INSER% IN%O schoolinIo (classname, alottedroom)
VALUES ('" & %ext1d.%ext & "','" & %ext2d.%ext & "')")
%ext1d.%ext ""
%ext2d.%ext ""
%ext4d.%ext ""
FINISH4.SetFocus
NEWVALUES4
add4.Enabled False
End II
End Sub
Private Sub ADD5Click ()
II Flag%extBox (%ext1e, %ext2e, "Room Number", "Capacity") %rue %hen

conn.Execute ("INSER% IN%O schoolinIo (roomno, cap) VALUES ('" &
%ext1e.%ext & "','" & %ext2e.%ext & "')")
%ext1e.%ext ""
%ext2e.%ext ""
%ext3e.%ext ""
FINISH5.SetFocus
NEWVALUES5
Add5.Enabled False
End II
End Sub


Private Sub NEWVALUES4 ()
With Grid4
.clear
For p 1 %o 19
.Row p
.Col 0: .%ext arrclass (p - 1)
Next
Set rs conn.Execute ("SELEC% classname, alottedroom, admittedstudent
FROM schoolinIo ", connOpenSnapshot)
Growno 0
.Row 0
.Col 0: .%ext 'Class"
.Col 1: .%ext "Room No."
.Col 2: .%ext " NOS"
Do Until rs.EOF
II IsNull (rs! |classname|) False %hen
Growno Growno 1
.Row Growno
.Col 0: .%ext rs!|classname|

.Col 1: .%ext rs! |alottedroom|
II IsNull (rs! |admittedstudent|) False %hen .Col 2: .%ext rs!
|admittedstudent|
End II
rs.MoveNext
Loop
End With
CloseRecordSet
End Sub
Private Sub NEWVALUES5 ()
With Grid5
.clear
Set rs conn.Execute ("SELEC% roomno, cap, Iilledseat FROM schoolinIo
", connOpenSnapshot)
Growno 0
.Row 0
.Col 0: .%ext "Room No."
.Col 1: .%ext "Capacity"
.Col 2: .%ext "Filled Seat"
Do Until rs.EOF
II IsNull (rs! |roomno|) False %hen
Growno Growno 1
.Row Growno
.Col 0: .%ext rs! |roomno|
.Col 1: .%ext rs! |cap|
II IsNull (rs! |Iilledseat|) False %hen Grid5.Col 2: Grid5.%ext
rs!|Iilledseat|
End II
rs.MoveNext
Loop
End With

CloseRecordSet
End Sub



Private Sub Grid4Click ()
Grid4.Col 0: %ext1d.%ext Grid4.%ext: Mrs4 Grid4.%ext
Grid4.Col 1: %ext2d.%ext Grid4.%ext: S%R Grid4.%ext
' Grid4.Col 2: %ext3d.%ext Grid4.%ext: S%R S%R & 'to & Grid4.%ext
Grid4.Col 2: %ext4d.%ext Grid4.%ext
II %rim (Mrs4) ~ "" %hen add4.Enabled False: edit4.Enabled %rue
%ext1d.SetFocus
End Sub
Private Sub Grid5Click ()
Grid5.Col 0: %ext1e.%ext Grid5.%ext: Mrs5 Grid5.%ext
Grid5.Col 1: %ext2e.%ext Grid5.%ext: S%R Grid5.%ext
Grid5.Col 2: %ext3e.%ext Grid5.%ext
II %rim (Mrs5) ~ "" %hen Add5.Enabled False: edit5.Enabled %rue
%ext1e.SetFocus
End Sub



Private Sub %ext1dLostFocus ()
II %ext1d.%ext ~ "" %hen
Set rs conn.Execute ("SELEC% * FROM schoolinIo WHERE
classname'" & %ext1d.%ext & "'", connOpenDynaset)
II rs.BOF %hen
' II edit4.Enabled False %hen add4.Enabled %rue
edit4.Enabled False: add4.Enabled %rue
End II

II Not rs.EOF %hen
edit4.Enabled %rue
add4.Enabled False
%ext2d.%ext rs! |alottedroom|

II %ext1d.%ext ~ Mrs4 And Mrs4 ~ "" %hen
%otno MsgBox ("%his Subject is allready exist." & vbCrLI & "Do
ou want to Edit it & vbCrLI & "Click 'ES' Ior Edit," & vbCrLI & "Click
'No' Ior Add New Dept. ", vbesNo vbExclamation, "SAMARPAN")
II totno 6 %hen
Mrs2 %ext1d.%ext
edit4.Enabled %rue
%ext2d.SetFocus
Else
edit4.Enabled False
%ext1d.SetFocus
End II
End II
End II
End II
End Sub
Private Sub %ext1eLostFocus ()
II %ext1e.%ext ~ "" %hen
Set rs conn.Execute ("SELEC% * FROM schoolinIo WHERE roomno'"
& %ext1e.%ext & "'", connOpenDynaset)
II rs.BOF %hen
' II edit5.Enabled False %hen Add5.Enabled %rue
edit5.Enabled False: Add5.Enabled %rue
End II
II Not rs.EOF %hen
edit5.Enabled %rue

Add5.Enabled False
%ext2e.%ext rs! |cap|
II %ext1e.%ext ~ Mrs5 And Mrs5 ~ "" %hen
%otno MsgBox ("%his Subject is allready exist." & vbCrLI & "Do
ou want to Edit it & vbCrLI & "Click 'ES' Ior Edit," & vbCrLI & "Click
'No' Ior Add New Dept. ", vbesNo vbExclamation, "SAMARPAN")
II totno 6 %hen
Mrs2 %ext1e.%ext
edit5.Enabled %rue
%ext2e.SetFocus
Else
edit5.Enabled False
%ext1e.SetFocus
End II
End II
End II
End II
End Sub

Private Sub closeRecordSet ()
Set rs Nothing
End Sub

Private Sub %ext2dKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46 %hen
Else
KeyAscii 0
Beep
End II
End Sub





Private Sub %ext2eKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46 %hen
Else
KeyAscii 0
Beep
End II
End Sub

Private Function Flag%extBox(t1 As %extBox, t2 As %extBox, s1 As String, s2
As String) As Boolean
II %rim (t1.%ext) "" And %rim (t2.%ext) "" %hen
Flag%extBox False
%otno MsgBox ("Are ou Sure %o Delete It.", vbesNo vbExclamation,
"SAMARPAN")
Exit Function
End II
II %rim (t1.%ext) "" %hen
MsgBox "Please enter & s1 & '?", vbInIormation
Flag%extBox False
t1.SetFocus
Else: Flag%extBox %rue
End II
II %rim (t2.%ext) "" %hen
MsgBox "Please enter & s2 & '!", vbInIormation
Flag%extBox False
t2.SetFocus
Else: Flag%extBox %rue
End II

End Function



Module:-SysModule
Public S%R As String, sqlqry, sqlIromstinIorm As String
Public arrIrom (50) As String, arrto (50) As String
Public arrroomno (50) As String, arrcap (50) As String, arrIilledseat (50) As
String
Public arrclass (20) As String
Public billcd As String, totdues As Double
Public menuacss (0 %o 20) As Boolean, isnewact As Boolean
Public srno, totno, p, q, editableRow As Integer
Public cnt As Control
Public conn As ADODB.Connection
Public rs As ADODB.Recordset

Public Sub exitproject ()
conn.Close
Set conn Nothing
End
End Sub

Public Sub closeRecordSet ()
rs.Close
Set rs Nothing
End Sub
Public Sub classname ()
For p 0 %o 20
Arrclass (p) " "
Next




Arrclass (0) "One": arrclass (1) "%wo": arrclass (2) "%hree"
Arrclass (3) "Four" arrclass (4) "Five": arrclass(5) "Six"
Arrclass (6) "Seven arrclass (7) "Eight" arrclass (8) "Nine
Arrclass (9) "%en" arrclass (10) "Eleven": arrclass (11) "%welve"
End Sub
Public Sub addclass (cnt)
For p 0 %o 20
II %rim (arrclass (p)) ~ "" %hen
Cnt.AddItem arrclass (p)
End II
Next
cnt.ListIndex 0
End Sub

Public Sub adddesignation (cnt)
With cnt
.AddItem "%EACHER": .AddItem "CLERK": .AddItem "PEON"
.AddItem "SUPER": .AddItem "DRIVER": .AddItem "PRINCIPAL":
.AddItem "O%HERS"
.ListIndex 2
End With
End Sub
Public Sub addsubject (cnt)
With cnt
.AddItem "NA%URAL SCINCE": .AddItem "SOCIAL SCINCE"
.AddItem "HINDI .AddItem "ENGLISH": .AddItem "SANSKRI%"
.AddItem "SPOR%S:.AddItem "MA%HEME%ICS":
.AddItem "COMPU%ER" .AddItem "O%HERS"

.ListIndex 2
End With
End Sub


Form: - SASMDI
Private Sub MDIFormLoad ()
Set conn New ADODB.Connection
conn.Open "dsnsqlschool
End Sub

Form: - StudentAdmission
Private n1, n2, temp, Growno As Integer
Private Strscode, strsex As String

Private Sub cmbclassClick ()
Set rstemp conn.Execute ("SELEC% roomno, cap, Iilledseat Irom
schoolinIo where roomno (select alottedroom Irom schoolinIo where
classname'" & cmbclass.%ext & "')")
II IsNull (rstemp (0)) False %hen txtroomno.%ext rstemp (0)
II IsNull (rstemp (1)) False %hen
II IsNull (rstemp (2)) False %hen
lblseat.Caption " " & CInt (rstemp (1)) - CInt (rstemp (2)) & "/" &
rstemp (1)
Else
lblseat.Caption " " & CInt (rstemp (1)) & "/" & rstemp (1)
End II
End II
rstemp.Close
Set rstemp Nothing

lblclass.Caption cmbclass.%ext
End Sub

Private Sub cmbconvKeyPress (KeyAscii As Integer)
II KeyAscii 39 %hen
KeyAscii 96
End II
End Sub

Private Sub cmdcancleClick ()
For Each cnt In Me.Controls
II %ypeOI cnt 'is %extBox %hen
cnt.%ext ""
End II
Next
txtdob.%ext "//"
rdmale.Value %rue
cmdsave.Enabled %rue
cmdedit.Enabled False
txtpreclass.SetFocus

End Sub
Private Sub cmdeditClick ()
II %rim (txtregno.%ext) "" %hen
MsgBox "Enter Valid Registration no."
txtregno.SetFocus
Exit Sub
End II
II %rim (txtname.%ext) "" %hen
MsgBox "Enter Student Name"
txtname.SetFocus

Exit Sub
End II
II %rim (txtdob.%ext) "//" %hen
MsgBox "Enter Correct Date"
txtdob.SetFocus
Exit Sub
End II
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next
II rdmale.Value %rue %hen strsex "Male" Else strsex "Female"
conn.Execute ("UPDA%E studentadmission SE% preclass'" &
txtpreclass.%ext & "', preyear'"
& txtpreyear.%ext & "', preschool'" & txtpreschool.%ext & "', preboard'"
& txtpreboard.%ext & "', doad'" & txtdate.%ext & "', adinclass'"
& cmbclass.%ext & "', alottedroomno'" & txtroomno.%ext & "', rollno'"
& txtroll.%ext & "', name'" & txtname.%ext & "', dob'" & txtdob.%ext &
"',sex'" & strsex & "',Iname'"
& txtIname.%ext & "', Ioccup'" & txtIocup.%ext & "', Iquali'" &
txtIquali.%ext & "', mname'"
& txtmname.%ext & "', moccup'" & txtmocup.%ext & "', mquali'" &
txtmquali.%ext & "', grdname'"
& txtlgrd.%ext & "', rwgrd'" & txtrelwthgrd.%ext & "', bgroup'" &
txtbgrp.%ext & "', disease'"
& txtdisease.%ext & "', knownstu'" & txtnwnstu.%ext & "', mconv'" &
cmbconv.%ext & "', paadd'"
& txtpaadd.%ext & "', paph'" & txtpaph.%ext & "', praddress'" &
txtpradd.%ext & "', prph'"
& txtprph.%ext & "' where Regno'" & txtregno.%ext & "'")

cmdedit.Enabled False
updateschoolinIoadmittedstudent
updateschoolinIoIilledseat
Fillgrid
End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub cmdsaveClick ()
II %rim (txtname.%ext) "" %hen
MsgBox "Enter Student Name", vbInIormation
txtname.SetFocus
Exit Sub
End II
II %rim (txtdob.%ext) "//" %hen
MsgBox "Enter Date OI Birth", vbInIormation
txtdob.SetFocus
Exit Sub
End II
Strscode Right (txtdate.%ext, 2)
Strscode loadmembersrno ("Regno", strscode) & "/" & strscode
txtregno.%ext strscode
Strscode loadRollno ("adinclass'" & cmbclass.%ext & "'")
txtroll.%ext strscode
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next

II rdmale.Value %rue %hen strsex "Male" Else strsex "Female"
conn.Execute ("INSER% IN%O studentadmission VALUES ('" &
txtregno.%ext & "','" &
txtpreclass.%ext & "','" & txtpreyear.%ext & "','" & txtpreschool.%ext & "','" &

txtpreboard.%ext & "','" & txtdate.%ext & "','" &
cmbclass.%ext & "','" & txtroomno.%ext & "','" & txtroll.%ext &
"','" & txtname.%ext & "','" & txtdob.%ext & "','" &
strsex & "','" & txtIname.%ext & "','" & txtIocup.%ext & "','" & txtIquali.%ext &

"','" & txtmname.%ext & "','" & txtmocup.%ext & "','" & txtmquali.%ext & "','"
&
txtlgrd.%ext & "','" & txtrelwthgrd.%ext & "','" & txtbgrp.%ext & "','" &
txtdisease.%ext &
"','" & txtnwnstu.%ext & "','" & cmbconv.%ext & "','" & txtpaadd.%ext & "','" &

txtpaph.%ext & "','" & txtpradd.%ext & "','" & txtprph.%ext & "')")
cmdsave.Enabled False
updateschoolinIoadmittedstudent
updateschoolinIoIilledseat
Fillgrid
End Sub

Private Sub FormActivate ()
loadarraycumcombo
Addclass cmbclass
Fillgrid
End Sub

Private Sub FormLoad ()
txtdate.%ext Date

For p 0 %o 50
ArrIrom (p) " "
Arrto (p) " "
Arrroomno (p) " "
Arrcap (p) " "
arrIilledseat (p) " "
Next


With MSFlexGrid1
.FormatString "Reg No.,Student Name,Class Name,Conveyance,Local
Gardian,Phone/Mobile No."
.ColWidth (0) 0
.ColWidth (1) 2500
.ColWidth (2) 1500
.ColWidth (3) 1200
.ColWidth (4) 2000
.ColWidth (5) 1650
End With
End Sub
Private Sub IillIorm ()
Set rs Nothing
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select * Irom studentadmission where regno '" &
txtregno.%ext & "'"
II rs.EOF %rue %hen 'Has Not Record
Isnewact %rue

' lblnew.Visible %rue: lblnew.Caption "NEW Employee"
cmdsave.Enabled %rue: cmdcancle.Enabled %rue
.Close
Set rs Nothing
Exit Sub
End II
'lblnew.Visible False
Do Until rs.EOF
Isnewact False
II IsNull (rs (0)) False %hen txtregno.%ext rs (0)
II IsNull (rs (1)) False %hen txtpreclass.%ext rs (1)
II IsNull (rs (2)) False %hen txtpreyear.%ext rs (2)
II IsNull (rs (3)) False %hen txtpreschool.%ext rs (3)
II IsNull (rs (4)) False %hen txtpreboard.%ext rs (4)
II IsNull (rs (5)) False %hen txtdate.%ext rs (5)
II IsNull (rs (6)) False %hen cmbclass.%ext rs (6)
II IsNull (rs (7)) False %hen txtroomno.%ext rs (7)
II IsNull (rs (8)) False %hen txtroll.%ext rs (8)
II IsNull (rs (9)) False %hen txtname.%ext rs (9)
II IsNull (rs (10)) False %hen txtdob.%ext rs (10)
II IsNull (rs (11)) False %hen strsex rs (11)
II strsex "Male" %hen rdmale.Value %rue Else rdIemale.Value
%rue
II IsNull (rs (12)) False %hen txtIname.%ext rs (12)
II IsNull (rs (13)) False %hen txtIocup.%ext rs (13)
II IsNull (rs (14)) False %hen txtIquali.%ext rs (14)
II IsNull (rs (15)) False %hen txtmname.%ext rs (15)
II IsNull (rs (16)) False %hen txtmocup.%ext rs (16)
II IsNull (rs (17)) False %hen txtmquali.%ext rs (17)
II IsNull (rs (18)) False %hen txtlgrd.%ext rs (18)
II IsNull (rs (19)) False %hen txtrelwthgrd.%ext rs (19)

II IsNull (rs (20)) False %hen txtbgrp.%ext rs (20)
II IsNull (rs (21)) False %hen txtdisease.%ext rs (21)
II IsNull (rs (22)) False %hen txtnwnstu.%ext rs (22)
II IsNull (rs (23)) False %hen cmbconv.%ext rs (23)
II IsNull (rs (24)) False %hen txtpaadd.%ext rs (24)
II IsNull (rs (25)) False %hen txtpaph.%ext rs(25)
II IsNull (rs (26)) False %hen txtpradd.%ext rs (26)
II IsNull (rs (27)) False %hen txtprph.%ext rs (27)

rs.MoveNext
Loop
End With
rs.Close
Set rs Nothing
cmdsave.Enabled False: cmdedit.Enabled %rue
End Sub

Private Sub Iillgrid ()
With MSFlexGrid1
.clear
While .Rows ~ 2
.RemoveItem (.Rows)
Wend
.FormatString "Reg No.,Student Name,Class Name,Conveyance,Local
Gardian,Phone/Mobile No."
.ColWidth (0) 0
.ColWidth (1) 2500
.ColWidth (2) 1500
.ColWidth (3) 1200
.ColWidth (4) 2000
.ColWidth (5) 1650

End With
Growno 0
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select regno, name, adinclass, mconv, grdname, prph Irom
studentadmission"
End With
II rs.BOF %hen
CloseRecordSet
' lblnew.Visible %rue: Label3.Caption "It hasn't Any Record."
cmdsave.Enabled %rue
cmdcancle.Enabled %rue
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid1
Growno Growno 1
II Growno ~ 1 %hen .AddItem ""
.Row Growno
II IsNull (rs (0)) False %hen S%R rs (0) Else S%R " "
.Col 0: .%ext S%R
II IsNull (rs (1)) False %hen S%R rs (1) Else S%R " "
.Col 1: .%ext S%R
II IsNull (rs (2)) False %hen S%R rs (2) Else S%R " "
.Col 2: .%ext S%R
II IsNull (rs (3)) False %hen S%R rs (3) Else S%R " "
.Col 3: .%ext S%R
II IsNull (rs (4)) False %hen S%R rs (4) Else S%R " "

.Col 4: .%ext S%R
II IsNull (rs (5)) False %hen S%R rs (5) Else S%R " "
.Col 5: .%ext S%R
End With

rs.MoveNext
Wend
End Sub

Private Function loadmembersrno (strwhr As String, billcd) As String
Set rs conn.Execute ("select max (regno) Irom studentadmission")
Do Until rs.EOF
II IsNull (rs (0)) %hen
Isnewact %rue
cmdsave.Caption "&Save"

Exit Function
End II
Loadmembersrno CInt (Mid (rs (0), 1, InStr (rs (0), "/") - 1)) 1
Isnewact %rue
cmdsave.Caption "&Save"
rs.MoveNext
Loop
CloseRecordSet
End Function
Private Function loadRollno (strwhr As String) As String
Set rs conn.Execute ("select count (adinclass) Irom studentadmission
where " & strwhr)
Do Until rs.EOF
II IsNull (rs (0)) %hen
Isnewact %rue

cmdsave.Caption "&Save"
LoadRollno "1"
Exit Function
End II
LoadRollno CInt (rs (0)) 1
Isnewact %rue
cmdsave.Caption "&Save"
rs.MoveNext
Loop
CloseRecordSet
End Function





Private Sub MSFlexGrid1Click ()
With MSFlexGrid1
II Growno ~ .Row %hen
.Row .RowSel
txtregno.%ext .%extMatrix (.Row, 0)
FillIorm
End II
End With
End Sub


Private Sub txtdobLostFocus ()
II txtdob.%ext ~ "//" %hen
II IsDate (txtdob.%ext) False %hen
MsgBox "Invalid Date! vbInIormation

txtdob.SetFocus
End II
End II
End Sub

Private Sub txtregnoLostFocus ()
With MSFlexGrid1
For p 1 %o .Row
.Row p
.Col 0
II %rim (txtregno.%ext) .%ext %hen
MSFlexGrid1Click
Exit For
End II
Next
End With
End Sub

Private Sub updateschoolinIoadmittedstudent ()
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select adinclass, count (adinclass) Irom studentadmission where
adinclass'" & cmbclass.%ext & "' group by adinclass"
End With
II rs.BOF %hen
CloseRecordSet
Exit Sub
End II

While Not rs.EOF
conn.Execute ("update schoolinIo set admittedstudent'" & rs (1) &
"' where classname'" & rs (0) & "'")
rs.MoveNext
Wend
End Sub
Private Sub updateschoolinIoIilledseat ()
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select alottedroomno, count (alottedroomno) Irom
studentadmission where alottedroomno'" & txtroomno.%ext & "' group by
alottedroomno"
End With
II rs.BOF %hen
CloseRecordSet
Exit Sub
End II
While Not rs.EOF
conn.Execute ("update schoolinIo set Iilledseat'" & rs (1) & "' where
roomno'" & rs (0) & "'")
rs.MoveNext
Wend
End Sub

Private Sub loadarraycumcombo ()
Set rs conn.Execute ("SELEC% * FROM schoolinIo ", connOpenSnapshot)
II rs.BOF %hen MsgBox "ou Should SpeciIy Class InIormation Iirst",
vbInIormation: Exit Sub

n1 0
Do Until rs.EOF
II IsNull (rs! |roomno|) False %hen
Arrroomno (n1) rs! |roomno|
Arrcap (n1) rs! |cap|
II IsNull (rs! |Iilledseat|) False %hen arrIilledseat (n1)
rs!|Iilledseat| Else arrIilledseat(n1) 0
n1 n1 1
End II
rs.MoveNext
Loop
CloseRecordSet
End Sub


Form: - Employee_Appointment
Private Strecode As String, strsex As String, strmarital As String
Private Growno As Integer

Private Sub cmbtitleClick ()
II cmbtitle.ListIndex 0 %hen
rdmale.Value %rue
Else
rdIemale.Value %rue
End II
End Sub

Private Sub cmdcancleClick ()
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
cnt.%ext ""

End II
Next
txtdob.%ext "//"
txtdoj.%ext "//"
cmbtitle.ListIndex 0
cmbdept.ListIndex 0
cmbdesig.ListIndex 0
cmbreligion.ListIndex 0
rdmale.Value %rue
rdunmar.Value %rue
txtdoj.%ext Date
cmdsave.Enabled False
cmdedit.Enabled False
lblnew.Caption "Press %AB Ior Add New Emp"
lblnew.Visible %rue
txtecode.SetFocus
End Sub

Private Sub cmdeditClick ()
II %rim (txtecode.%ext) "" %hen
MsgBox "Enter Valid EMP Code"
Exit Sub
End II
II %rim (txtename.%ext) "" %hen
MsgBox "Please Enter EMP Name"
txtename.SetFocus
Exit Sub
End II
II %rim (txtdoj.%ext) "//" %hen
MsgBox "Enter Correct Date"
txtdoj.SetFocus

Exit Sub
End II
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next
II rdmale.Value %rue %hen strsex "Male" Else strsex "Female"
II rdmar.Value %rue %hen strmarital "Married" Else strmarital
"UnMarried"
conn.Execute ("UPDA%E emp SE% etitle'" & cmbtitle.%ext & "',ename'" &
txtename.%ext & "',dob'" & txtdob.%ext & "',sex'" & strsex &
"',maritalstatus'" & strmarital & "',religion'" & cmbreligion.%ext &
"',desig'" & cmbdesig.%ext & "',grade'" & txtgrade.%ext & "',dept'" &
cmbdept.%ext & "',doj'" & txtdoj.%ext & "',salary'" & txtsal.%ext &
"',expr'" & txtexpr.%ext & "',qualiIications'" & txtqli.%ext & "',techproI'"
& txtproI.%ext & "',pradd'" & txtpraddress.%ext & "',prph'" & txtprph.%ext
& "',paadd'" & txtpaddress.%ext & "',paph'" & txtpaph.%ext & "' where
ecode'" & txtecode.%ext & "'")
cmdedit.Enabled False
Fillgrid
End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub cmdsaveClick ()
II %rim (txtename.%ext) "" %hen
MsgBox "Please Enter EMP Name"
txtename.SetFocus

Exit Sub
End II
II %rim (txtdoj.%ext) "//" %hen
MsgBox "Enter Correct Date"
txtdoj.SetFocus
Exit Sub
End II
Strecode UCase (LeIt (txtename.%ext, 1)) & Mid (txtdoj.%ext, 4, 2) &
Right (txtdoj.%ext, 2) & LeIt (cmbdept.%ext, 2)
Strecode strecode & loadmembersrno (Me, "emp", "ecode", strecode)
txtecode.%ext strecode
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next
II rdmale.Value %rue %hen strsex "Male" Else strsex "Female"
II rdmar.Value %rue %hen strmarital "Married" Else strmarital
"UnMarried"
conn.Execute ("INSER% IN%O emp VALUES('" & txtecode.%ext & "','" &
cmbtitle.%ext & "','" & txtename.%ext & "','" & txtdob.%ext & "','" & strsex &
"','" & strmarital & "','" & cmbreligion.%ext & "','" & cmbdesig.%ext & "','" &
txtgrade.%ext & "','" & cmbdept.%ext & "','" & txtdoj.%ext & "','" & txtsal.%ext
& "','" & txtexpr.%ext & "','" & txtqli.%ext & "','" & txtproI.%ext & "','" &
txtpraddress.%ext & "','" & txtprph.%ext & "','" & txtpaddress.%ext & "','" &
txtpaph.%ext & "')")
cmdsave.Enabled False
Fillgrid
End Sub

Private Sub FormActivate ()

Adddesignation cmbdesig
Addsubject cmbdept
Fillgrid
End Sub

Private Sub FormLoad ()
Growno 0
txtdoj.%ext Date
With cmbtitle
.AddItem "Mr.": .AddItem "Miss.": .AddItem "Mrs."
.ListIndex 0
End With
With cmbreligion
.AddItem "Hindu"
.AddItem "Muslim"
.AddItem "Cristian"
.AddItem "Others"
.ListIndex 0
End With
With MSFlexGrid1
.FormatString "Emp Code,Employee Name,Department,Date OI
Joining,Phone/Mobile"
.ColWidth (0) 1200
.ColWidth (1) 2800
.ColWidth (2) 1500
.ColWidth (3) 1500
.ColWidth (4) 2400
End With
'With conn
' .Provider "sqloledb"

' .ConnectionString "USER ID SA; password;" & "initial catalog proj;
data source (local)"
' .Open
'End With
cmdsave.Enabled False: cmdedit.Enabled False
End Sub


Private Sub MSFlexGrid1Click ()
With MSFlexGrid1
II Growno ~ .Row %hen
IsAddnew False
.Row .RowSel
txtecode.%ext .%extMatrix (.Row, 0)
FillIorm
End II
End With
End Sub

Private Sub MSFlexGrid1KeyPress (KeyAscii As Integer)
II KeyAscii 13 %hen
With MSFlexGrid1
II Growno ~ .Row %hen
IsAddnew False
.Row .RowSel
txtecode.%ext .%extMatrix (.Row, 0)
FillIorm
End II
End With
End II
End Sub


Private Sub txtdobLostFocus ()
With txtdob
II .%ext "//" %hen Exit Sub
II .%ext ~ "//" %hen
II IsDate (.%ext) False %hen
MsgBox "Enter Correct Date"
.SetFocus
End II
End II
End With
End Sub

Private Sub txtdojLostFocus ()
With txtdoj
II .%ext "//" %hen Exit Sub
II .%ext ~ "//" %hen
II IsDate (.%ext) False %hen
MsgBox "Enter Correct Date"
.SetFocus
End II
End II
End With
End Sub

Private Sub txtecodeLostFocus ()
lblnew.Visible False
II %rim (txtecode.%ext) ~ "" %hen
FillIorm
cmdedit.Enabled %rue
cmdsave.Enabled False

Else
cmdsave.Enabled %rue
cmdedit.Enabled False
End II
End Sub

Private Sub IillIorm ()
Set rs Nothing
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select * Irom EMP where ecode '" & txtecode.%ext & "'"
II rs.EOF %rue %hen 'Has Not Record
Isnewact %rue
lblnew.Visible %rue: lblnew.Caption "NEW Employee"
cmdsave.Enabled %rue: cmdcancle.Enabled %rue
.Close
Set rs Nothing
Exit Sub
End II
lblnew.Visible False
Do Until rs.EOF
Isnewact False
II IsNull (rs (0)) False %hen txtecode.%ext rs (0)
II IsNull (rs (1)) False %hen cmbtitle.%ext rs (1)
II IsNull (rs (2)) False %hen txtename.%ext rs (2)
II IsNull (rs (3)) False %hen txtdob.%ext rs (3)
II IsNull (rs (4)) False %hen strsex rs (4)

II strsex "Male" %hen rdmale.Value %rue Else rdIemale.Value
%rue
II IsNull (rs (5)) False %hen strmarital rs (5)
II strmarital "Married" %hen rdmar.Value %rue Else
rdunmar.Value %rue
II IsNull (rs (6)) False %hen cmbreligion.%ext rs (6)
II IsNull (rs (7)) False %hen cmbdesig.%ext rs (7)
II IsNull (rs (8)) False %hen txtgrade.%ext rs (8)
II IsNull (rs (9)) False %hen cmbdept.%ext rs (9)
II IsNull (rs (10)) False %hen txtdoj.%ext rs (10)
II IsNull (rs (11)) False %hen txtsal.%ext rs (11)
II IsNull (rs (12)) False %hen txtexpr.%ext rs (12)
II IsNull (rs (13)) False %hen txtqli.%ext rs (13)
II IsNull (rs (14)) False %hen txtproI.%ext rs (14)
II IsNull (rs (15)) False %hen txtpraddress.%ext rs (15)
II IsNull (rs (16)) False %hen txtprph.%ext rs (16)
II IsNull (rs (17)) False %hen txtpaddress.%ext rs (17)
II IsNull (rs (18)) False %hen txtpaph.%ext rs (18)
'***************************************
'***************************************

rs.MoveNext
Loop
End With
rs.Close
Set rs Nothing
cmdsave.Enabled False: cmdedit.Enabled %rue
End Sub

Private Sub Iillgrid ()
With MSFlexGrid1

.clear
While .Rows ~ 2
.RemoveItem (.Rows)
Wend
.FormatString "Emp Code,Employee Name,Department,Date OI
Joining,Phone/Mobile"
.ColWidth (0) 1200
.ColWidth (1) 2800
.ColWidth (2) 1500
.ColWidth (3) 1500
.ColWidth (4) 2400
End With
Growno 0
Set rs conn.Execute ("select ecode, ename, Dept, DOJ, Prph Irom emp")
II rs.BOF %hen
CloseRecordSet
lblnew.Visible %rue: Label3.Caption "It hasn't Any Record."
cmdsave.Enabled %rue
cmdcancle.Enabled %rue
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid1
Growno Growno 1
II Growno ~ 1 %hen .AddItem ""
.Row Growno
II IsNull (rs (0)) False %hen S%R rs (0) Else S%R " "
.Col 0: .%ext S%R
II IsNull (rs (1)) False %hen S%R rs (1) Else S%R " "
.Col 1: .%ext S%R
II IsNull (rs (2)) False %hen S%R rs (2) Else S%R " "

.Col 2: .%ext S%R
II IsNull (rs (3)) False %hen S%R rs (3) Else S%R " "
.Col 3: .%ext S%R
II IsNull (rs (4)) False %hen S%R rs (4) Else S%R " "
.Col 4: .%ext S%R
End With

rs.MoveNext
Wend
End Sub


Private Function loadmembersrno(Irm As Form, strtable As String, strwhr As
String, billcd) As String
Set rs conn.Execute ("select max (" & strwhr & ") Irom " & strtable &
'where & strwhr & " like '" & billcd & "'")
Do Until rs.EOF
II IsNull (rs (0)) %hen
Isnewact %rue
Irm.cmdsave.Caption "&Save"
Loadmembersrno "01"
Exit Function
End II
Loadmembersrno Format (CInt (Right (rs (0), 2)) 1, "#00")
isnewact %rue
Irm.cmdsave.Caption "&Save"
rs.MoveNext
Loop
CloseRecordSet
End Function


Private Sub txtgradeKeyPress(KeyAscii As Integer)
KeyAscii Asc (UCase (Chr (KeyAscii)))
End Sub



Form: - Employee Information
Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub cmdsubmitClick ()
With lstdesig
II .SelCount 0 %hen MsgBox 'ou should be select Atleast One.":
lstdesig.SetFocus: Exit Sub
II .Selected (0) %rue %hen
sqlIromstinIorm "select ecode, ename, Dept, DOJ, Prph Irom emp"
Else
S%R ""
For p 1 %o .ListCount - 1
II .Selected (0) False And .Selected (p) %rue %hen
.ListIndex p
S%R S%R & "desig'" & .%ext & "' or
End II
Next
S%R S%R & "desig'~$~'"
sqlIromstinIorm "select ecode, ename, Dept, DOJ, Prph Irom emp
where " & str
End II
End With
Load IrmempDetails

IrmempDetails.Show
Unload Me
End Sub

Private Sub FormLoad ()
With IrmempinIormation
.LeIt 2750: .%op 2100: .Height 3500: .Width 6600
End With
lstdesig.AddItem "ALL Emp"
Adddesignation lstdesig
End Sub


Private Sub lstdesigItemCheck (Item As Integer)
II lstdesig.Selected (0) %rue %hen
For p 1 %o lstdesig.ListCount - 1
lstdesig.Selected (p) False
Next
End II
End Sub


Form: - Employee Details
Private Strecode As String, strsex As String, strmarital As String
Private Growno As Integer
Private Sub cmdcancleClick ()
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
cnt.%ext ""
End II
Next

txtdob.%ext "//"
txtdoj.%ext "//"
cmbtitle.ListIndex 0
cmbdept.ListIndex 0
cmbdesig.ListIndex 0
cmbreligion.ListIndex 0
rdmale.Value %rue
rdunmar.Value %rue
txtdoj.%ext Date
cmdedit.Enabled False
lblnew.Caption "Press %AB Ior Add New Emp"
lblnew.Visible %rue
txtecode.SetFocus
End Sub

Private Sub cmdeditClick ()
II %rim (txtecode.%ext) "" %hen
MsgBox "Enter Valid EMP Code"
Exit Sub
End II
II %rim (txtename.%ext) "" %hen
MsgBox "Please Enter EMP Name"
txtename.SetFocus
Exit Sub
End II
II %rim (txtdoj.%ext) "//" %hen
MsgBox "Enter Correct Date"
txtdoj.SetFocus
Exit Sub
End II
For Each cnt In Me.Controls

II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next
II rdmale.Value %rue %hen strsex "Male" Else strsex "Female"
II rdmar.Value %rue %hen strmarital "Married" Else strmarital
"UnMarried"
conn.Execute ("UPDA%E emp SE% etitle'" & cmbtitle.%ext & "',ename'" &
txtename.%ext & "',dob'" & txtdob.%ext & "',sex'" & strsex &
"',maritalstatus'" & strmarital & "',religion'" & cmbreligion.%ext &
"',desig'" & cmbdesig.%ext & "',grade'" & txtgrade.%ext & "',dept'" &
cmbdept.%ext & "',doj'" & txtdoj.%ext & "',salary'" & txtsal.%ext &
"',expr'" & txtexpr.%ext & "',qualiIications'" & txtqli.%ext & "',techproI'"
& txtproI.%ext & "',pradd'" & txtpraddress.%ext & "',prph'" & txtprph.%ext
& "',paadd'" & txtpaddress.%ext & "',paph'" & txtpaph.%ext & "' where
ecode'" & txtecode.%ext & "'")
cmdedit.Enabled False
updateschoolinIodesig
updateschoolinIodept
Fillgrid
End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub FormActivate ()
Adddesignation cmbdesig
Addsubject cmbdept
Fillgrid
End Sub


Private Sub FormLoad ()
Growno 0
txtdoj.%ext Date
With cmbtitle
.AddItem "Mr.": .AddItem "Miss.": .AddItem "Mrs.": .AddItem "Ms."
.ListIndex 0
End With
With cmbreligion
.AddItem "Hindu"
.AddItem "Muslim"
.AddItem "Cristian"
.AddItem "Others"
.ListIndex 0
End With
With MSFlexGrid1
.FormatString "Emp Code,Employee Name,Department,Date OI
Joining,Phone/Mobile"
.ColWidth (0) 1200
.ColWidth (1) 2800
.ColWidth (2) 1500
.ColWidth (3) 1500
.ColWidth (4) 2400
End With
cmdedit.Enabled False
End Sub


Private Sub MSFlexGrid1Click ()
With MSFlexGrid1
II Growno ~ .Row %hen

IsAddnew False
.Row .RowSel
txtecode.%ext .%extMatrix (.Row, 0)
FillIorm
End II
End With
End Sub

Private Sub MSFlexGrid1KeyPress (KeyAscii As Integer)
II KeyAscii 13 %hen
With MSFlexGrid1
II Growno ~ .Row %hen
IsAddnew False
.Row .RowSel
txtecode.%ext .%extMatrix (.Row, 0)
FillIorm
End II
End With
End II
End Sub

Private Sub txtdobLostFocus ()
With txtdob
II .%ext "//" %hen Exit Sub
II .%ext ~ "//" %hen
II IsDate (.%ext) False %hen
MsgBox "Enter Correct Date"
.SetFocus
End II
End II
End With

End Sub

Private Sub txtdojLostFocus ()
With txtdoj
II .%ext "//" %hen Exit Sub
II .%ext ~ "//" %hen
II IsDate (.%ext) False %hen
MsgBox "Enter Correct Date"
.SetFocus
End II
End II
End With
End Sub

Private Sub txtecodeLostFocus ()
lblnew.Visible False
II %rim (txtecode.%ext) ~ "" %hen
FillIorm
cmdedit.Enabled %rue
Else
cmdedit.Enabled False
End II
End Sub

Private Sub IillIorm ()
Set rs Nothing
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic

.Open "select * Irom EMP where ecode '" & txtecode.%ext & "'"
II rs.EOF %rue %hen 'Has Not Record
Isnewact %rue
lblnew.Visible %rue: lblnew.Caption "NEW Employee"
cmdcancle.Enabled %rue
.Close
Set rs Nothing
Exit Sub
End II
lblnew.Visible False
Do Until rs.EOF
Isnewact False
II IsNull (rs (0)) False %hen txtecode.%ext rs (0)
II IsNull (rs (1)) False %hen cmbtitle.%ext rs (1)
II IsNull (rs (2)) False %hen txtename.%ext rs (2)
II IsNull (rs (3)) False %hen txtdob.%ext rs (3)
II IsNull (rs (4)) False %hen strsex rs (4)
II strsex "Male" %hen rdmale.Value %rue Else rdIemale.Value
%rue
II IsNull (rs (5)) False %hen strmarital rs (5)
II strmarital "Married" %hen rdmar.Value %rue Else
rdunmar.Value %rue
II IsNull (rs (6)) False %hen cmbreligion.%ext rs (6)
II IsNull (rs (7)) False %hen cmbdesig.%ext rs (7)
II IsNull (rs (8)) False %hen txtgrade.%ext rs (8)
II IsNull (rs (9)) False %hen cmbdept.%ext rs (9)
II IsNull (rs (10)) False %hen txtdoj.%ext rs (10)
II IsNull (rs (11)) False %hen txtsal.%ext rs (11)
II IsNull (rs (12)) False %hen txtexpr.%ext rs (12)
II IsNull (rs (13)) False %hen txtqli.%ext rs (13)
II IsNull (rs (14)) False %hen txtproI.%ext rs (14)

II IsNull (rs (15)) False %hen txtpraddress.%ext rs (15)
II IsNull (rs (16)) False %hen txtprph.%ext rs (16)
II IsNull (rs (17)) False %hen txtpaddress.%ext rs (17)
II IsNull (rs (18)) False %hen txtpaph.%ext rs (18)
'***************************************
'***************************************

rs.MoveNext
Loop
End With
rs.Close
Set rs Nothing
cmdedit.Enabled %rue
End Sub

Private Sub Iillgrid ()
With MSFlexGrid1
.clear
While .Rows ~ 2
.RemoveItem (.Rows)
Wend
.FormatString "Emp Code,Employee Name,Department,Date OI
Joining,Phone/Mobile"
.ColWidth (0) 1200
.ColWidth (1) 2800
.ColWidth (2) 1500
.ColWidth (3) 1500
.ColWidth (4) 2400
End With
Growno 0
II sqlIromstinIorm "" %hen

Set rs conn.Execute ("select ecode, ename, Dept, DOJ, Prph Irom emp")
Else
Set rs conn.Execute (sqlIromstinIorm)
End II
sqlIromstinIorm ""
II rs.BOF %hen
CloseRecordSet
lblnew.Visible %rue: Label3.Caption "It hasn't Any Record."
cmdcancle.Enabled %rue
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid1
Growno Growno 1
II Growno ~ 1 %hen .AddItem ""
.Row Growno
II IsNull (rs (0)) False %hen S%R rs (0) Else S%R " "
.Col 0: .%ext S%R
II IsNull (rs (1)) False %hen S%R rs (1) Else S%R " "
.Col 1: .%ext S%R
II IsNull (rs (2)) False %hen S%R rs (2) Else S%R " "
.Col 2: .%ext S%R
II IsNull (rs (3)) False %hen S%R rs (3) Else S%R " "
.Col 3: .%ext S%R
II IsNull (rs (4)) False %hen S%R rs (4) Else S%R " "
.Col 4: .%ext S%R
End With

rs.MoveNext
Wend
End Sub

Private Sub updateschoolinIodept ()
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select dept, count (dept) Irom emp group by dept"
End With
II rs.BOF %hen
CloseRecordSet
Exit Sub
End II
While Not rs.EOF
conn.Execute ("update schoolinIo set aptdstaII1'" & rs (1) & "'
where deptName'" & rs (0) & "'")
rs.MoveNext
Wend
End Sub

Private Sub updateschoolinIodesig ()
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select desig, count (desig) Irom emp group by desig"
End With
II rs.BOF %hen
CloseRecordSet
Exit Sub
End II

While Not rs.EOF
conn.Execute ("update schoolinIo set aptdstaII2'" & rs (1) & "'
where desigName'" & rs (0) & "'")
rs.MoveNext
Wend
End Sub


Form: - Seat Arrangments
Private Growno As Integer, introw As Integer, inttemp As Integer
Private IsAddnew As Boolean

Private Sub cmbclassClick ()
With cmbclass
Set rs conn.Execute ("select count (adinclass) Irom studentadmission
where adinclass like '" & .%ext & "'")
II rs.BOF %rue %hen
MsgBox 'No any Student here."
Else
lbltns.Caption rs (0)
End II
End With
End Sub



Private Sub cmdcancleClick ()
Growno 0
Introw 0
IsAddnew %rue
EditableRow 0

For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
cnt.%ext ""
End II
Next
With MSFlexGrid1
.clear
While .Rows ~ 2
.RemoveItem (.Rows)
Wend
End With
txtdate.%ext Date
HeadingFlexGrid
lblrno1.Caption ""
lblscap.Caption ""
lblsrno.Caption ""
lblvacant.Caption ""
cmdsave.Enabled False
cmdshow.Enabled %rue
txtdoe.SetFocus

End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub cmdokClick ()
II txtdoe.%ext "//" Or IsDate (txtdoe.%ext) False %hen
MsgBox "Enter valid Date": Exit Sub
End II

For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next
Fillgrid
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
cnt.%ext ""
End II
Next
HeadingFlexGrid
lblrno1.Caption ""
lblscap.Caption ""
lblsrno.Caption ""
lblvacant.Caption ""
txtdoe.%ext "//"
End Sub

Private Sub cmdsaveClick ()

For p 1 %o Growno
S%R "": str1 ""
II editableRow ~ p %hen
With MSFlexGrid1
str "update exam set termend'" & .%extMatrix(p, 0) & "'
,examdate'" & .%extMatrix(p, 1) & "' ,class'" & .%extMatrix(p, 2) & "',
totstud" & .%extMatrix(p, 3) & " ,roomno" & .%extMatrix(p, 4) & ",
seatcap" & .%extMatrix(p, 5) & ", rollIrom" & .%extMatrix(p, 6) & " ,
rollto" & .%extMatrix(p, 7) & ", sit1'" & .%extMatrix(p, 8) & "', sit2'" &
.%extMatrix(p, 9) & "' where termend'" & .%extMatrix(p, 0) & "' and class'"

& .%extMatrix(p, 2) & "' and rollIrom" & .%extMatrix(p, 6) & " and rollto"
& .%extMatrix(p, 7) & ";"
End With
Else
str "insert into exam values ('" & MSFlexGrid1.%extMatrix(p, 0) &
"','" & MSFlexGrid1.%extMatrix(p, 1) & "','" & MSFlexGrid1.%extMatrix(p, 2)
& "'," & MSFlexGrid1.%extMatrix(p, 3) & ", " & MSFlexGrid1.%extMatrix(p,
4) & "," & MSFlexGrid1.%extMatrix(p, 5) & "," &
MSFlexGrid1.%extMatrix(p, 6) & "," & MSFlexGrid1.%extMatrix(p, 7) & ",'"
& MSFlexGrid1.%extMatrix(p, 8) & "','" & MSFlexGrid1.%extMatrix(p, 9) &
"');"
End II
MsgBox S%R
conn.Execute (S%R)
Next
cmdsave.Enabled False
cmdcancleClick
loadgrid
End Sub

Private Sub cmdshowClick ()
cmdcancleClick
loadgrid
End Sub

Private Sub cmdviewClick ()
q 1
Set rs conn.Execute ("SELEC% termend, roomno, class, rollIrom, rollto,
(rollto-rollIrom) 1 as total Irom exam where termend'" & cmbtene.%ext &
"'")
With rptseatarrangment

.Hide
Set .DataSource rs
.DataMember ""
With .Sections ("Section1").Controls
For intCtrl 1 %o .Count
II %ypeOI .Item (intCtrl) Is Rpt%extBox %hen
.Item (intCtrl).DataMember ""
.Item (intCtrl).DataField rs (q).Name
q q 1
End II
Next intCtrl
End With
.Sections ("Section4").Controls.Item (2).Caption rs (0) & 'Exam"
.Sections ("Section5").Controls.Item (1).DataField rs (4).Name
.ReIresh
.Show
End With
End Sub

Private Sub FormActivate ()
loadarraycumcombo
Addclass cmbclass
loadgrid
End Sub

Private Sub FormLoad ()
Growno 0
Introw 0
IsAddnew %rue
EditableRow 0
For p 0 %o 50

ArrIrom (p) " "
Arrto (p) " "
Arrroomno (p) " "
Arrcap (p) " "
arrIilledseat (p) " "
Next

txtdate.%ext Date
With cmbtene
.AddItem "1st %erm"
.AddItem "2nd %erm"
.AddItem "3rd %erm"
.AddItem "4th %erm"
.ListIndex 1
End With
HeadingFlexGrid
lblrno1.Caption ""
lblscap.Caption ""
lblsrno.Caption ""
lblvacant.Caption ""
cmdsave.Enabled False
cmdshow.Enabled False

HeadingFlexGrid
End Sub

Private Sub MSFlexGrid1Click ()
With MSFlexGrid1
II Growno ~ .Row %hen
IsAddnew False
.Row .RowSel

Introw .Row
cmbtene.%ext .%extMatrix (.Row, 0)
txtdoe.%ext .%extMatrix (.Row, 1)
cmbclass.%ext .%extMatrix (.Row, 2)
lbltns.Caption .%extMatrix (.Row, 3)
txtrno.%ext .%extMatrix (.Row, 4)
lblscap.Caption .%extMatrix (.Row, 5)
txtIrno.%ext .%extMatrix (.Row, 6)
txttrno.%ext .%extMatrix (.Row, 7)
lblrno1.Caption txtrno.%ext
' lblsrno.Caption Val (lblscap.Caption) - (Val (txttrno.%ext) - (Val
(txtIrno.%ext) - 1))
txtrnoLostFocus
lblsrno.Caption lblvacant.Caption
' txttrnoLostFocus
'Above two lines is Ior insert value in lblsrno
txtinv1st.%ext .%extMatrix (.Row, 8)
txtinv2nd.%ext .%extMatrix (.Row, 9)
End II
End With
txtdoe.SetFocus
End Sub

Private Sub txtdoeGotFocus ()
SendKeys "Home} End}"
End Sub

Private Sub txtdoeLostFocus ()
II IsDate (txtdoe.%ext) False %hen
'MsgBox "Invalid Exam Date"
'txtdoe.SetFocus

End II
End Sub
Private Sub headingFlexGrid ()
With MSFlexGrid1
.FormatString "%erm End,Date OI Exam,class,No.oI Student,Room
No,Seating Capacity,From Roll No.,%o Roll No,sit1,sit2"
.ColWidth (0) 0
.ColWidth (1) 1400
.ColWidth (2) 800
.ColWidth (3) 1100
.ColWidth (4) 800
.ColWidth (5) 1300
.ColWidth (6) 1100
.ColWidth (7) 1100
.ColWidth (8) 830
.ColWidth (9) 830
End With
End Sub
Private Sub Iillgrid ()
With MSFlexGrid1
II isAddnew False %hen
.Row introw
IsAddnew %rue
Else
Growno Growno 1
II Growno ~ 1 %hen MSFlexGrid1.AddItem ""
.Row Growno
End II
.Col 0
.%ext cmbtene.%ext
.Col 1

.%ext txtdoe.%ext
.Col 2
.%ext cmbclass.%ext
.Col 3
.%ext lbltns.Caption
.Col 4
.%ext txtrno.%ext
.Col 5
.%ext lblscap.Caption
.Col 6
.%ext txtIrno.%ext
.Col 7
.%ext txttrno.%ext
.Col 8
.%ext txtinv1st.%ext
.Col 9
.%ext txtinv2nd.%ext
End With
txtdoe.SetFocus
End Sub

Private Sub txtIrnoGotFocus ()
SendKeys "Home} End}"
End Sub

Private Sub txtIrnoKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46 %hen
Else
KeyAscii 0
Beep
End II

End Sub

Private Sub txtIrnoLostFocus ()
II IsNumeric (txtIrno.%ext) And IsNumeric (lbltns.Caption) %hen
II CInt (txtIrno.%ext) ~ CInt(lbltns.Caption) %hen
MsgBox "Invalid Roll No."
End II
End II
End Sub

Private Sub txtinv1stGotFocus ()
SendKeys "Home} End}"
End Sub

Private Sub txtinv2ndGotFocus ()
SendKeys "Home} End}"
End Sub

Private Sub txtrnoGotFocus ()
SendKeys "Home} End}"
End Sub

Private Sub txtrnoKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46 %hen
Else
KeyAscii 0
Beep
End II
End Sub

Private Sub txtrnoLostFocus ()

II txtrno.%ext ~ "" %hen
For p 0 %o 50
II arrroomno (p) %rim (txtrno.%ext) %hen
lblscap.Caption arrcap (p)
Exit For
End II
Next
With MSFlexGrid1
Inttemp 0
For p 1 %o Growno
.Row p
.Col 4
II .%ext txtrno.%ext %hen
.Col 6: srno .%ext
.Col 7: totno .%ext 1
Inttemp inttemp (totno - srno)
End II
Next
II inttemp 0 %hen
lblvacant.Caption lblscap.Caption
Else
lblvacant.Caption lblscap.Caption - inttemp
End II
End With
End II
End Sub


Private Sub txttrnoGotFocus ()
SendKeys "Home} End}"
End Sub


Private Sub txttrnoKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46 %hen
Else
KeyAscii 0
Beep
End II
End Sub

Private Sub txttrnoLostFocus ()
II lblvacant.Caption "" %hen MsgBox "Please Enter Valid Exam. Room No.":
Exit Sub
II IsNumeric (txttrno.%ext) And IsNumeric (lbltns.Caption) %hen
II CInt (txttrno.%ext) ~ CInt (lbltns.Caption) Or CInt (lblvacant.Caption)
(CInt (txttrno.%ext) - CInt (txtIrno.%ext)) %hen
MsgBox "Invalid Roll No."
Exit Sub
End II
Else
MsgBox "Invalid Roll No."
Exit Sub
End II

With MSFlexGrid1
For p 1 %o .Row
.Row p: .Col 2
II %rim(cmbclass.%ext) .%ext %hen
For totno CInt (txtIrno.%ext) %o CInt (txttrno.%ext)
.Col 6: inttemp CInt (.%ext)
.Col 7
II inttemp totno And CInt (.%ext) ~ totno %hen

MsgBox "Invalid Roll no": Exit Sub
End II
Next
End II
Next
End With
lblrno1.Caption txtrno.%ext
lblsrno.Caption Val (lblvacant.Caption) - (Val (txttrno.%ext) - (Val
(txtIrno.%ext) - 1))
End Sub
Private Sub loadarraycumcombo ()
Set rs conn.Execute ("SELEC% * FROM schoolinIo ", connOpenSnapshot)
II rs.BOF %hen MsgBox "ou Should SpeciIy Class InIormation Iirst",
vbInIormation: Exit Sub
n1 0
Do Until rs.EOF
II IsNull (rs! |roomno|) False %hen
Arrroomno (n1) rs! |roomno|
Arrcap (n1) rs! |cap|
II IsNull (rs! |Iilledseat|) False %hen arrIilledseat (n1) rs!
|Iilledseat| Else arrIilledseat (n1) 0
n1 n1 1
End II
rs.MoveNext
Loop
CloseRecordSet
End Sub
Private Sub loadgrid ()
cmdcancleClick
Set rs New ADODB.Recordset
With rs

.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select * Irom exam where termend like '" & cmbtene.%ext & "';"
End With
II rs.BOF %rue %hen
CloseRecordSet
MsgBox "It hasn't Any Record."
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid1
Growno Growno 1
II Growno ~ 1 %hen
MSFlexGrid1.AddItem ""
End II
EditableRow editableRow 1
.Row Growno
.Col 0: .%ext rs (0)
.Col 1: .%ext rs (1)
.Col 2: .%ext rs (2)
.Col 3: .%ext rs (3)
.Col 4: .%ext rs (4)
.Col 5: .%ext rs (5)
.Col 6: .%ext rs (6)
.Col 7: .%ext rs (7)
.Col 8: .%ext rs (8)
.Col 9: .%ext rs (9)
End With
rs.MoveNext
Wend

rs.Close
Set rs Nothing
cmdsave.Enabled %rue
End Sub

Form: - Marksheet
Private Growno As Integer, introw As Integer, inttemp As Integer
Private %otmrk, totpassmrk As Integer
Private totmrkobtn As Double
Private IsAddnew As Boolean
Private Growno1 As Integer, introw1 As Integer, inttemp1 As Integer
Private isAddnew1 As Boolean

Private Sub cmbpaperKeyUp (KeyCode As Integer, ShiIt As Integer)
II KeyCode 27 %hen 'Ior Escape key
txtpaper.Visible %rue
II cmbpaper.%ext ~ "" %hen txtpaper.%ext cmbpaper.%ext
Ibtnval MsgBox ("Click 'ES' Ior Cancle," & vbCrLI & "Click 'No' Ior
Continue. 'VbesNo vbExclamation, "SAMARPAN")
II ibtnval 6 %hen ' 6 Ior es
Clear
cmdsave.Enabled %rue
lblcancle.Visible False
cmdsave.SetFocus
End II
II ibtnval 7 %hen txtpaper.SetFocus ' 7 Ior No, 2 Ior Cancel
End II
End Sub

Private Sub cmbpaperLostFocus ()
txtpaper.%ext cmbpaper.%ext

txtpaper.Visible %rue
cmbpaper.Visible False
lblcancle.Visible False
End Sub


Private Sub cmbteneClick ()
II txtname.%ext ~ "" %hen
Iillmarksheet
End II
End Sub

Private Sub cmdcancleClick ()
Cancle
txtregno.%ext ""
txtname.%ext ""
txtrollno.%ext ""
End Sub

Private Sub cmddeleteClick ()
II isAddnew False %hen
MSFlexGrid1.RemoveItem (introw)
Growno Growno - 1
IsAddnew %rue
markscount
End II
End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub


Private Sub cmdokClick ()
II %rim (txtpaper.%ext) ~ "" %hen
II isAddnew %rue %hen 'Restriction Ior double entry oI one Subjet
With MSFlexGrid1
For p 1 %o .Row
.Row p: .Col 1
II %rim (UCase (txtpaper.%ext)) %rim (UCase (.%ext)) %hen
MsgBox Chr (34) & .%ext & Chr (34) & 'Subject is allready
added"
txtpaper.%ext ""
txtpaper.SetFocus
Exit Sub
End II
Next
End With
End II

For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext " "
End II
Next
Iillgridmarks
Clear
markscount
txtpaper.SetFocus
End II
End Sub

Private Sub cmdsaveClick ()

conn.Execute ("delete * Irom marksheet where regno '" & txtregno.%ext &
"' and termendexam '" & cmbtene.%ext & "';")
For p 1 %o Growno
S%R ""
With MSFlexGrid1
str "insert into marksheet values ('" & txtregno.%ext & "','" &
cmbtene.%ext & "','" & .%extMatrix(p, 1) & "'," & .%extMatrix(p, 2) & "," &
.%extMatrix(p, 3) & "," & .%extMatrix(p, 4) & ",'" & .%extMatrix(p, 5) & "');"
End With
conn.Execute (S%R)
Next
cmdsave.Enabled False
txtpaper.%ext ""
' cmdcancleClick
cmdcancle.Caption "&Next"

End Sub

Private Sub cmdshowClick ()
II cmbclass.ListIndex ~ 0 %hen sqlqry "select regno, name, rollno, adinclass
Irom studentadmission where adinclass'" & cmbclass.%ext & "'"
Iillgridstudent
End Sub

Private Sub cmdviewClick ()

q 0
Set rs conn.Execute("select
p.regno,p.name,p.adinclass,p.rollno,r.termendexam,r.subject,r.maxmrk,r.pa
ssmrk,r.mrkobtn,r.grade Irom studentadmission p, marksheet r where

p.Regno like '" & %rim(txtregno.%ext) & "' and termendexam like '" &
cmbtene.%ext & "';")
'Set rs conn.Execute ("select subject, maxmrk, passmrk, mrkobtn, grade
Irom marksheet where Regno like '" & %rim (txtregno.%ext) & "' and
termendexam like '" & cmbtene.%ext & "';")
With rptmarksheet
.Hide
Set .DataSource rs
.DataMember ""
With .Sections ("Section4").Controls
For intCtrl 1 %o .Count
II %ypeOI .Item (intCtrl) Is RptLabel %hen
.Item (intCtrl).Caption rs (q)
II q ~ 3 %hen
.Item (intCtrl).Caption rs (q) & 'Exam"
Exit For
End II
q q 1
End II
Next intCtrl
End With
q 5
With .Sections ("Section1").Controls
For intCtrl 1 %o .Count
II %ypeOI .Item (intCtrl) Is Rpt%extBox %hen
.Item (intCtrl).DataMember ""
.Item (intCtrl).DataField rs (q).Name
q q 1
End II
Next intCtrl
End With

.Sections ("Section5").Controls.Item (1).DataField rs (6).Name
.Sections ("Section5").Controls.Item (2).DataField rs (7).Name
.Sections ("Section5").Controls.Item (3).DataField rs (8).Name
.ReIresh
.Show

End With
End Sub


Private Sub FormActivate ()
cmbclass.AddItem "All Class"
Addclass cmbclass
Addsubject cmbpaper
Iillgridstudent
lbltotmrk.Caption "000"
lbltotmrkobtn.Caption "00"
lbltotpasmrk.Caption "00"
End Sub

Private Sub FormLoad ()
sqlqry ""
Growno 0
Introw 0
IsAddnew %rue
Growno1 0
introw1 0
isAddnew1 %rue
txtdate.%ext Date

With cmbtene

.AddItem "1st %erm"
.AddItem "2nd %erm"
.AddItem "3rd %erm"
.AddItem "4th %erm"
.ListIndex 1
End With
headingFlexGrid1
headingFlexGrid2
End Sub
Private Sub headingFlexGrid1 ()
With MSFlexGrid1
.FormatString ",Papers,Max Marks,Pass Marks,Marks Obtained,Grade"
.ColWidth (0) 0
.ColWidth (1) txtpaper.Width
.ColWidth (2) txtmaxmrk.Width - 20
.ColWidth (3) txtpassmrk.Width - 20
.ColWidth (4) txtmrkobtain.Width - 20
.ColWidth (5) txtgrade.Width - 20
End With
End Sub
Private Sub headingFlexGrid2 ()
With MSFlexGrid2
.FormatString "Reg No.,Student Name,Roll No,Class"
.ColWidth (0) 0
.ColWidth (1) 2400
.ColWidth (2) 700
.ColWidth (3) 500
End With
End Sub
Private Sub clear ()
%otmrk 0

%otpassmrk 0
%otmrkobtn 0
txtcode.%ext " "
txtpaper.%ext ""
txtmaxmrk.%ext ""
txtpassmrk.%ext ""
txtmrkobtain.%ext ""
txtgrade.%ext ""
cmbpaper.Visible False
End Sub
Private Sub cancle ()
Clear
Growno 0
Introw 0
IsAddnew %rue
With MSFlexGrid1
.clear
While .Rows ~ 2
.RemoveItem (.Rows)
Wend
End With
lbltotmrk.Caption "000"
lbltotmrkobtn.Caption "00"
lbltotpasmrk.Caption "00"
txtdate.%ext Date
headingFlexGrid1
headingFlexGrid2
End Sub
Private Sub Iillgridmarks ()
With MSFlexGrid1
II isAddnew False %hen

.Row introw
IsAddnew %rue
Else
Growno Growno 1
II Growno ~ 1 %hen MSFlexGrid1.AddItem ""
.Row Growno
End II
.Col 0
.%ext txtcode.%ext
.Col 1
.%ext txtpaper.%ext
.Col 2
.%ext txtmaxmrk.%ext
.Col 3
.%ext txtpassmrk.%ext
.Col 4
.%ext txtmrkobtain.%ext
.Col 5
.%ext txtgrade.%ext
End With
End Sub

Private Sub MSFlexGrid1Click ()
With MSFlexGrid1
II Growno ~ .Row %hen
IsAddnew False
.Row .RowSel
Introw .Row
txtcode.%ext .%extMatrix (.Row, 0)
txtpaper.%ext .%extMatrix (.Row, 1)
txtmaxmrk.%ext .%extMatrix (.Row, 2)

txtpassmrk.%ext .%extMatrix (.Row, 3)
txtmrkobtain.%ext .%extMatrix (.Row, 4)
txtgrade.%ext .%extMatrix (.Row, 5)
End II
End With
End Sub

Private Sub MSFlexGrid2Click ()
With MSFlexGrid2
II Growno1 ~ .Row %hen
isAddnew1 False
.Row .RowSel
introw1 .Row
txtregno.%ext .%extMatrix (.Row, 0)
txtname.%ext .%extMatrix (.Row, 1)
txtrollno.%ext .%extMatrix (.Row, 2)
txtclass.%ext .%extMatrix (.Row, 3)
End II
End With
Iillmarksheet
End Sub

Private Sub txtgradeKeyPress (KeyAscii As Integer)
II KeyAscii 39 %hen
KeyAscii 96
End II
KeyAscii Asc (UCase (Chr (KeyAscii)))
End Sub

Private Sub txtmaxmrkKeyPress (KeyAscii As Integer)

II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46
%hen
Else
KeyAscii 0
Beep
End II
End Sub

Private Sub txtmrkobtainKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46
%hen
Else
KeyAscii 0
Beep
End II
End Sub

Private Sub txtpaperGotFocus ()
cmbpaper.Visible %rue
txtpaper.Visible False
lblcancle.Visible %rue
cmbpaper.SetFocus
End Sub

Private Sub txtpassmrkKeyPress (KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46
%hen
Else
KeyAscii 0
Beep
End II

End Sub

Private Sub txtregnoLostFocus ()
II %rim (txtregno.%ext) ~ "" %hen
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II cnt.Name ~ "txtregno" %hen cnt.%ext ""
End II
Next
IillIromregno
End II
End Sub


Private Sub IillIromregno ()
With MSFlexGrid2
For p 1 %o .Row
.Row p
.Col 0
II %rim (txtregno.%ext) .%ext %hen
MSFlexGrid2Click
Exit For
End II
Next
End With

End Sub

Private Sub Iillgridstudent ()
With MSFlexGrid2
.clear

While .Rows ~ 2
.RemoveItem (.Rows)
Wend
.FormatString "Reg No.,Student Name,Roll No,Class,Section"
.ColWidth (0) 0
.ColWidth (1) 2400
.ColWidth (2) 700
.ColWidth (3) 500
.ColWidth (4) 0
End With
Growno1 0
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
II sqlqry "" %hen
.Open "select regno, name, rollno, adinclass Irom studentadmission"
Else
.Open sqlqry
End II
sqlqry ""
End With
II rs.BOF %hen
CloseRecordSet
cmdsave.Enabled %rue
cmdcancle.Enabled %rue
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid2

Growno1 Growno1 1
II Growno1 ~ 1 %hen .AddItem ""
.Row Growno1
II IsNull (rs (0)) False %hen S%R rs (0) Else S%R " "
.Col 0: .%ext S%R
II IsNull (rs (1)) False %hen S%R rs (1) Else S%R " "
.Col 1: .%ext S%R
II IsNull (rs (2)) False %hen S%R rs (2) Else S%R " "
.Col 2: .%ext S%R
II IsNull (rs (3)) False %hen S%R rs (3) Else S%R " "
.Col 3: .%ext S%R
End With

rs.MoveNext
Wend
End Sub
Private Sub Iillmarksheet ()
Cancle
%otmrk 0
%otpassmrk 0
%otmrkobtn 0
Set rs New ADODB.Recordset
With rs
.ActiveConnection conn
.Cursor%ype adOpenKeyset
.Lock%ype adLockOptimistic
.Open "select * Irom marksheet where Regno like '" & %rim
(txtregno.%ext) & "' and termendexam like '" & cmbtene.%ext & "';"
End With
II rs.BOF %rue %hen
CloseRecordSet

MsgBox "It hasn't Any Record."
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid1
Growno Growno 1
II Growno ~ 1 %hen
MSFlexGrid1.AddItem ""
End II
.Row Growno
.Col 1: .%ext rs (2)
.Col 2: .%ext rs (3): totmrk totmrk CInt (rs (3))
.Col 3: .%ext rs (4): totpassmrk totpassmrk CInt (rs (4))
.Col 4: .%ext rs (5): totmrkobtn totmrkobtn CDbl (rs (5))
.Col 5: .%ext rs (6)
End With
rs.MoveNext
Wend
lbltotmrk.Caption totmrk
lbltotpasmrk.Caption totpassmrk
lbltotmrkobtn.Caption totmrkobtn
rs.Close
Set rs Nothing
cmdsave.Enabled %rue

End Sub
Private Sub markscount ()
Clear
With MSFlexGrid1
For p 1 %o .Row
.Row p

.Col 2: totmrk totmrk CInt (.%ext)
.Col 3: totpassmrk totpassmrk CInt (.%ext)
.Col 4: totmrkobtn totmrkobtn CDbl (.%ext)
Next
End With
lbltotmrk.Caption totmrk
lbltotpasmrk.Caption totpassmrk
lbltotmrkobtn.Caption totmrkobtn

End Sub

Form: - Fee_Details
Dim Iee, prevdues As Single
Private Sub cmbmonthClick ()
II %rim (txtname.%ext) ~ "" %hen
For p 0 %o 15
txtIee (p).%ext ""
Next
txtprevamt.%ext ""
txtchqdate.%ext "//"
Optcash.Value %rue
FillIorm ("select * Irom Ieedetails where regno'" & txtregno.%ext & "'
and class like '" & lblclass.Caption & "' and Ieemonth like '" &
cmbmonth.%ext & "'")
End II
End Sub

Private Sub cmdcancleClick ()
txtregno.%ext ""
Cancel
txtregno.SetFocus

End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub cmdsaveClick ()
II %rim (txtname.%ext) "" %hen
Exit Sub
End II
txtIeeLostFocus (14)
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II %rim (cnt.%ext) "" %hen cnt.%ext "0"
End II
Next
II isnewact %rue %hen
Set rs conn.Execute ("select max (billno) Irom Ieedetails")
Srno CInt (rs (0)) 1
rs.Close
Set rs Nothing
txtbillno.%ext srno
S%R ""
For p 0 %o 15
II p ~ 9 And p 12 %hen
S%R S%R & "'" & txtothIee (p).%ext & "'," & txtIee (p).%ext & ","
Else
S%R S%R & txtIee (p).%ext & ",
End II
Next

sqlqry "insert into Ieedetails values ('" & txtregno.%ext & "','" &
lblclass.Caption & "'," & txtbillno.%ext & ",'" & cmbmonth.%ext & "'," & str &
"'" & txtchq.%ext & "','" & txtbnk.%ext & "','" & txtrmk.%ext & "','" &
txtduedate.%ext & "','" & txtchqdate.%ext & "','" & txtpmtdate.%ext & "');"
Else
sqlqry "update Ieedetails set regIee" & txtIee (0).%ext & ", tuIee" &
txtIee (1).%ext & ", convIee"
& txtIee (2).%ext & ", exmIee" & txtIee (3).%ext & ", scnIee" & txtIee
(4).%ext
& ", consolIee" & txtIee (5).%ext & ", compuIee" & txtIee (6).%ext
& ", devIee" & txtIee (7).%ext & ", libryIee" & txtIee (8).%ext
& ", lateIine" & txtIee (9).%ext & ", oth1Iee'" & txtothIee (10).%ext
& "', oth1Ieevalue" & txtIee (10).%ext & ", oth2Iee'" & txtothIee
(11).%ext
& "', oth2Ieevalue" & txtIee (11).%ext & ", oth3Iee'" & txtothIee
(12).%ext
& "', oth3Ieevalue" & txtIee (12).%ext & ", totamt" & txtIee (13).%ext

& ", amtpaid" & txtIee (14).%ext & ", currentdues" & txtIee (15).%ext
& ", chqno'" & txtchq.%ext & "', bankname'" & txtbnk.%ext & "',
remark'"
& txtrmk.%ext & "', duedate'" & txtduedate.%ext & "', chqdate'" &
txtchqdate.%ext
& "', pmtdate'" & txtpmtdate.%ext & "' where regno'" & txtregno.%ext
& "' and class like '" & lblclass.Caption & "' and Ieemonth like '" &
cmbmonth.%ext & "'"
End II
conn.Execute (sqlqry)
cmdcancle.Caption "&Next"
cmdcancle.SetFocus
End Sub


Private Sub cmdviewClick ()
'Set rs conn.Execute ("select regno, class, regIee, exmIee, scnIee,
pmtdate Irom Ieedetails where regno'" & txtregno.%ext & "' and class like '"
& lblclass.Caption & "' and Ieemonth like '" & cmbmonth.%ext & "'")
Set rs conn.Execute ("select q.name, q.rollno,p.* Irom Ieedetails
p,studentadmission q where p.regno q.regno and p.regno'" & txtregno.%ext
& "' and p.class like '" & lblclass.Caption & "' and p.Ieemonth like '" &
cmbmonth.%ext & "'")
q 0
z 0
With rptIeeDetails
.Hide
Set .DataSource rs
.DataMember ""
With .Sections ("Section1").Controls
For intCtrl 1 %o .Count
II %ypeOI .Item (intCtrl) Is RptLabel %hen
.Item (intCtrl).Caption rs.Fields (q).Name & ':"
q q 1
End II
II %ypeOI .Item (intCtrl) Is Rpt%extBox %hen
.Item (intCtrl).DataMember ""
.Item (intCtrl).DataField rs (z).Name
z z 1
End II
Next intCtrl
Set rs Nothing
End With
.ReIresh
.Show

End With
End Sub

Private Sub FormActivate ()
Fee 0
Isnewact %rue
lblclass.Caption ""
lblroll.Caption ""
txtpmtdate.%ext Date
txtduedate.%ext DateAdd ("m", 1, Date)
txtchqdate.%ext Date
End Sub

Private Sub FormLoad ()
With cmbmonth
.AddItem "January": .AddItem "February": .AddItem "March": .AddItem
"April": .AddItem "May": .AddItem "June": .AddItem "July": .AddItem
"August": .AddItem "September": .AddItem "October": .AddItem "November":
.AddItem "December"
.ListIndex Month (Date) - 1
End With
End Sub

Private Sub Frame2DragDrop (Source As Control, X As Single, As Single)

End Sub

Private Sub OptcashClick ()
Frame5.Visible False
End Sub


Private Sub OptchqClick ()
Frame5.Visible %rue
End Sub

Private Sub txtIeeKeyPress (index As Integer, KeyAscii As Integer)
II KeyAscii ~ 47 And KeyAscii 58 Or KeyAscii 8 Or KeyAscii 46 %hen
Else
KeyAscii 0
Beep
End II
End Sub

Private Sub txtIeeLostFocus (index As Integer)
Fee 0
For p 0 %o 12
II IsNumeric (txtIee (p).%ext) False %hen txtIee (p).%ext 0
Fee Iee CSng (txtIee (p).%ext)
%xtIee (13).%ext prevdues Iee
Next
II IsNumeric (txtIee (13).%ext) False %hen txtIee (13).%ext 0
II IsNumeric (txtIee (14).%ext) False %hen txtIee (14).%ext 0
II index 14 %hen txtIee (15).%ext Val (txtIee (13).%ext) - Val (txtIee
(14).%ext)
End Sub

Private Sub txtregnoLostFocus ()
II %rim (txtregno.%ext) "" %hen prevdues 0: Exit Sub
Cancel
Set rs conn.Execute ("select name, rollno, adinclass, Iname, mname Irom
studentadmission where regno like '" & %rim (txtregno.%ext) & "'")
II rs.BOF %hen

Prevdues 0
MsgBox "Reg. No. '& txtregno.%ext & 'doesn`t exist."
Exit Sub
End II
Do Until rs.EOF
txtname.%ext rs! |Name|
txtIname.%ext rs! |Iname|
txtmname.%ext rs! |mname|
lblclass.Caption rs! |adinclass|
lblroll.Caption rs! |rollno|
rs.MoveNext
Loop
rs.Close
Set rs Nothing
II %rim (txtname.%ext) ~ "" %hen
FillIorm ("select * Irom Ieedetails where regno'" & txtregno.%ext & "'
and class like '" & lblclass.Caption & "' and Ieemonth like '" &
cmbmonth.%ext & "'")
End II
End Sub

Private Sub IillIorm (strtemp As String)
Set rs conn.Execute (strtemp)
II rs.BOF %hen
Isnewact %rue
cmdsave.Caption "&Save"
MsgBox "It hasn't Record"
cmbmonth.SetFocus
Exit Sub
End II
p 0

Do Until rs.EOF
Isnewact False
II IsNull (rs (3)) False %hen txtbillno.%ext rs (2)
II IsNull (rs (23)) False %hen
II %rim (rs (23)) ~ "0" %hen Optchq.Value %rue Else Optcash.Value
%rue
End II
For p 4 %o 13
II IsNull (rs (p)) False %hen txtIee (p - 4).%ext rs (p)
Next
II IsNull (rs (14)) False %hen txtothIee (10).%ext rs (14): txtIee
(10).%ext rs (15)
II IsNull (rs (16)) False %hen txtothIee (11).%ext rs (16): txtIee
(11).%ext rs (17)
II IsNull (rs (18)) False %hen txtothIee (12).%ext rs (18): txtIee
(12).%ext rs (19)
II IsNull (rs (20)) False %hen txtIee (13).%ext rs (20)
II IsNull (rs (21)) False %hen txtIee (14).%ext rs (21)
II IsNull (rs (22)) False %hen txtprevamt.%ext rs (22)
II IsNull (rs (23)) False %hen txtchq.%ext rs (23)
II IsNull (rs (24)) False %hen txtbnk.%ext rs (24)
II IsNull (rs (25)) False %hen txtrmk.%ext rs (25)
II IsNull (rs (26)) False %hen txtduedate.%ext rs (26)
II IsNull (rs (27)) False %hen txtchqdate.%ext rs (27)
II IsNull (rs (28)) False %hen txtpmtdate.%ext rs (28)
rs.MoveNext
Loop
rs.Close
Set rs Nothing
cmdsave.Caption "&Edit"
cmbmonth.SetFocus

End Sub
Private Sub Cancel ()
Fee 0
Prevdues 0
For Each cnt In Me.Controls
II %ypeOI cnt Is %extBox %hen
II cnt.Name ~ "txtregno" %hen cnt.%ext ""
End II
Next
Optcash.Value %rue
txtduedate.%ext DateAdd ("m", 1, Date)
txtchqdate.%ext "//"
txtIname.%ext ""
txtmname.%ext ""
txtname.%ext ""
cmdsave.Caption "&Save"
lblclass.Caption ""
lblroll.Caption ""
End Sub

Form: - frmDueslist
Private Sub cmbmonthClick ()
Fillgrid
End Sub

Private Sub cmdexitClick ()
Unload Me
End Sub

Private Sub cmdviewClick ()
q 1

X 0
'Dim totaldues As Integer
Set rs conn.Execute ("SELEC% p.Ieemonth, p.regno, q.name, p.class,
p.currentdues Irom studentadmission q, Ieedetails p where p.regnoq.regno
and Ieemonth'" & %rim (cmbmonth.%ext) & "'")
With rptdueslist
.Hide
Set .DataSource rs
.DataMember ""
With .Sections ("Section1").Controls
For intCtrl 1 %o .Count
II %ypeOI .Item (intCtrl) Is Rpt%extBox %hen
.Item (intCtrl).DataMember ""
.Item (intCtrl).DataField rs (q).Name
q q 1
End II
Next intCtrl
End With
.Sections ("Section4").Controls.Item (2).Caption rs (0)
.Sections ("Section5").Controls.Item (1).DataField rs (4).Name
.ReIresh
.Show
End With

'Dim totaldues As Integer
'Set rs conn.Execute ("SELEC% p.regno, q.name, p.class, p.currentdues
Irom studentadmission q, Ieedetails p where p.regnoq.regno and
Ieemonth'" & %rim (cmbmonth.%ext) & "'")
' With rptdueslist
' .Hide
' Set .DataSource rs

' .DataMember ""
' With .Sections ("Section1").Controls
' For intCtrl 1 %o .Count
' II %ypeOI .Item (intCtrl) Is Rpt%extBox %hen
' .Item (intCtrl).DataMember ""
' .Item (intCtrl).DataField rs (q).Name
' q q 1
' End II
' II %ypeOI .Item (1) Is RptLabel %hen
' .Item (1).Caption X 'rs.Fields(X).Name & ':"
' X X 1
' End II
' rptdueslist.Sections ("Section1").Label7.Caption q
' Next intCtrl
' End With
' .Sections ("Section5").Controls.Item (1).DataField rs(3).Name
' .ReIresh
' .Show
' End With

End Sub


Private Sub FormLoad ()
With cmbmonth
.AddItem "January": .AddItem "February": .AddItem "March": .AddItem
"April": .AddItem "May": .AddItem "June": .AddItem "July": .AddItem
"August": .AddItem "September": .AddItem "October": .AddItem "November":
.AddItem "December"
.ListIndex Month (Date) - 1
End With


With MSFlexGrid1
.FormatString ",Regno,Name,Class,Dues"
.ColWidth (0) 0
.ColWidth (1) .Width / 4 - 850
.ColWidth (2) .Width / 4 550
.ColWidth (3) .Width / 4 10
.ColWidth (4) .Width / 4
End With
Fillgrid
End Sub
Private Sub Iillgrid ()
With MSFlexGrid1
.clear
While .Rows ~ 2
.RemoveItem (.Rows)
Wend
.FormatString ",Regno,Name,Class,Dues"
.ColWidth (0) 0
.ColWidth (1) .Width / 4 - 850
.ColWidth (2) .Width / 4 550
.ColWidth (3) .Width / 4 10
.ColWidth (4) .Width / 4
End With
Growno 0
%otdues 0
Set rs conn.Execute ("SELEC% p.regno, q.name, p.class, p.currentdues
Irom studentadmission q, Ieedetails p where p.regnoq.regno and
Ieemonth'" & %rim (cmbmonth.%ext) & "'")
II rs.BOF %hen
MsgBox "It Has not Record"

CloseRecordSet
Exit Sub
End II
While Not rs.EOF
With MSFlexGrid1
Growno Growno 1
II Growno ~ 1 %hen .AddItem ""
.Row Growno
II IsNull (rs (0)) False %hen S%R rs (0) Else S%R " "
.Col 1: .%ext S%R
II IsNull (rs (1)) False %hen S%R rs (1) Else S%R " "
.Col 2: .%ext S%R
II IsNull (rs (2)) False %hen S%R rs (2) Else S%R " "
.Col 3: .%ext S%R
II IsNull (rs (3)) False %hen S%R rs (3) Else S%R " "
.Col 4: .%ext S%R
II IsNumeric (rs (3)) %rue %hen totdues totdues Val (rs
(3))
End With
rs.MoveNext
Wend
%ext3.%ext "Rs. & Format (totdues, "#0.00")
End Sub











ibliography and References

(1) Mastering Visual Basic 6.0 Evagelos Petroutsos,
(BPB Publication)

(2) SQL Server 7 Developer`s Guide Michel Otey and Paul Conte,
(TATA McGraw Hill Publication)

(3) System Analysis and Design JeIIery Whitten, Lonni D Bentley
and Kelvin C Dittman,
(BPB Publication)

(4) SoItware Engineering Ian Sommerville
(Low Price Edition)

You might also like