[Link]
com
PROJECT REPORT ON
Library Management System
ACKNOWLEDGEMENT
I take this precious opportunity to express my
gratitude toward “LIBRARY MANAGEMENT
SYSTEM” to grant is permission for under going the
training project. Without it’s willingness to permit
this project would not have been succeed.
First of all, I would like to thanks all those
people who helped me directly or indirectly to
complete my project whenever I found my self in
problems. Our all faculties encourages me and due to
their kindness and helpful nature and help I got very
much confidence to complete this project.
I am deeply inherited who devoted his precious
time in giving me the information about the various
aspect and gave support and guidance at every point
of time. I am really thankful to their kind and
[Link]
supportive nature. His inspiring nature has always
made my work easy.
Last but not least, I would like to express my
gratitude to those persons who directly or indirectly
helped in my project.
PREFACE
The field of computer education has witnessed a
sea change since the discovery of simple calculating
machine by CHARLES BABAGE. The era is
confronting with the speed and mind of computer, i.e.
the speed and intelligence have become vital. At one
end they are competing with each other. Not only
these computers have immensely benefited the
mankind in the field of planning. The wheel of
progress is rolling with much faster speed then it used
to be a decade ago; thank to the revolution ushered in
by computer. But all this haven’t come as easy as it
appears to be rather it requires planning strategy and a
lot of brain storming before a package is developed or
a language is born.
Since the prime task of the computer is to
process a raw data into useful information, we can
ignore the basic step of information collection ret
rival and processing at our risk only. The importance
of finding the right information in the possible least
time as well know to us.
ABSTRACT
Maintaining records of application for estates, the
manual system is too complex and cumbersome.
Since time and resources available we have been
proposed to develop an inventory system.
All the outset the application requirements were
studied and analysis and design were carried out. The
development platform and software tool were
identified as Visual Basic 6.0 (As Front-End) and
Access (As Back-End) database. Using visual
programming, object are manipulated directly and
also due to the feature of fast and easy prototyping
and GUI building visual basic 6.0 as used.
In the system analysis and design part, data is
processed using query techniques and study of the
existing system.
During the development phase various option are
developed like master menu. transaction menu, report
generation, utility etc.
The detail of the programming steps followed
and important clauses incorporated in the screen are
described in documents.
Why Visual Basic Programming
Using visual programming objects are
manipulated directly, By Highlighting; point and
cliking specific properties can relate to physical
appearance (color, shading, fonts, size and so on).
Most widely used objects oriented, graphical
programming language for window development are:
Visual Basic
Power Builder
Forms 5.0 / 6.0
We have selected one of the most widely
used object oriented, graphical programming
language for window development Visual Basic.
Selection of visual basic based on following
strengths:
Fast and easy prototyping and GUI building.
Fully functional, real window application
building.
Excellent DDE and DDL support and client
OLE.
MDI support.
Easy Dialog Box Construction.
Easy Menu Generation supporting Short –
cut key.
INTRODUCTION OF VISUAL BASIC
Visual Basic Editions:
Visual Basic is available in three versions, each
generate to meet a specific set of development
requirement.
The visual basic learning edition.
The professional edition.
The enterprise edition.
VISUAL BASIC AND DATABASE
Visual Basic can be used to build very complex
application. Visual Basic effective software that can
perform all essential management function. It can be
used to:
Create data table and store data in them.
Edit data records.
Retrieve data selectively from stored records
to provide specific information.
Prepare printed information retrieval reports.
Perform calculation.
Create screens that can interact with users.
Visual Basic provides a wide verity of data
access alternatives, for working with local and remote
database, including enterprise level three-tiered
client/server application.
-: INTRODUCTION TO ACCESS :-
Database : What they are? And how they work?
A database is collection of information related to
particular or purpose such as tracking customer orders
or maintaining a music collection. If your database
isn’t stored on a computer or only parts of it are, you
may be tracking information from variey of source
that you have to coordinate and organize your self.
Using it, you can manage all our information
from single database file. Within file divide your data
using into separate storage containers called tables;
view, add, and update table data using forms; find and
retrieve just the data you want using queries and
analyze or print data in specific layout using reports.
To find and retrieve just data that meet condition
you specify including data from multiple tables create
a query. A query can also update multiple records at
the same time and perform built-in or custom
calculations on your data. To easily view, enter and
change directly in a table, create a form. When you
open a form, it retrives the data from one or more
tables and display it on screen using the data from
you chose in the form using a layout that you creted
from scratch.
To analyze your data present it a certain way
in print, create a report. For exmple, you might print
one report that raw material and calculates totals.
TABLES :
A tables is a collection of data about a
specific topic, such as products or suppliers. Using as
separate table for each topic means you store that data
only once which makes your database more efficient
and reduces dataentry errors. Table organize data into
columns and rows.
In table datasheet view, you can add, edit or
view the data in a table. You can also check the
spelling and print your tables data filter or sort
records change the datasheet’s appearance or change
the table’s structure by adding or deleting columns.
You can create an entire table from scratch, or add,
delete, or customize an existing tables fields.
QUERIES:
You use queries to view, change and analyze
data in different ways. You can also use them as the
source of records for froms and report. The most
common type of query is a select query. A select
query retrieves data from one or more tables using
criteria you specify and then display it in the order
you want.
ADVANTAGES OF ACCESS :-
More Reliable than other RDBMS.
Easy to use and learn.
Data security is high.
Updating database.
Support ODBC , ADO data
programming objects.
Disadvantages of Manual System:-
The manual system required more time
for processing.
The processing is very lengthy.
It require more clerical work.
The manual system is more error prone.
Manual system is costly.
Immediate response to the quires is
difficulty and time consuming.
It is not possible to create quick report.
Mathematical calculation done
manfully.
No authentication measures.
Need for computerized system:-
The main draw back of the existing system is that
manual work leads time consumption. It affects the all
person of management and also the departments.
There is number of day-by-day transactions and hence
the large number of register have to the kept to
circulation, which have to the stored. Also large
numbers of register have to the kept to the store. This
document is required more storing space, more
manpower and job become tedious. Sometime
gathering of all documents is a tedious job.
In this system process of summary report in
main part, using the computerized system this process
is become simple and small. You can immediately
getting the report for the query. You can get this all
report or summary for the previous year. Various
year. Various details have to the providing to the
management at any time.
System Attributes And Quality
Characteristic:
Security:-
The system is designed keeping in view that
chances of unauthorized use are made neligible. In the
design depending upon the user, they are entitled with
specific required right only. Only the Administrator
will be able to create new users. He is the only person
having full access of main database. As sequrity is a
crucial characteristic, it is treated according in this
system.
Portability:-
The designed system must operate on different
version of OS viz. Windows 98, NT, XP etc. Proper
care is taken at the time of design and coding so that
it
will execute and run property. To assure portability of
the system, backward compatibility up to a certain
level will also be maintained.
Reliability:-
Following tests will be performed to assure
reliability of the system.
Simulation Test.
Memory Test.
Path Test.
Loop Test.
Random Data Test.
OS Compatibility Test.
Hardware Compatibility Test.
Data Test.
The above listed test are carried out at development
site, installation site and during the development
process as per the requirement. The multiple waterfall
modules during the development of the project will
assure minimum risk.
Application Requirement:
User Platform: PC/Pentium
Operating System: Windows2000
Development Tools: Visual Basic6.0
Database: Access
ACCESS TABLE’S DETAIL’S:
TABLE – 1 : LOGIN_MAST (User
Information)
FIELD NAME DATA TYPE & DESCRIPTION
(SIZE)
Usr Text (20) User Name
Pw Text (20) User Password
Typ Text (1) Type of User
TABLE=>2 BOOK_MAST (Store Book
FIELD NAME DATA TYPE & DESCRIPTION
(SIZE)
Code Text (6) Book/CD Code
Title Text (30) Title of Book/Cd
Author Text (20) Auther of book(s)
Publisher Text (20) Publisher of Book
Pur_Dt Date/Time Purchase Date
Price Currency Price of Book/Cd
(Standard)
Qty Number (Long int.) Book/Cd Quantity
Pur_From Text (50) Purchase From
IsudBk Number (Long int) Quantity of issued
Book/cd
details)
TABLE=>3 MBR_MAST (Store Master
details)
FIELD NAME DATA TYPE & DESCRIPTION
(SIZE)
Code Text (10) Member No
Surname Text (50) Surname
Member Text (50) Member Name
Father Text (50) Father Name
Join_Dt Date/Time Join Date
Address Memo Member Address
City Text (20) City
Crs Text (10) Course
Yer Text (10) Year of Course(FY,
SY, TY,
SEM1,etc...)
Cnt_No Text (50) Contect Number
Gender Text (1) Sex
Fee Currency Membership Fee
(Standard)
Fine Currency Fine on late
(Standard) submission
TABLE=>4 FINE_MAST (Store Fine detail)
FIELD NAME DATA TYPE DESCRIPTION
Crs Text (10) Course
Yer Text (10) Year of study
Mbr_No Text (6) Member Number
Bk_No Text (6) Book Number
Fine Currency Fine for late
(Standard) submission, Datmage
etc...
Fin_Dt Date/Time Date of Fine
TABLE=>5 ISSUE_MAST (Store Issue
Details)
FIELD NAME DATA TYPE & DESCRIPTION
(SIZE)
Mbr_No Text (6) Member No
Crs Text (10) Student Course or Staff
Yer Text (10) Year of Study
Bk_No Text (6) Book No.
Isu_Dt Date/Time Issue Date
Lst_Dt Date/Time Last Submit Date
V.B.
FORM
DESIGN
&
CODDING
FORM - 1 : WELCOME FORM
([Link])
CODE : WELCOME FORM ([Link])
Private Sub Form_Resize( )
[Link] = [Link]
[Link] = [Link]
[Link] = ([Link] / 2 -
[Link] / 2) - 120
[Link] = [Link] / 2 - [Link]
/2
[Link] = ([Link] / 2 - [Link] / 2) +
60
[Link] = [Link] / 2 - [Link] / 2
[Link] = [Link] / 2 - [Link] / 2
[Link] = ([Link] / 2 - [Link] / 2) + 60
[Link] = [Link] / 2 - [Link] / 2
[Link] = ([Link] / 2 - [Link] / 2) + 60
End Sub
Private Sub Img1_Click( )
[Link]
[Link] = False
End Sub
Private Sub LblWelcome1_Click( )
[Link]
[Link] = False
End Sub
Private Sub Timer1_Timer( )
[Link] vbModal
[Link] = False
End Sub
FORM - 2 : LOGIN FORM ([Link])
CODE : LOGIN FORM ([Link])
Dim rs_user As New Recordset
Private Sub CmdCancel_Click()
End
End Sub
Private Sub CmdLogin_Click()
bkType = "BOOK"
userType = "L"
Class = "BBA": Yer = "FY"
If Trim(TxtUser) = "" And Trim(TxtPwd) = "" Then
MsgBox "Fill all the details", vbInformation, "Login"
[Link]
Exit Sub
End If
If TxtUser = "LIBRARY" And TxtPwd = "INDISOFT" Then
userType = "L"
userNm = "LIBRARY"
Unload FrmWelcome
Unload FrmLogin
[Link]
Exit Sub
End If
If rs_user.RecordCount <> 0 Then
rs_user.MoveFirst
rs_user.Find "usr = '" & TxtUser & "'"
If Not rs_user.EOF Then
If rs_user.Fields(1) = TxtPwd Then
userType = rs_user.Fields(2)
userNm = rs_user.Fields(0)
Unload FrmWelcome
Unload FrmLogin
[Link]
Exit Sub
Else
MsgBox "Wrong username or password.", vbCritical,
"Login"
[Link]
Exit Sub
End If
Else
MsgBox "Wrong username or password.", vbCritical,
"Login"
[Link]
Exit Sub
End If
Else
MsgBox "Wrong username or password.", vbCritical,
"Login"
[Link]
Exit Sub
End If
End Sub
Private Sub Form_Load()
'OPEN RECORDSET
rs_user.Open "select * from Login_Mast", conn,
adOpenStatic, adLockPessimistic
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs_user.Close
End Sub
Private Sub TxtPwd_GotFocus()
Call selectTxt(TxtPwd)
End Sub
Private Sub TxtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
End If
KeyAscii = upper(KeyAscii)
End Sub
Private Sub TxtUser_GotFocus()
Call selectTxt(TxtUser)
End Sub
Private Sub TxtUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
End If
KeyAscii = upper(KeyAscii)
End Sub
FORM – 3 : MDI FORM ([Link])
FORM – 3 : MDI FORM ([Link])
Option Explicit
Dim rs As New [Link]
Dim FL As String 'TO STORE FILE NAME
Dim rpt As String
Private Sub CmdBkEntry_Click()
Call MnuBkOpr_Click
End Sub
Private Sub CmdBkRpt_Click()
Dim str As String
str = InputBox("Enter BOOK for Book report and CD for Cd
report", "Report Creation", "BOOK")
If str = "BOOK" Then
Call MnuBkRpt_Click
ElseIf str = "CD" Then
Call MnuCdRpt_Click
Else
MsgBox "Invalid input.", vbCritical, "Report Creation"
End If
End Sub
Private Sub CmdBkSubISu_Click()
Call MnuBkIsuSub_Click
End Sub
Private Sub CmdExit_Click()
End
End Sub
Private Sub CmdIsuDtl_Click()
Call MnuBkIsuDtl_Click
End Sub
Private Sub CmdIsuRpt_Click()
Call mnuIsuRpt_Click
End Sub
Private Sub CmdMbrEntry_Click()
Call MnuMbrOpr_Click
End Sub
Private Sub CmdMbrRpt_Click()
Call MnuMbrRpt_Click
End Sub
Private Sub CmdUAcc_Click()
Call MnuUmgAcc_Click
End Sub
Private Sub LblClose_Click()
[Link] = False
End Sub
Private Sub MDIForm_Load()
'CHECK USER TYPE
If userNm = "LIBRARY" Then
[Link] = False
[Link] = False
End If
If userType = "L" Then
[Link] = False
[Link] = False
[Link] = False
End If
End Sub
Private Sub MDIForm_Resize()
'RESIZE STATUS BAR
If [Link] > 1000 And [Link] > 1000 Then
[Link](1).Width = [Link] * 0.5
[Link](2).Width = [Link] * 0.11
[Link](3).Width = [Link] * 0.11
[Link](4).Width = [Link] * 0.11
[Link](5).Width = [Link] * 0.11
[Link](6).Width = [Link] * 0.05
[Link](1) = "Current User : " & userNm & "(" &
userType & ")"
End If
'ARRANGE PICTURE BOX AND OTHER COMMAND
BUTTONS
[Link] = [Link]
If [Link] >= 8100 And [Link] >= 11500 Then
'MAKE LABLE TO CENTER
[Link] = [Link] / 2 - [Link] / 2
'SET ALL COMMAND BUTTONS AND FRAME
[Link] = [Link] / 2 - [Link] / 2
[Link] = [Link] / 2 - [Link] / 2
[Link] = [Link] - [Link] - 500
[Link] = [Link] + [Link] + 500
'SET COMMAND BUTTON TO CENTER
[Link] = [Link] / 2 - [Link] / 2
[Link] = [Link] - 1500
[Link] = [Link] - 2500
End If
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
End
End Sub
Private Sub MnuAbtLib_Click()
[Link] = False
[Link] vbModal
End Sub
Private Sub MnuBkIsuDtl_Click()
[Link] = False
[Link]
End Sub
Private Sub MnuBkIsuSub_Click()
[Link] = False
[Link]
End Sub
Private Sub MnuBkOpr_Click()
[Link] = False
[Link]
End Sub
Private Sub MnuBkRpt_Click()
Call BookCdReport("BOOK") 'GENERATE REPORT
End Sub
Private Sub MnuCdRpt_Click()
Call BookCdReport("CD") 'GENERATE REPORT
End Sub
Private Sub mnuIsuRpt_Click()
[Link] = False
Report = "I" 'I means Issue Report
[Link] vbModal
End Sub
Private Sub MnuMbrOpr_Click()
[Link] = False
[Link]
End Sub
Private Sub MnuMbrRpt_Click()
[Link] = False
Report = "M" 'M means Member Report
[Link] vbModal
End Sub
Private Sub MnuMstrSelection_Click()
[Link] = True
End Sub
Private Sub MnuUmgAcc_Click()
[Link] = False
[Link] vbModal
End Sub
Private Sub MnuWinClose_Click()
Do While [Link] - 1 > 0
Unload [Link]
Loop
End Sub
Private Sub MnuWinCscd_Click()
Arrange vbCascade
End Sub
Private Sub MnuWinHrz_Click()
Arrange vbHorizontal
End Sub
Private Sub MnuWinVrtl_Click()
Arrange vbVertical
End Sub
'================================================
==='GENERATE REPORT FOR BOOK/CD (PROCEDURE)
Private Sub BookCdReport(typ As String)
Set rs = New Recordset
If typ = "BOOK" Then
[Link] "SELECT Code,Title,Author,Price,Qty FROM
Book_Mast WHERE Code like 'B%'", conn,
adOpenStatic, adLockReadOnly
Else
[Link] "SELECT Code,Title,Author,Price,Qty FROM
Book_Mast WHERE Code like 'C%'", conn,
adOpenStatic, adLockReadOnly
End If
'WHEN NO RECORD EXIST
If [Link] = 0 Then
[Link]
MsgBox "No record is found.", vbInformation, "Member
Report"
Exit Sub
End If
'CREATE REPORT
'OPEN FILE
FL = typ & "_" & Format(Date, "dd-mm-yyyy")
Open [Link] & "\Reports\" & FL & ".txt" For Output As #1
Print #1, ""
Print #1,
"
"
If typ = "BOOK" Then
Print #1, "---------------------------- B O O K S R E P O R T
"
Else
Print #1, "------------------------------- C D R E P O R T
"
End If
Print #1,
"
"
Print #1, ""
Print #1, " Date : " & Format(Date, "dd-mm-yyyy")
Print #1, ""
Print #1,
"
"
Print #1, " CODE TITLE AUTHOR
PRICE QUANTITY "
Print #1,
"
"
[Link]
Do While Not [Link]
Print #1, " " & rs!Code & " " & _
rs!title & Space(31 - Len(rs!title)) & _
rs!Author & Space(22 - Len(rs!Author)) & _
Space(6 - Len(rs!Price)) & rs!Price & _
Space(11 - Len(rs!qty)) & rs!qty
Print #1, ""
[Link]
Loop
[Link]
Close #1
MsgBox FL & ".txt created successfully.", vbInformation,
"Member Report"
Shell [Link] & "\Reports\[Link] " & [Link] &
"\Reports\" & FL & ".txt", vbMaximizedFocus
End Sub
FORM – 4 : USER MANAGEMENT
(FrmUserMng)
CODE : USER MANAGEMENT
([Link])
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdCreateAcc_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub CmdDeleteAcc_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub CmdEditAcc_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub Form_Load()
If userType = "L" Then
[Link] = False
[Link] = False
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If [Link] = 2 Then
[Link] = True
End If
End Sub
FORM – 5 : CREATE NEW USER
(FrmCreateAcc)
CODE : CREATE NEW USER (FrmCreateAcc)
Dim rs_user As New [Link]
Private Sub CmdBack_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdCreateAcc_Click()
Dim Query As String, typ As String
If Trim([Link]) = "" Or Trim(TxtPwd) = "" Or
Trim(TxtConfPwd) = "" Then
MsgBox "All fields are compulsory.", vbInformation,
"User Addition"
Exit Sub
ElseIf Trim(TxtPwd) <> Trim(TxtConfPwd) Then
MsgBox "Your confirm password do not match." & vbCrLf
&_
"Type your confirm password again.", vbCritical, "User
Addition"
[Link]
Exit Sub
End If
'DUPLICATION CHECK
rs_user.MoveFirst
rs_user.Find "usr='" & TxtUser & "'"
If rs_user.EOF Then 'USER NOT EXIST
If [Link] = "ADMIN" Then
typ = "A"
Else
typ = "L"
End If
Query = "insert into Login_Mast values ('" & TxtUser & "','"
&_
TxtPwd & "','" & typ & "')"
MsgBox Query
[Link] Query
MsgBox "New user is successfully added.", vbInformation,
"User Addition"
TxtUser = ""
TxtPwd = ""
TxtConfPwd = ""
[Link]
Call Form_Load
Else 'USER IS ALREADY EXIST
MsgBox "User already exit. Enter another user name.",
vbCritical, "User Additon"
[Link]
End If
End Sub
Private Sub Form_Load()
[Link] = False
'OPEN RECORDSET
If rs_user.State = 1 Then rs_user.Close
rs_user.Open "select * from Login_Mast", conn,
adOpenStatic, adLockPessimistic
'CLEAR TEXT BOX
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = [Link](0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs_user.Close
End Sub
Private Sub TxtConfPwd_GotFocus()
Call [Link](TxtConfPwd)
End Sub
Private Sub TxtConfPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtPwd_GotFocus()
Call [Link](TxtPwd)
End Sub
Private Sub TxtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtUser_GotFocus()
Call [Link](TxtUser)
End Sub
Private Sub TxtUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
FORM – 5 : CHANGE USER NAME
(FrmEditAcc)
FORM - 6 : CHANGE PASSWORD
(FrmEditAcc)
CODE – 5 : CHANGE USER NAME &
CHANGE PASSWORD
(FrmEditAcc)
Dim rs_user As New [Link]
Dim Query As String
Private Sub CmdBack_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdPwd_Click()
'CHECKING FOR BLANCK TEXT BOXES
If Trim(TxtUser) = "" Or Trim(TxtCurPwd) = "" Or
Trim(TxtNewPwd) = "" Or Trim(TxtConfPwd) = "" Then
MsgBox "All fields are compulsory.", vbInformation,
"Change Password"
Exit Sub
End If
'CHECKING FOR NEW PASSWORD & CONF. PASSWORD
MATCHING
If TxtNewPwd <> TxtConfPwd Then
MsgBox "Your confirm password do not match." & vbCrLf
& "Enter confirm password again.", vbCritical,
"Change Password"
Exit Sub
End If
If userType = "A" Then
'WHEN USER IS ADMIN
'FIND USER IS EXIST OR NOT
rs_user.MoveFirst
rs_user.Find "usr='" & TxtUser & "'"
If rs_user.EOF Then 'USER NOT EXIST
MsgBox "User name does not exixt." & vbCrLf & _
"Enter current name again.", vbCritical, "Change
Password"
[Link]
Exit Sub
End If
'IF USER AND PASSWORD NOT MATCH
If rs_user.Fields(1) <> TxtCurPwd Then
MsgBox "Your current password do not match. Enter it
again.", vbCritical, "Change Password"
[Link]
Exit Sub
End If
Query = "update Login_Mast set pw='" & TxtNewPwd &
"' where usr='" & TxtUser & "'"
Else
'WHEN USER IS LIMITED
If TxtUser <> userNm Then
MsgBox "Your user name not match. Enter it again.",
vbCritical, "Change Password"
Exit Sub
End If
rs_user.MoveFirst
rs_user.Find "usr='" & TxtUser & "'"
'IF USER AND PASSWORD NOT MATCH
If rs_user.Fields(1) <> TxtCurPwd Then
MsgBox "Your current password do not match. Enter it
again.", vbCritical, "Change Password"
[Link]
Exit Sub
End If
Query = "update Login_Mast set pw='" & TxtNewPwd &
"' where usr='" & TxtUser & "'"
End If
'UPDATE PASSWORD
[Link] Query
MsgBox "Your password is changed successfully.",
vbInformation, "Change Password"
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link]
End Sub
Private Sub CmdUser_Click()
Dim typ As String
typ = userType
If Trim(TxtCurUser) = "" Or Trim(TxtNewUser) = "" Then
MsgBox "All fields are compulsory.", vbInformation,
"Change User"
Exit Sub
End If
If userType = "A" Then
'WHEN USER IS ADMIN
'FIND USER IS EXIST OR NOT
rs_user.MoveFirst
rs_user.Find "usr='" & TxtCurUser & "'"
If rs_user.EOF Then 'USER NOT EXIST
MsgBox "User name does not exixt." & vbCrLf & _
"Enter current name again.", vbCritical, "User Edition"
[Link]
Exit Sub
End If
If [Link] = "ADMIN" Then
typ = "A"
Else
typ = "L"
End If
'WHEN CURRENT USER IS CHANGING ACCOUNT
If (TxtCurUser = userNm) And (userType <> typ) Then
MsgBox "You can not change your account type." &
vbCrLf & _
"Login with another Admin user and then change your
account type.", vbInformation, "User Edition"
Exit Sub
End If
Query = "update Login_Mast set usr='" & TxtNewUser &
"',typ='" & _
typ & "' where usr='" & TxtCurUser & "'"
Else
'WHEN USER IS LIMITED
If userNm <> TxtCurUser Then
MsgBox "Your current name is not correct." & vbCrLf & _
"Enter current name again.", vbCritical, "User Edition"
[Link]
Exit Sub
End If
Query = "update Login_Mast set usr='" & TxtNewUser & "'
where usr='" & userNm & "'"
End If
'CHECK FOR DUPLICATE RECORD
rs_user.MoveFirst
rs_user.Find "usr='" & TxtNewUser & "'"
If (rs_user.EOF = False) And (userNm <> TxtNewUser) Then
MsgBox "User already exixt. Enter another user name.",
vbCritical, "User Edition"
Exit Sub
End If
'EXECUTE QUERY & UPDATE RECORD
[Link] Query
MsgBox "User name is changed successfully.",
vbInformation, "User Edition"
If TxtCurUser = userNm Then
userNm = [Link]
userType = typ
[Link](1) = "Current User : " &
userNm & "(" & userType
& ")"
End If
[Link] = ""
[Link] = ""
[Link]
End Sub
Private Sub Form_Load()
[Link] = False
Call TabEditAcc_Click(0) 'SELECT TAB 1
'CLOSE RECORDSET IF OPEN
If rs_user.State = 1 Then rs_user.Close
'OPEN RECORDSET
rs_user.Open "select * from Login_Mast", conn,
adOpenStatic, adLockPessimistic
End Sub
Private Sub TabEditAcc_Click(PreviousTab As Integer)
If [Link] = 0 Then
[Link] = False
[Link] = True
[Link] = True
'[Link] = [Link](0)
TxtCurUser = ""
TxtNewUser = ""
If userType = "L" Then
[Link] = False
[Link] = "LIMITED"
Else
[Link] = "ADMIN"
End If
Else
[Link] = True
[Link] = False
[Link] = True
TxtUser = "": TxtCurPwd = ""
TxtNewPwd = "": TxtConfPwd = ""
End If
End Sub
Private Sub TxtConfPwd_GotFocus()
Call [Link](TxtConfPwd)
End Sub
Private Sub TxtConfPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtCurPwd_GotFocus()
Call [Link](TxtCurPwd)
End Sub
Private Sub TxtCurPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtCurUser_GotFocus()
Call [Link](TxtCurUser)
End Sub
Private Sub TxtCurUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtNewPwd_GotFocus()
Call [Link](TxtNewPwd)
End Sub
Private Sub TxtNewPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtNewUser_GotFocus()
Call [Link](TxtNewUser)
End Sub
Private Sub TxtNewUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtUser_GotFocus()
Call [Link](TxtUser)
End Sub
Private Sub TxtUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then
KeyAscii = 0
End If
KeyAscii = [Link](KeyAscii)
End Sub
FORM – 7 : DELETE USER (FrmUserDelete)
CODE : DELETE USER (FrmUserDelete)
Dim rs_user As New [Link]
Dim rs_tmp As New [Link]
Private Sub CmdBack_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdDelete_Click()
Dim Query As String, cnt As Integer
'CHECK FOR RECORDSET IS OPEN OR CLOSED
If rs_tmp.State = 1 Then
rs_tmp.Close
End If
rs_tmp.Open "select * from Login_Mast where Typ='A'",
conn, adOpenStatic, adLockPessimistic
If (rs_tmp.RecordCount = 1) And (Mid([Link],
Len([Link]) - 1, 1) = "A") Then
MsgBox "You can not delete this Admin user." & vbCrLf &
"Atlist one Admin user is required.", vbCritical,
"User Deletion"
Exit Sub
End If
If MsgBox("You want to delete selected user ?", vbQuestion +
vbOKCancel, "User Deletion") = vbOK Then
'FIND SELECTED USER
rs_user.MoveFirst
rs_user.Find "usr='" & Mid([Link], 1,
Len([Link]) - 4) & "'"
rs_user.Delete 'DELETE USER
Call fillList 'FILL LIST BOX
End If
End Sub
Private Sub Form_Load()
[Link] = False
'OPEN RECORDSET
rs_user.Open "select * from Login_Mast", conn,
adOpenStatic, adLockPessimistic
Call fillList 'FILL LIST BOX
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs_user.Close
End Sub
Private Sub fillList()
'FILL ListBox
[Link]
If rs_user.RecordCount <> 0 Then
rs_user.MoveFirst
While Not rs_user.EOF
[Link] rs_user.Fields(0) & " (" &
rs_user.Fields(2) & ")"
rs_user.MoveNext
Wend
[Link] = [Link](0)
End If
End Sub
FORM – 8 : MEMBER OPERATION
(FrmMember)
CODE : MEMBER OPERATION (FrmMember)
Option Explicit
Dim rs_mbr As New [Link]
Dim rs_temp As New [Link]
Dim rs_isu As New [Link]
Dim cmd As String
Private Sub CmbClass_Click()
Dim i As Integer
Class = [Link]
Call fillYear(Me) 'SELECT YEAR
[Link] = [Link](0)
End Sub
Private Sub CmbClassYear_Click()
Yer = [Link]
Call [Link](Me, False)
If rs_mbr.State = 1 Then rs_mbr.Close
rs_mbr.Open "select * from Mbr_Mast where [crs]='" &
[Link] & _
"' and [Yer]='" & [Link] & "' ORDER BY
Code", conn, adOpenStatic, adLockPessimistic
Call [Link](Me) 'SET DEFAULT CONTROLS
If rs_mbr.RecordCount <> 0 Then
Call [Link](Me) 'ENABLE COMMAND
BTNS
Call memberData(Me, rs_mbr) 'RETRIVE DATA
Else
Call [Link](Me) 'DISABLE BUTTONS
[Link] = True
End If
'CHECK USER TYPE
If userType = "L" Then
[Link] = False
[Link] = False
[Link] = False
[Link] = False
[Link] = False
End If
End Sub
Private Sub CmbMonth_Click()
Dim i As Integer
[Link]
For i = 1 To daysOfMonth(Val([Link]),
Val([Link]))
[Link] i
Next i
[Link] = Day(Date)
End Sub
Private Sub CmbSearch_Click()
Call fillMbrGrid(Me, [Link], [Link],
[Link])
End Sub
Private Sub CmbYear_Click()
Dim i As Integer
[Link]
For i = 1 To daysOfMonth(Val([Link]),
Val([Link]))
[Link] i
Next i
[Link] = Day(Date)
End Sub
Private Sub CmdAdd_Click()
Dim rs_tmp As New [Link]
Set rs_tmp = New Recordset
cmd = "Add"
[Link] = "&Cancel"
'ENABLE ALL CONTROLS
Call [Link](Me, True)
[Link] = True
[Link] = True 'ENABLE SAVE BUTTON
[Link] = False 'DISABLE CLASS COMBO
[Link] = False 'DISABLE YEAR COMBO
[Link] = False 'DISABLE SEARCH FREAM
Call [Link](Me) 'DISABLE COMMAND
BTNS
[Link] = True
'SET DEFALUT CONTROLS
Call [Link](Me)
'GENERATE NEXT CODE
[Link] = Book.Next_Code(rs_mbr, "M")
[Link]
End Sub
Private Sub CmdDel_Click()
Set rs_temp = New Recordset
rs_temp.Open "SELECT * FROM Issue_Mast WHERE
[Crs]='" & [Link] & "' AND [Yer]='" &
[Link] & "' AND [Mbr_No]='" & TxtCode
& "' AND [Sub_Dt]='-'", conn, adOpenStatic,
adLockReadOnly
If rs_temp.RecordCount > 0 Then
MsgBox "You can't delete this member. First Issue
Book/CD.", vbInformation, "Member Deletion"
Exit Sub
End If
If MsgBox("You want to delete this record?", vbInformation +
vbYesNo, "Member deletion") = vbYes Then
rs_mbr.Delete 'DELETE RECORD
rs_mbr.Update 'UPDATE RECORD
rs_mbr.MoveNext 'MOVE RECORDSET TO NEXT
RECORD
Call [Link](Me, Class, Yer, [Link])
If rs_mbr.RecordCount = 0 Then
Call [Link](Me) 'CLEAR TEXT BOXES
Call [Link](Me) 'DISABLE BUTTONS
[Link] = True 'ENABLE ADD BUTTONS
Exit Sub
Else
If rs_mbr.EOF Then
rs_mbr.MoveFirst
'RETRIVE RECORD
Call [Link](Me, rs_mbr)
Exit Sub
Else
'RETRIVE RECORD
Call [Link](Me, rs_mbr)
End If
End If
End If
End Sub
Private Sub CmdEdit_Click()
cmd = "Edit"
[Link] = "&Cancel"
'ENABLE ALL CONTROLS
Call [Link](Me, True)
[Link] = False 'DISABLE SEARCH FREAM
Call [Link](Me)
[Link] = True 'ENABLE SAVE BTN
End Sub
Private Sub CmdExit_Click()
If [Link] = "&Cancel" Then
[Link] = "E&xit"
'DISABLE ALL CONTROLS
Call [Link](Me, False)
[Link] = True 'ENABLE SEARCH FREM
Call [Link](Me) 'CLEAR CONTROLS
If rs_mbr.RecordCount <> 0 Then
rs_mbr.MoveFirst
Call [Link](Me) 'ENABLE BUTTON
'RETRIVE RECORD
Call [Link](Me, rs_mbr)
Else
Call [Link](Me) 'DISABLE BTNS
Call [Link](Me) 'CLEAR CONTROLS
[Link] = True
End If
Call [Link](Me, False) 'LOCK TEXT
BOXES
[Link] = False
[Link] = True 'ENABLE COURCE COMBO
[Link] = True 'ENABLE YEAR COMBO
ElseIf [Link] = "E&xit" Then
Unload Me
End If
End Sub
Private Sub CmdFirst_Click()
rs_mbr.MoveFirst 'MOVE RECORD TO FIRST
'RETRIVE MEMBER DATA
Call [Link](Me, rs_mbr)
End Sub
Private Sub CmdLast_Click()
rs_mbr.MoveLast 'MOVE RECORD TO FIRST
'RETRIVE MEMBER DATA
Call [Link](Me, rs_mbr)
End Sub
Private Sub CmdNext_Click()
rs_mbr.MovePrevious
If rs_mbr.BOF Then
rs_mbr.MoveLast
End If
Call [Link](Me, rs_mbr) 'RETRIVE DATA
End Sub
Private Sub CmdPrv_Click()
rs_mbr.MovePrevious
If rs_mbr.BOF Then
rs_mbr.MoveLast
End If
Call [Link](Me, rs_mbr) 'RETRIVE DATA
End Sub
Private Sub CmdSave_Click()
Dim dt As String, sex As String, Qry As String
'VALIDATIONS
If TxtCode = "" Or TxtSurname = "" Or TxtFirst = "" Or TxtLast
= "" Or _
TxtAddress = "" Or TxtCity = "" Or TxtFee = "" Then
MsgBox "Enter all compulsory information.",
vbInformation, "Member Entry"
Exit Sub
End If
dt = [Link] & "/" & [Link] & "/" &
[Link]
If [Link] = True Then
sex = "M"
Else
sex = "F"
End If
'ADD RECORD
If cmd = "Add" Then
Qry = "insert into Mbr_Mast values ('" & TxtCode & "','" &
TxtSurname & "','" & _
TxtFirst & "','" & TxtLast & "','" & dt & "','" & TxtAddress &
"','" & _
TxtCity & "','" & [Link] & "','" &
[Link] & "','" & _
TxtContact & "','" & sex & "'," & TxtFee & ",0)"
[Link] Qry
Call CmbClassYear_Click 'TO RETRIVE UPDATED
DATA
Call CmdExit_Click 'TO RESET CONTROLS
MsgBox "Record added successfully.", vbInformation,
"Member Entry"
ElseIf cmd = "Edit" Then 'EDIT RECORD
Qry = "update Mbr_Mast set [surname]='" & TxtSurname &
"', [member]='" & _
TxtFirst & "', [father]='" & TxtLast & "', [Join_Dt]='" & dt &
"', [Address]='" & _
TxtAddress & "',[City]='" & TxtCity & "', [Cnt_No]='" & _
TxtContact & "',[Gender]='" & sex & "',[Fee]=" & TxtFee
& " where [Code]='" & _
TxtCode & "'" & " and [Crs]='" & Class & "' and [Yer]='" &
Yer & "'"
MsgBox Qry
[Link] Qry
Call CmdExit_Click 'TO RESET CONTROLS
End If
End Sub
Private Sub CmdTransfer_Click()
Unload Me
[Link] vbModal
End Sub
Private Sub Form_Load()
Dim i As Integer
'DAY COMBO
For i = 1 To 31
[Link] i
Next
'MONTH COMBO
For i = 1 To 12
[Link] i
Next
'YEAR COMBO
For i = 1950 To 2050
[Link] i
Next
[Link] = Class
[Link] = "No. |Code |Name
|Join Date |City "&_
"|Contect No. |Gender| Fine"
End Sub
Private Sub Form_Resize()
If [Link] > 6630 Then
[Link] = [Link]
[Link] = [Link] / 2 - [Link] / 2
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs_mbr.Close
If [Link] = 2 Then
[Link] = True
End If
End Sub
Private Sub MsfgSearch_Click()
rs_mbr.MoveFirst
rs_mbr.Find "Code = '" &
[Link]([Link], 1) & "'"
Call memberData(Me, rs_mbr) 'fill controls
End Sub
Private Sub MsfgSearch_RowColChange()
rs_mbr.MoveFirst
rs_mbr.Find "Code = '" &
[Link]([Link], 1) & "'"
Call memberData(Me, rs_mbr) 'fill controls
End Sub
Private Sub TxtAddress_GotFocus()
Call [Link](TxtAddress)
End Sub
Private Sub TxtAddress_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
Exit Sub
End If
KeyAscii = [Link](KeyAscii)
End Sub
Private Sub TxtCity_GotFocus()
Call [Link](TxtCity)
End Sub
Private Sub TxtCity_KeyPress(KeyAscii As Integer)
KeyAscii = alpha(KeyAscii)
End Sub
Private Sub TxtCode_GotFocus()
Call [Link](TxtCode)
End Sub
Private Sub TxtCode_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End If
End Sub
Private Sub TxtContact_GotFocus()
Call [Link](TxtContact)
End Sub
Private Sub TxtContact_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
ElseIf (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And
KeyAscii <> Asc("-") Then
KeyAscii = 0
End If
End Sub
Private Sub TxtFee_GotFocus()
Call [Link](TxtFee)
End Sub
Private Sub TxtFee_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then
KeyAscii = 8
ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End If
End Sub
Private Sub TxtFirst_GotFocus()
Call [Link](TxtFirst)
End Sub
Private Sub TxtFirst_KeyPress(KeyAscii As Integer)
KeyAscii = alpha(KeyAscii)
End Sub
Private Sub TxtLast_GotFocus()
Call [Link](TxtLast)
End Sub
Private Sub TxtLast_KeyPress(KeyAscii As Integer)
KeyAscii = alpha(KeyAscii)
End Sub
Private Sub TxtSearch_Change()
Set rs_temp = New Recordset
rs_temp.Open "select * from Mbr_Mast where [Crs]='" &
[Link] & "' and [Yer]='" & [Link] & "'
and " & [Link] & " like('" & TxtSearch & "%') order
by " & CmbSearch, conn, adOpenStatic, adLockReadOnly
If rs_temp.RecordCount = 0 Then
[Link] = False
Else
[Link] = True
End If
Call fillMbrGrid1(Me, rs_temp) 'fill grid
End Sub
Private Sub TxtSearch_GotFocus()
[Link] = False
End Sub
Private Sub TxtSearch_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
End If
KeyAscii = upper(KeyAscii)
End Sub
Private Sub TxtSurname_GotFocus()
Call [Link](TxtSurname)
End Sub
Private Sub TxtSurname_KeyPress(KeyAscii As Integer)
KeyAscii = [Link](KeyAscii)
End Sub
'================================================
===
Private Sub fillMbrGrid1(Frm As Form, rs As Recordset)
Dim r As Integer
[Link] = 8
[Link] = [Link] + 1
If [Link] > 0 Then
[Link]
For r = 1 To [Link]
[Link](r, 0) = r
[Link](r, 0) = r
[Link](r, 1) = [Link](0)
[Link](r, 2) = [Link](1) & " " &
[Link](2) & " " & [Link](3)
[Link](r, 3) =
Format([Link](4), "dd-mm-yyyy")
[Link](r, 4) = [Link](6)
[Link](r, 5) = [Link](9)
[Link](r, 6) = [Link](10)
[Link](r, 7) = [Link](12)
[Link]
Next
End If
End Sub
FORM – 9 : MEMBER TRANSFER
(FrmTransfer)
FORM – 9 : MEMBER TRANSFER
(FrmTransfer)
Option Explicit
Dim rs As New [Link]
Dim rs1 As New [Link]
Dim i As Integer, cnt As Integer
Dim Qry As String
Private Sub CmbClassFrom_Click()
Call fillYear(CmbClassFrom, CmbClassYearFrom)
[Link] = [Link](0)
End Sub
Private Sub CmbClassTo_Click()
Call fillYear(CmbClassTo, CmbClassYearTo)
[Link] = [Link](0)
End Sub
Private Sub CmbClassYearFrom_Click()
Set rs = New Recordset
[Link] "SELECT * FROM Mbr_Mast WHERE [Crs]='" &
CmbClassFrom & _
"' AND [Yer]='" & CmbClassYearFrom & "'", conn,
adOpenStatic, adLockReadOnly
[Link]
If [Link] > 0 Then
Do While Not [Link]
[Link] [Link](0) & " " & _
[Link](1) & " " & [Link](2) & " " & [Link](3)
[Link]
Loop
End If
End Sub
Private Sub CmbClassYearTo_Click()
Set rs1 = New Recordset
[Link] "SELECT * FROM Mbr_Mast WHERE [Crs]='" &
[Link] & _
"' AND [Yer]='" & [Link] & "' ORDER BY
Code", conn, adOpenStatic, adLockReadOnly
[Link]
If [Link] > 0 Then
Do While Not [Link]
[Link] [Link](0) & " " & _
[Link](1) & " " & [Link](2) & " " &
[Link](3)
[Link]
Loop
End If
End Sub
Private Sub CmdCancel_Click()
Unload Me
[Link]
End Sub
Private Sub CmdTransfer_Click()
'WHEN TRANSFER TO SAME CLASS & YEAR
If [Link] = [Link] And
[Link] = [Link]
Then
MsgBox "Member can not transfer to same class and
year", vbInformation, "Member Transfer"
Exit Sub
End If
If [Link] = 0 Then
Qry = "UPDATE Mbr_Mast SET [Crs]='" &
[Link] & _
"',[Yer]='" & [Link] & "' WHERE [Crs]='"
&_
[Link] & "' AND [Yer]='" &
[Link] & "'"
[Link] Qry
MsgBox "Member transmitted successfully.",
vbInformation, "Member Transfer"
[Link]
Call CmbClassYearTo_Click 'TO RETRIVE UPDATED
DATA
Else
MsgBox "Destination Class is not empty.", vbInformation,
"Member Transfer"
End If
End Sub
Private Sub Form_Load()
[Link] = [Link](0)
[Link] = [Link](0)
End Sub
'================================================
===
'FILL YEAR COMBO BOX
Public Sub fillYear(c As Control, y As Control)
[Link]
If [Link] = "BBA" Or [Link] = "BCOM" Then
[Link] "FY"
[Link] "SY"
[Link] "TY"
ElseIf [Link] = "PGDCA" Or [Link] = "DCS" Then
For i = 1 To 2
[Link] "SEM" & i
Next
Else
For i = 1 To 6
[Link] "SEM" & i
Next
End If
End Sub
FORM – 10 : BOOK OPERATIONS
(FrmBkEntry)
FORM – 11 : ISSUE BOOK/CD (FrmBookIsu)
FORM – 12 : SUBMIT BOOK/CD (FrmBookIsu)
FORM – 13 : ISSUE DETAIL (FrmIsuDtl)
FORM – 14 : MEMBER & ISSUE REPORT
CREATION (FrmRpt)
FORM – 15 : ABOUT APPLICATION
(FrmAbout)