96
http://www.chetanasprojects.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 http://www.chetanasprojects.com

Library Management System VB Project Documentation

Embed Size (px)

Citation preview

Page 1: Library Management System VB Project Documentation

http://www.chetanasprojects.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 supportive nature. His inspiring nature has always made my work easy.

http://www.chetanasprojects.com

Page 2: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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

http://www.chetanasprojects.com

Page 3: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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.

http://www.chetanasprojects.com

Page 4: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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:

http://www.chetanasprojects.com

Page 5: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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.

http://www.chetanasprojects.com

Page 6: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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.

http://www.chetanasprojects.com

Page 7: Library Management System VB Project Documentation

http://www.chetanasprojects.com

-: 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.

http://www.chetanasprojects.com

Page 8: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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.

http://www.chetanasprojects.com

Page 9: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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.

http://www.chetanasprojects.com

Page 10: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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

http://www.chetanasprojects.com

Page 11: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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

http://www.chetanasprojects.com

Page 12: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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.

http://www.chetanasprojects.com

Page 13: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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

http://www.chetanasprojects.com

Page 14: Library Management System VB Project Documentation

http://www.chetanasprojects.com

ACCESS TABLE’S DETAIL’S:

TABLE – 1 : LOGIN_MAST (User Information)

FIELD NAME DATA TYPE & (SIZE)

DESCRIPTION

Usr Text (20) User NamePw Text (20) User PasswordTyp Text (1) Type of User

FIELD NAME DATA TYPE & (SIZE)

DESCRIPTION

Code Text (6) Book/CD CodeTitle Text (30) Title of Book/CdAuthor Text (20) Auther of book(s)

http://www.chetanasprojects.com

Page 15: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Publisher Text (20) Publisher of BookPur_Dt Date/Time Purchase DatePrice Currency

(Standard)Price of Book/Cd

Qty Number (Long int.) Book/Cd QuantityPur_From Text (50) Purchase FromIsudBk Number (Long int) Quantity of issued

Book/cd TABLE=>2 BOOK_MAST (Store Book details)

TABLE=>3 MBR_MAST (Store Master details)

FIELD NAME DATA TYPE & (SIZE)

DESCRIPTION

Code Text (10) Member NoSurname Text (50) SurnameMember Text (50) Member NameFather Text (50) Father NameJoin_Dt Date/Time Join DateAddress Memo Member AddressCity Text (20) CityCrs Text (10) CourseYer Text (10) Year of Course(FY,

SY, TY, SEM1,etc...)

Cnt_No Text (50) Contect NumberGender Text (1) SexFee Currency

(Standard)Membership Fee

Fine Currency (Standard)

Fine on late submission

http://www.chetanasprojects.com

Page 16: Library Management System VB Project Documentation

http://www.chetanasprojects.com

TABLE=>4 FINE_MAST (Store Fine detail)

FIELD NAME DATA TYPE DESCRIPTIONCrs Text (10) CourseYer Text (10) Year of studyMbr_No Text (6) Member NumberBk_No Text (6) Book NumberFine Currency

(Standard)Fine for late submission, Datmage etc...

Fin_Dt Date/Time Date of Fine

TABLE=>5 ISSUE_MAST (Store Issue Details)

FIELD NAME DATA TYPE & (SIZE)

DESCRIPTION

http://www.chetanasprojects.com

Page 17: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Mbr_No Text (6) Member NoCrs Text (10) Student Course or

StaffYer Text (10) Year of StudyBk_No Text (6) Book No.Isu_Dt Date/Time Issue DateLst_Dt Date/Time Last Submit Date

V.B.FORM

DESIGN &

http://www.chetanasprojects.com

Page 18: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODDING

FORM - 1 : WELCOME FORM (FrmWelcome.frm)

http://www.chetanasprojects.com

Page 19: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE : WELCOME FORM (FrmWelcome.frm)

Private Sub Form_Resize( )

Img1.Height = Me.ScaleHeight Img1.Width = Me.ScaleWidth LblWelcome1.Left = (Me.ScaleWidth / 2 - LblWelcome1.Width /

2) - 120 LblWelcome2.Left = Me.ScaleWidth / 2 - LblWelcome2.Width / 2

LblRpbc1.Left = (Me.ScaleWidth / 2 - LblRpbc1.Width / 2) + 60 LblRpbc2.Left = Me.ScaleWidth / 2 - LblRpbc1.Width / 2 LblLib1.Left = Me.ScaleWidth / 2 - LblLib1.Width / 2 LblLib2.Left = (Me.ScaleWidth / 2 - LblLib2.Width / 2) + 60 LblSys1.Left = Me.ScaleWidth / 2 - LblSys1.Width / 2 LblSys2.Left = (Me.ScaleWidth / 2 - LblSys2.Width / 2) + 60

End Sub

Private Sub Img1_Click( )

http://www.chetanasprojects.com

Page 20: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FrmLogin.Show Timer1.Enabled = FalseEnd Sub

Private Sub LblWelcome1_Click( ) FrmLogin.Show Timer1.Enabled = FalseEnd Sub

Private Sub Timer1_Timer( ) FrmLogin.Show vbModal Timer1.Enabled = FalseEnd Sub

FORM - 2 : LOGIN FORM (FrmLogin.frm)

http://www.chetanasprojects.com

Page 21: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE : LOGIN FORM (FrmLogin.frm)

Dim rs_user As New Recordset

Private Sub CmdCancel_Click() EndEnd 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" TxtUser.SetFocus Exit Sub End If If TxtUser = "LIBRARY" And TxtPwd = "INDISOFT" Then userType = "L" userNm = "LIBRARY" Unload FrmWelcome Unload FrmLogin MDIFrm.Show 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

http://www.chetanasprojects.com

Page 22: Library Management System VB Project Documentation

http://www.chetanasprojects.com

userType = rs_user.Fields(2) userNm = rs_user.Fields(0) Unload FrmWelcome Unload FrmLogin MDIFrm.Show Exit Sub Else MsgBox "Wrong username or password.", vbCritical,

"Login" TxtUser.SetFocus Exit Sub End If Else MsgBox "Wrong username or password.", vbCritical, "Login" TxtUser.SetFocus Exit Sub End If Else MsgBox "Wrong username or password.", vbCritical, "Login" TxtUser.SetFocus 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.CloseEnd Sub

Private Sub TxtPwd_GotFocus() Call selectTxt(TxtPwd)End Sub

http://www.chetanasprojects.com

Page 23: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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

http://www.chetanasprojects.com

Page 24: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 3 : MDI FORM (MDIFrm.frm)

http://www.chetanasprojects.com

Page 25: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 3 : MDI FORM (MDIFrm.frm)

Option Explicit

Dim rs As New ADODB.RecordsetDim FL As String 'TO STORE FILE NAMEDim rpt As String

Private Sub CmdBkEntry_Click() Call MnuBkOpr_ClickEnd 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

http://www.chetanasprojects.com

Page 26: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Else MsgBox "Invalid input.", vbCritical, "Report Creation" End If

End Sub

Private Sub CmdBkSubISu_Click() Call MnuBkIsuSub_ClickEnd Sub

Private Sub CmdExit_Click() EndEnd Sub

Private Sub CmdIsuDtl_Click() Call MnuBkIsuDtl_ClickEnd Sub

Private Sub CmdIsuRpt_Click() Call mnuIsuRpt_ClickEnd Sub

Private Sub CmdMbrEntry_Click() Call MnuMbrOpr_ClickEnd Sub

Private Sub CmdMbrRpt_Click() Call MnuMbrRpt_ClickEnd Sub

Private Sub CmdUAcc_Click() Call MnuUmgAcc_ClickEnd Sub

Private Sub LblClose_Click() Pct1.Visible = FalseEnd Sub

Private Sub MDIForm_Load()

http://www.chetanasprojects.com

Page 27: Library Management System VB Project Documentation

http://www.chetanasprojects.com

'CHECK USER TYPE If userNm = "LIBRARY" Then MnuUmg.Enabled = False CmdUAcc.Enabled = False End If If userType = "L" Then MnuBkIsuSub.Enabled = False MnuRpt.Enabled = False CmdBkSubISu.Enabled = False End If

End Sub

Private Sub MDIForm_Resize() 'RESIZE STATUS BAR If Me.Width > 1000 And Me.Height > 1000 Then StatusBar1.Panels(1).Width = Me.ScaleWidth * 0.5 StatusBar1.Panels(2).Width = Me.ScaleWidth * 0.11 StatusBar1.Panels(3).Width = Me.ScaleWidth * 0.11 StatusBar1.Panels(4).Width = Me.ScaleWidth * 0.11 StatusBar1.Panels(5).Width = Me.ScaleWidth * 0.11 StatusBar1.Panels(6).Width = Me.ScaleWidth * 0.05 StatusBar1.Panels(1) = "Current User : " & userNm & "(" &

userType & ")" End If 'ARRANGE PICTURE BOX AND OTHER COMMAND BUTTONS Pct1.Height = Me.Height If Me.Height >= 8100 And Me.Width >= 11500 Then

'MAKE LABLE TO CENTER LblTask.Left = Me.ScaleWidth / 2 - LblTask.Width / 2

'SET ALL COMMAND BUTTONS AND FRAME CmdUAcc.Left = Me.ScaleWidth / 2 - CmdUAcc.Width / 2

http://www.chetanasprojects.com

Page 28: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FramIsu.Left = Me.ScaleWidth / 2 - FramIsu.Width / 2 FramMbr.Left = FramIsu.Left - FramMbr.Width - 500 FramBk.Left = FramIsu.Left + FramIsu.Width + 500

'SET COMMAND BUTTON TO CENTER CmdExit.Left = Me.ScaleWidth / 2 - CmdExit.Width / 2

LblClose.Top = Me.Height - 1500 LblClose.Left = Me.ScaleWidth - 2500 End If

End Sub

Private Sub MDIForm_Unload(Cancel As Integer) EndEnd Sub

Private Sub MnuAbtLib_Click() Pct1.Visible = False frmAbout.Show vbModalEnd Sub

Private Sub MnuBkIsuDtl_Click() Pct1.Visible = False FrmIsuDtl.ShowEnd Sub

Private Sub MnuBkIsuSub_Click() Pct1.Visible = False FrmBookIsu.ShowEnd Sub

Private Sub MnuBkOpr_Click() Pct1.Visible = False frmBkEntry.ShowEnd Sub

http://www.chetanasprojects.com

Page 29: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub MnuBkRpt_Click() Call BookCdReport("BOOK") 'GENERATE REPORTEnd Sub

Private Sub MnuCdRpt_Click() Call BookCdReport("CD") 'GENERATE REPORTEnd Sub

Private Sub mnuIsuRpt_Click() Pct1.Visible = False Report = "I" 'I means Issue Report FrmRpt.Show vbModalEnd Sub

Private Sub MnuMbrOpr_Click() Pct1.Visible = False FrmMember.ShowEnd Sub

Private Sub MnuMbrRpt_Click() Pct1.Visible = False Report = "M" 'M means Member Report FrmRpt.Show vbModalEnd Sub

Private Sub MnuMstrSelection_Click() Pct1.Visible = TrueEnd Sub

Private Sub MnuUmgAcc_Click() Pct1.Visible = False FrmUserMng.Show vbModalEnd Sub

Private Sub MnuWinClose_Click() Do While Forms.Count - 1 > 0 Unload Me.ActiveForm Loop

http://www.chetanasprojects.com

Page 30: Library Management System VB Project Documentation

http://www.chetanasprojects.com

End Sub

Private Sub MnuWinCscd_Click() Arrange vbCascadeEnd Sub

Private Sub MnuWinHrz_Click() Arrange vbHorizontalEnd Sub

Private Sub MnuWinVrtl_Click() Arrange vbVerticalEnd Sub

'==================================================='GENERATE REPORT FOR BOOK/CD (PROCEDURE)

Private Sub BookCdReport(typ As String) Set rs = New Recordset If typ = "BOOK" Then

rs.Open "SELECT Code,Title,Author,Price,Qty FROM Book_Mast WHERE Code like 'B%'", conn, adOpenStatic, adLockReadOnly

Else

rs.Open "SELECT Code,Title,Author,Price,Qty FROM Book_Mast WHERE Code like 'C%'", conn, adOpenStatic, adLockReadOnly

End If 'WHEN NO RECORD EXIST If rs.RecordCount = 0 Then rs.Close MsgBox "No record is found.", vbInformation, "Member

Report" Exit Sub

http://www.chetanasprojects.com

Page 31: Library Management System VB Project Documentation

http://www.chetanasprojects.com

End If 'CREATE REPORT 'OPEN FILE FL = typ & "_" & Format(Date, "dd-mm-yyyy") Open App.Path & "\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, "--------------------------------------------------------------------------------"

rs.MoveFirst Do While Not rs.EOF Print #1, " " & rs!Code & " " & _ rs!title & Space(31 - Len(rs!title)) & _ rs!Author & Space(22 - Len(rs!Author)) & _

http://www.chetanasprojects.com

Page 32: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Space(6 - Len(rs!Price)) & rs!Price & _ Space(11 - Len(rs!qty)) & rs!qty Print #1, "" rs.MoveNext Loop rs.Close Close #1 MsgBox FL & ".txt created successfully.", vbInformation,

"Member Report" Shell App.Path & "\Reports\wordpad.exe " & App.Path & "\

Reports\" & FL & ".txt", vbMaximizedFocus

End Sub

FORM – 4 : USER MANAGEMENT(FrmUserMng)

http://www.chetanasprojects.com

Page 33: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE : USER MANAGEMENT (FrmUserMng.frm)

http://www.chetanasprojects.com

Page 34: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub CmdCancel_Click() Unload MeEnd Sub

Private Sub CmdCreateAcc_Click() Unload Me FrmCreateAcc.Show vbModalEnd Sub

Private Sub CmdDeleteAcc_Click() Unload Me FrmUserDelete.Show vbModalEnd Sub

Private Sub CmdEditAcc_Click() Unload Me FrmEditAcc.Show vbModalEnd Sub

Private Sub Form_Load() If userType = "L" Then CmdCreateAcc.Enabled = False CmdDeleteAcc.Enabled = False End IfEnd Sub

Private Sub Form_Unload(Cancel As Integer) If Forms.Count = 2 Then MDIFrm.Pct1.Visible = True End IfEnd Sub

FORM – 5 : CREATE NEW USER (FrmCreateAcc)

http://www.chetanasprojects.com

Page 35: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE : CREATE NEW USER (FrmCreateAcc)

Dim rs_user As New ADODB.Recordset

http://www.chetanasprojects.com

Page 36: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub CmdBack_Click() Unload Me FrmUserMng.Show vbModalEnd Sub

Private Sub CmdCancel_Click() Unload MeEnd Sub

Private Sub CmdCreateAcc_Click() Dim Query As String, typ As String If Trim(TxtUser.Text) = "" 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"

TxtConfPwd.SetFocus Exit Sub

End If 'DUPLICATION CHECK rs_user.MoveFirst rs_user.Find "usr='" & TxtUser & "'"

If rs_user.EOF Then 'USER NOT EXIST If CmbUserType.Text = "ADMIN" Then typ = "A" Else

http://www.chetanasprojects.com

Page 37: Library Management System VB Project Documentation

http://www.chetanasprojects.com

typ = "L" End If Query = "insert into Login_Mast values ('" & TxtUser & "','" & _ TxtPwd & "','" & typ & "')" MsgBox Query conn.Execute Query MsgBox "New user is successfully added.", vbInformation,

"User Addition" TxtUser = "" TxtPwd = "" TxtConfPwd = "" CmbUserType.SetFocus Call Form_Load

Else 'USER IS ALREADY EXIST MsgBox "User already exit. Enter another user name.",

vbCritical, "User Additon" TxtUser.SetFocus End If

End Sub

Private Sub Form_Load()

MDIFrm.Pct1.Visible = 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 TxtUser.Text = "" TxtPwd.Text = "" TxtConfPwd.Text = "" CmbUserType.Text = CmbUserType.List(0)End Sub

http://www.chetanasprojects.com

Page 38: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub Form_Unload(Cancel As Integer) rs_user.CloseEnd Sub

Private Sub TxtConfPwd_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

Private Sub TxtPwd_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

Private Sub TxtUser_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

FORM – 5 : CHANGE USER NAME (FrmEditAcc)

http://www.chetanasprojects.com

Page 39: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM - 6 : CHANGE PASSWORD (FrmEditAcc)

http://www.chetanasprojects.com

Page 40: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE – 5 : CHANGE USER NAME & CHANGE PASSWORD (FrmEditAcc)

Dim rs_user As New ADODB.Recordset

http://www.chetanasprojects.com

Page 41: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Dim Query As String

Private Sub CmdBack_Click() Unload Me FrmUserMng.Show vbModalEnd Sub

Private Sub CmdCancel_Click() Unload MeEnd 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"

http://www.chetanasprojects.com

Page 42: Library Management System VB Project Documentation

http://www.chetanasprojects.com

TxtUser.SetFocus 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" TxtCurPwd.SetFocus 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" TxtCurPwd.SetFocus Exit Sub End If Query = "update Login_Mast set pw='" & TxtNewPwd &

"' where usr='" & TxtUser & "'" End If

http://www.chetanasprojects.com

Page 43: Library Management System VB Project Documentation

http://www.chetanasprojects.com

'UPDATE PASSWORD conn.Execute Query MsgBox "Your password is changed successfully.",

vbInformation, "Change Password" TxtUser.Text = "" TxtCurPwd.Text = "" TxtNewPwd.Text = "" TxtConfPwd.Text = "" TxtUser.SetFocus

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" TxtCurUser.SetFocus Exit Sub End If If CmbUserType.Text = "ADMIN" Then typ = "A" Else

http://www.chetanasprojects.com

Page 44: Library Management System VB Project Documentation

http://www.chetanasprojects.com

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" TxtCurUser.SetFocus 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

http://www.chetanasprojects.com

Page 45: Library Management System VB Project Documentation

http://www.chetanasprojects.com

'EXECUTE QUERY & UPDATE RECORD conn.Execute Query MsgBox "User name is changed successfully.", vbInformation,

"User Edition" If TxtCurUser = userNm Then userNm = TxtNewUser.Text userType = typ MDIFrm.StatusBar1.Panels(1) = "Current User : " & userNm &

"(" & userType & ")"

End If TxtCurUser.Text = "" TxtNewUser.Text = "" TxtCurUser.SetFocus

End Sub

Private Sub Form_Load() MDIFrm.Pct1.Visible = 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 TabEditAcc.Tab = 0 Then FremEditPwd.Enabled = False

http://www.chetanasprojects.com

Page 46: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FremEditUser.Enabled = True CmdUser.Default = True 'CmbUserType.Text = CmbUserType.List(0) TxtCurUser = "" TxtNewUser = "" If userType = "L" Then CmbUserType.Enabled = False CmbUserType.Text = "LIMITED" Else CmbUserType.Text = "ADMIN" End If Else FremEditPwd.Enabled = True FremEditUser.Enabled = False CmdPwd.Default = True TxtUser = "": TxtCurPwd = "" TxtNewPwd = "": TxtConfPwd = "" End If

End Sub

Private Sub TxtConfPwd_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

Private Sub TxtCurPwd_GotFocus() Call Book.selectTxt(TxtCurPwd)End Sub

http://www.chetanasprojects.com

Page 47: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub TxtCurPwd_KeyPress(KeyAscii As Integer) If KeyAscii = 39 Or KeyAscii = 34 Or KeyAscii = 32 Then KeyAscii = 0 End If KeyAscii = Book.upper(KeyAscii)End Sub

Private Sub TxtCurUser_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

Private Sub TxtNewPwd_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

Private Sub TxtNewUser_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

http://www.chetanasprojects.com

Page 48: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub TxtUser_GotFocus() Call Book.selectTxt(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 = Book.upper(KeyAscii)End Sub

FORM – 7 : DELETE USER (FrmUserDelete)

http://www.chetanasprojects.com

Page 49: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE : DELETE USER (FrmUserDelete)

Dim rs_user As New ADODB.RecordsetDim rs_tmp As New ADODB.Recordset

http://www.chetanasprojects.com

Page 50: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub CmdBack_Click() Unload Me FrmUserMng.Show vbModalEnd Sub

Private Sub CmdCancel_Click() Unload MeEnd 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(LstUserDelete.Text,

Len(LstUserDelete.Text) - 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(LstUserDelete.Text, 1,

Len(LstUserDelete.Text) - 4) & "'" rs_user.Delete 'DELETE USER Call fillList 'FILL LIST BOX

http://www.chetanasprojects.com

Page 51: Library Management System VB Project Documentation

http://www.chetanasprojects.com

End If

End Sub

Private Sub Form_Load() MDIFrm.Pct1.Visible = False 'OPEN RECORDSET rs_user.Open "select * from Login_Mast", conn, adOpenStatic, adLockPessimistic Call fillList 'FILL LIST BOXEnd Sub

Private Sub Form_Unload(Cancel As Integer) rs_user.CloseEnd Sub

Private Sub fillList() 'FILL ListBox LstUserDelete.Clear If rs_user.RecordCount <> 0 Then rs_user.MoveFirst While Not rs_user.EOF LstUserDelete.AddItem rs_user.Fields(0) & " (" &

rs_user.Fields(2) & ")" rs_user.MoveNext Wend LstUserDelete.Text = LstUserDelete.List(0) End IfEnd Sub

FORM – 8 : MEMBER OPERATION(FrmMember)

http://www.chetanasprojects.com

Page 52: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CODE : MEMBER OPERATION (FrmMember)

Option Explicit

Dim rs_mbr As New ADODB.Recordset

http://www.chetanasprojects.com

Page 53: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Dim rs_temp As New ADODB.RecordsetDim rs_isu As New ADODB.RecordsetDim cmd As String

Private Sub CmbClass_Click() Dim i As Integer

Class = CmbClass.Text Call fillYear(Me) 'SELECT YEAR CmbClassYear.Text = CmbClassYear.List(0)End Sub

Private Sub CmbClassYear_Click() Yer = CmbClassYear.Text Call Member.controlEnable(Me, False)

If rs_mbr.State = 1 Then rs_mbr.Close rs_mbr.Open "select * from Mbr_Mast where [crs]='" &

CmbClass.Text & _ "' and [Yer]='" & CmbClassYear.Text & "' ORDER BY

Code", conn, adOpenStatic, adLockPessimistic Call Member.clearControl(Me) 'SET DEFAULT CONTROLS

If rs_mbr.RecordCount <> 0 Then Call Book.enableCommand(Me) 'ENABLE COMMAND BTNS Call memberData(Me, rs_mbr) 'RETRIVE DATA Else Call Book.disableCommand(Me) 'DISABLE BUTTONS CmdAdd.Enabled = True End If 'CHECK USER TYPE If userType = "L" Then CmdAdd.Enabled = False CmdEdit.Enabled = False CmdDel.Enabled = False CmdSave.Enabled = False

http://www.chetanasprojects.com

Page 54: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CmdTransfer.Enabled = False End If

End Sub

Private Sub CmbMonth_Click() Dim i As Integer CmbDay.Clear For i = 1 To daysOfMonth(Val(CmbMonth.Text),

Val(CmbYear.Text)) CmbDay.AddItem i Next i CmbDay.Text = Day(Date)End Sub

Private Sub CmbSearch_Click() Call fillMbrGrid(Me, CmbClass.Text, CmbClassYear.Text,

CmbSearch.Text)End Sub

Private Sub CmbYear_Click() Dim i As Integer CmbDay.Clear For i = 1 To daysOfMonth(Val(CmbMonth.Text),

Val(CmbYear.Text))

CmbDay.AddItem i Next i CmbDay.Text = Day(Date)End Sub

Private Sub CmdAdd_Click() Dim rs_tmp As New ADODB.Recordset Set rs_tmp = New Recordset

cmd = "Add" CmdExit.Caption = "&Cancel" 'ENABLE ALL CONTROLS Call Member.controlEnable(Me, True)

http://www.chetanasprojects.com

Page 55: Library Management System VB Project Documentation

http://www.chetanasprojects.com

TxtCode.Locked = True CmdSave.Enabled = True 'ENABLE SAVE BUTTON CmbClass.Enabled = False 'DISABLE CLASS COMBO CmbClassYear.Enabled = False 'DISABLE YEAR COMBO FremCategory.Enabled = False 'DISABLE SEARCH FREAM Call Book.disableCommand(Me) 'DISABLE COMMAND BTNS CmdSave.Enabled = True 'SET DEFALUT CONTROLS Call Member.clearControl(Me) 'GENERATE NEXT CODE TxtCode.Text = Book.Next_Code(rs_mbr, "M") TxtSurname.SetFocus

End Sub

Private Sub CmdDel_Click() Set rs_temp = New Recordset rs_temp.Open "SELECT * FROM Issue_Mast WHERE [Crs]='" &

CmbClass.Text & "' AND [Yer]='" & CmbClassYear.Text & "' 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 Member.fillMbrGrid(Me, Class, Yer, CmbSearch.Text)

If rs_mbr.RecordCount = 0 Then

http://www.chetanasprojects.com

Page 56: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Call Member.clearControl(Me) 'CLEAR TEXT BOXES Call Book.disableCommand(Me) 'DISABLE BUTTONS CmdAdd.Enabled = True 'ENABLE ADD BUTTONS Exit Sub

Else

If rs_mbr.EOF Then rs_mbr.MoveFirst

'RETRIVE RECORD Call Member.memberData(Me, rs_mbr) Exit Sub Else

'RETRIVE RECORD Call Member.memberData(Me, rs_mbr) End If End If End If

End Sub

Private Sub CmdEdit_Click() cmd = "Edit" CmdExit.Caption = "&Cancel" 'ENABLE ALL CONTROLS Call Member.controlEnable(Me, True) FremCategory.Enabled = False 'DISABLE SEARCH FREAM Call Book.disableCommand(Me) CmdSave.Enabled = True 'ENABLE SAVE BTN End Sub

Private Sub CmdExit_Click() If CmdExit.Caption = "&Cancel" Then CmdExit.Caption = "E&xit" 'DISABLE ALL CONTROLS Call Member.controlEnable(Me, False)

http://www.chetanasprojects.com

Page 57: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FremCategory.Enabled = True 'ENABLE SEARCH FREM Call Member.clearControl(Me) 'CLEAR CONTROLS If rs_mbr.RecordCount <> 0 Then rs_mbr.MoveFirst Call Book.enableCommand(Me) 'ENABLE BUTTON

'RETRIVE RECORD Call Member.memberData(Me, rs_mbr) Else Call Book.disableCommand(Me) 'DISABLE BTNS Call Member.clearControl(Me) 'CLEAR CONTROLS CmdAdd.Enabled = True End If

Call Member.controlEnable(Me, False) 'LOCK TEXT BOXES CmdSave.Enabled = False CmbClass.Enabled = True 'ENABLE COURCE COMBO CmbClassYear.Enabled = True 'ENABLE YEAR COMBO

ElseIf CmdExit.Caption = "E&xit" Then Unload Me End If End Sub

Private Sub CmdFirst_Click() rs_mbr.MoveFirst 'MOVE RECORD TO FIRST 'RETRIVE MEMBER DATA Call Member.memberData(Me, rs_mbr) End Sub

Private Sub CmdLast_Click() rs_mbr.MoveLast 'MOVE RECORD TO FIRST 'RETRIVE MEMBER DATA Call Member.memberData(Me, rs_mbr) End Sub

http://www.chetanasprojects.com

Page 58: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub CmdNext_Click() rs_mbr.MovePrevious If rs_mbr.BOF Then rs_mbr.MoveLast End If Call Member.memberData(Me, rs_mbr) 'RETRIVE DATAEnd Sub

Private Sub CmdPrv_Click() rs_mbr.MovePrevious If rs_mbr.BOF Then rs_mbr.MoveLast End If Call Member.memberData(Me, rs_mbr) 'RETRIVE DATAEnd 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 = CmbDay.Text & "/" & CmbMonth.Text & "/" & CmbYear.Text If OptMale.Value = True Then sex = "M" Else sex = "F" End If 'ADD RECORD If cmd = "Add" Then

http://www.chetanasprojects.com

Page 59: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Qry = "insert into Mbr_Mast values ('" & TxtCode & "','" & TxtSurname & "','" & _

TxtFirst & "','" & TxtLast & "','" & dt & "','" & TxtAddress & "','" & _

TxtCity & "','" & CmbClass.Text & "','" & CmbClassYear.Text & "','" & _

TxtContact & "','" & sex & "'," & TxtFee & ",0)" conn.Execute 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 conn.Execute Qry Call CmdExit_Click 'TO RESET CONTROLS

End If

End Sub

Private Sub CmdTransfer_Click()

http://www.chetanasprojects.com

Page 60: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Unload Me FrmTransfer.Show vbModalEnd Sub

Private Sub Form_Load() Dim i As Integer 'DAY COMBO For i = 1 To 31 CmbDay.AddItem i Next 'MONTH COMBO For i = 1 To 12 CmbMonth.AddItem i Next 'YEAR COMBO For i = 1950 To 2050 CmbYear.AddItem i Next CmbClass.Text = Class Me.MsfgSearch.FormatString = "No. |Code |Name

|Join Date |City " & _ "|Contect No. |Gender| Fine"

End Sub

Private Sub Form_Resize()

If Me.Width > 6630 Then ShapLabel.Width = Me.ScaleWidth LblLabel.Left = ShapLabel.Width / 2 - LblLabel.Width / 2 End If

End Sub

Private Sub Form_Unload(Cancel As Integer) rs_mbr.Close

http://www.chetanasprojects.com

Page 61: Library Management System VB Project Documentation

http://www.chetanasprojects.com

If Forms.Count = 2 Then MDIFrm.Pct1.Visible = True End IfEnd Sub

Private Sub MsfgSearch_Click() rs_mbr.MoveFirst rs_mbr.Find "Code = '" &

MsfgSearch.TextMatrix(MsfgSearch.Row, 1) & "'" Call memberData(Me, rs_mbr) 'fill controlsEnd Sub

Private Sub MsfgSearch_RowColChange() rs_mbr.MoveFirst rs_mbr.Find "Code = '" &

MsfgSearch.TextMatrix(MsfgSearch.Row, 1) & "'" Call memberData(Me, rs_mbr) 'fill controlsEnd Sub

Private Sub TxtAddress_GotFocus() Call Book.selectTxt(TxtAddress)End Sub

Private Sub TxtAddress_KeyPress(KeyAscii As Integer) If KeyAscii = 39 Then KeyAscii = 0 Exit Sub End If KeyAscii = Book.upper(KeyAscii)End Sub

Private Sub TxtCity_GotFocus() Call Book.selectTxt(TxtCity)End Sub

Private Sub TxtCity_KeyPress(KeyAscii As Integer) KeyAscii = alpha(KeyAscii)

http://www.chetanasprojects.com

Page 62: Library Management System VB Project Documentation

http://www.chetanasprojects.com

End Sub

Private Sub TxtCode_GotFocus() Call Book.selectTxt(TxtCode)End Sub

Private Sub TxtCode_KeyPress(KeyAscii As Integer) If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0 End IfEnd Sub

Private Sub TxtContact_GotFocus() Call Book.selectTxt(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 IfEnd Sub

Private Sub TxtFee_GotFocus() Call Book.selectTxt(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 IfEnd Sub

Private Sub TxtFirst_GotFocus() Call Book.selectTxt(TxtFirst)End Sub

http://www.chetanasprojects.com

Page 63: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Private Sub TxtFirst_KeyPress(KeyAscii As Integer) KeyAscii = alpha(KeyAscii)End Sub

Private Sub TxtLast_GotFocus() Call Book.selectTxt(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]='" &

CmbClass.Text & "' and [Yer]='" & CmbClassYear.Text & "' and " & CmbSearch.Text & " like('" & TxtSearch & "%') order by " & CmbSearch, conn, adOpenStatic, adLockReadOnly

If rs_temp.RecordCount = 0 Then MsfgSearch.Enabled = False Else MsfgSearch.Enabled = True End If Call fillMbrGrid1(Me, rs_temp) 'fill gridEnd Sub

Private Sub TxtSearch_GotFocus() TxtSearch.Locked = FalseEnd Sub

Private Sub TxtSearch_KeyPress(KeyAscii As Integer) If KeyAscii = 39 Then KeyAscii = 0 End If KeyAscii = upper(KeyAscii)

http://www.chetanasprojects.com

Page 64: Library Management System VB Project Documentation

http://www.chetanasprojects.com

End Sub

Private Sub TxtSurname_GotFocus() Call Book.selectTxt(TxtSurname)End Sub

Private Sub TxtSurname_KeyPress(KeyAscii As Integer) KeyAscii = Member.alpha(KeyAscii)End Sub

'===================================================Private Sub fillMbrGrid1(Frm As Form, rs As Recordset) Dim r As Integer Frm.MsfgSearch.Cols = 8 Frm.MsfgSearch.Rows = rs.RecordCount + 1 If rs.RecordCount > 0 Then rs.MoveFirst For r = 1 To rs.RecordCount Frm.MsfgSearch.TextMatrix(r, 0) = r Frm.MsfgSearch.TextMatrix(r, 0) = r Frm.MsfgSearch.TextMatrix(r, 1) = rs.Fields(0) Frm.MsfgSearch.TextMatrix(r, 2) = rs.Fields(1) & " " &

rs.Fields(2) & " " & rs.Fields(3) Frm.MsfgSearch.TextMatrix(r, 3) = Format(rs.Fields(4),

"dd-mm-yyyy") Frm.MsfgSearch.TextMatrix(r, 4) = rs.Fields(6) Frm.MsfgSearch.TextMatrix(r, 5) = rs.Fields(9) Frm.MsfgSearch.TextMatrix(r, 6) = rs.Fields(10) Frm.MsfgSearch.TextMatrix(r, 7) = rs.Fields(12) rs.MoveNext Next End IfEnd Sub

FORM – 9 : MEMBER TRANSFER (FrmTransfer)

http://www.chetanasprojects.com

Page 65: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 9 : MEMBER TRANSFER (FrmTransfer)

Option Explicit

http://www.chetanasprojects.com

Page 66: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Dim rs As New ADODB.RecordsetDim rs1 As New ADODB.Recordset

Dim i As Integer, cnt As IntegerDim Qry As String

Private Sub CmbClassFrom_Click() Call fillYear(CmbClassFrom, CmbClassYearFrom) CmbClassYearFrom.Text = CmbClassYearFrom.List(0)End Sub

Private Sub CmbClassTo_Click() Call fillYear(CmbClassTo, CmbClassYearTo) CmbClassYearTo.Text = CmbClassYearTo.List(0)End Sub

Private Sub CmbClassYearFrom_Click() Set rs = New Recordset rs.Open "SELECT * FROM Mbr_Mast WHERE [Crs]='" &

CmbClassFrom & _ "' AND [Yer]='" & CmbClassYearFrom & "'", conn,

adOpenStatic, adLockReadOnly LstFrom.Clear If rs.RecordCount > 0 Then

Do While Not rs.EOF LstFrom.AddItem rs.Fields(0) & " " & _ rs.Fields(1) & " " & rs.Fields(2) & " " & rs.Fields(3) rs.MoveNext Loop End IfEnd Sub

Private Sub CmbClassYearTo_Click()

http://www.chetanasprojects.com

Page 67: Library Management System VB Project Documentation

http://www.chetanasprojects.com

Set rs1 = New Recordset rs1.Open "SELECT * FROM Mbr_Mast WHERE [Crs]='" &

CmbClassTo.Text & _ "' AND [Yer]='" & CmbClassYearTo.Text & "' ORDER BY

Code", conn, adOpenStatic, adLockReadOnly LstTo.Clear If rs1.RecordCount > 0 Then

Do While Not rs1.EOF LstTo.AddItem rs1.Fields(0) & " " & _ rs1.Fields(1) & " " & rs1.Fields(2) & " " & rs1.Fields(3) rs1.MoveNext Loop

End IfEnd Sub

Private Sub CmdCancel_Click() Unload Me FrmMember.ShowEnd Sub

Private Sub CmdTransfer_Click() 'WHEN TRANSFER TO SAME CLASS & YEAR If CmbClassFrom.Text = CmbClassTo.Text And

CmbClassYearFrom.Text = CmbClassYearTo.Text Then

MsgBox "Member can not transfer to same class and year", vbInformation, "Member Transfer"

Exit Sub End If

If rs1.RecordCount = 0 Then Qry = "UPDATE Mbr_Mast SET [Crs]='" & CmbClassTo.Text &

_ "',[Yer]='" & CmbClassYearTo.Text & "' WHERE [Crs]='" & _

http://www.chetanasprojects.com

Page 68: Library Management System VB Project Documentation

http://www.chetanasprojects.com

CmbClassFrom.Text & "' AND [Yer]='" & CmbClassYearFrom.Text & "'" conn.Execute Qry MsgBox "Member transmitted successfully.", vbInformation,

"Member Transfer" LstFrom.Clear Call CmbClassYearTo_Click 'TO RETRIVE UPDATED DATA Else MsgBox "Destination Class is not empty.", vbInformation,

"Member Transfer" End IfEnd Sub

Private Sub Form_Load() CmbClassFrom.Text = CmbClassFrom.List(0) CmbClassTo.Text = CmbClassTo.List(0) End Sub

'==================================================='FILL YEAR COMBO BOXPublic Sub fillYear(c As Control, y As Control) y.Clear If c.Text = "BBA" Or c.Text = "BCOM" Then y.AddItem "FY" y.AddItem "SY" y.AddItem "TY" ElseIf c.Text = "PGDCA" Or c.Text = "DCS" Then For i = 1 To 2 y.AddItem "SEM" & i Next Else

http://www.chetanasprojects.com

Page 69: Library Management System VB Project Documentation

http://www.chetanasprojects.com

For i = 1 To 6 y.AddItem "SEM" & i Next End If

End Sub

FORM – 10 : BOOK OPERATIONS (FrmBkEntry)

http://www.chetanasprojects.com

Page 70: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 11 : ISSUE BOOK/CD (FrmBookIsu)

http://www.chetanasprojects.com

Page 71: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 12 : SUBMIT BOOK/CD (FrmBookIsu)

http://www.chetanasprojects.com

Page 72: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 13 : ISSUE DETAIL (FrmIsuDtl)

http://www.chetanasprojects.com

Page 73: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 14 : MEMBER & ISSUE REPORT CREATION (FrmRpt)

http://www.chetanasprojects.com

Page 74: Library Management System VB Project Documentation

http://www.chetanasprojects.com

FORM – 15 : ABOUT APPLICATION (FrmAbout)

http://www.chetanasprojects.com