Anda di halaman 1dari 102

Library Management System

INDEX
ACKNOWLEDGEMENT CERTIFICATE INTRODUCTION SYSTEM ANALYSIS PREFACE :02 :03 :04 :05 :06

HARDWARE REQUIREMENT:07 FRONT END BACK END STRUCTURE CHART INTERFACES DATABASE DESIGN CODING :08 :09 :10-11 :12-20 :21-26 :27-93

TESTING & IMPLEMENTATIONS:94

Library Management System

Acknowledgement
We express our special and profound gratitude to Guides Mr. Munish Sir (HoD BCA Department), without whos coopration, observation and interest this project would not have been completed easily. We are highly greatfull to them. They guided us through out the project, and helped us in removing all the drawbacks from it. We would like to thank our lab incharge Mr. KP Singh who extended full cooperation & guided to us and responded to our requests positively whenever we approached his. His help all the time in the course of this study was very inspiring. We thankful to our library incharge for given us a valuable guidance of Library. With out their guidance we were no able to complete this Project.

Library Management System

Certificate
This is to certify that project entitled Library Management System has been Developed by Anshul, Prashant Kumar, Avinash Prashad and Sandeep Kuamr student of BCA VI Semester of FIT of BCA under my supervision. They worked on the Library Management System. They had used Visual Basic Computer language tool for the Project. Their work is Excellent. I wish them all the best for their bright future. Mr. Munish (HOD (dept.of B.C.A))

Library Management System

LIBRARY MANAGEMENT SYSTEM

Library management is to manage books in particular way so that easy transaction may become possible. In the library there are different books on rack for eg. one rack may belong to chemistry ,one to history and so on . Generally books are managed in library on the basis of subjects so that one can get a particular book. Now-a-days when every field is getting computerized then it become necessary to computerized the library system. In library management every book is on the rack which contains every information about book as its author name, publication . In library racks refers to subjects in library . Suppose there are three racks in library as chemistry, computer , history . In the rack of chemistry there are books related to chemistry of different authors and publications. In the same way computer will contain computer books. In library when someone issues book then a record is stored for transaction. Transaction record will contain system that every information about the rack is stored in database .In database there are information about the member such as members name , address, phone no, membership duration etc. and about books such as book name ,author name, date of issue ,date of return which will depend on the librarian .Every library have its own rules about the transaction of a book and it is depend on the rules that in how much time a member can return a book . If a member does not return the book within the predefined time then he will be charged with fine. When member returns the book then his/her transaction is removed from the record. This process is continued for all the members who issue/return the book. In computerized library management system one table is also maintained for transaction, in which every record for book issue or return is stored there. When someone issue the book then a record is stored there and when he returns it then this record is deleted. Thus library management is a well planned record keeping system of books.

Library Management System

SYSTEM ANALYSIS
System analysis means to analysis the system. System study deals with every aspect of the system. In this topic I made a picture about the manual system and the computerized system and show you a difference between the both system.

MANUAL SYSTEM:
In the manual library management system every work is done manually. Every record pertaining to book is maintained in the file. There are different racks in the library so there are too much files of record keeping .When someone issue a book then a record is also maintained separately . When he/she return the book then this record is removed. In this way all manipulation takes lots of time. By mistake files may be lost or it may be damaged .Conclusion is that a manual library management is very time consuming.

COMPUTERIZED SYSTEM:
In the computerized system every task is handled with the help of computer. If one want to see the details of every book in a particular rack then he can. Programmer may lock the program and may use his password. In the manual system one has to search for the file. One may easily search the book and information about the members can be received. If one want to search the book then he/she has to click the button only and has to enter data. But computerized system needs full electricity and dust free room. In this system, if programmer has no password then one may misuse this. So programmer should take care of it. In this way the main advantage of computerized system over manual system is that it is time not consuming. Now a days when time is a major factor then it needs to reduce the time as possible. It is not recommended that user(may be librarian) should have deep knowledge of the programming. He should have the knowledge about the data entry and other fundamentals concepts. In this way I can say that a computerized system whether it is banking system or school management or library management each needs to be computerized.

Library Management System

PREFACE
Computer is one of the most powerful tools that man has ever created. Long ago, computers wereused for scientific and engineering application but presently most of work is done by the computers is of non computational type. My project is based on the computerized management of library. My project, entitled Library Management System, is aimed at providing easy way for the maintenance of consumer database in a Library. It comprises of a menu that provides four options and a user can go for any option that corresponds to the associated task. This software covers: To Issue a book To Return a book Member Information Book information There is also a provision for obtaining reports. I have worked my best to make this software user friendly. Any suggestion for the enhancement of this software is welcome.

Library Management System

HARDWARE REQUIREMENT
This software runs within any environment. This software needs at least Pentium processor 32 MB RAM memory , 2.1 GB of Hard disk , SVGA display of 1 MB video memory and Color monitor but with this lot of processor power consumed and speed of the system will be very slow. Therefore a realistic hardware configuration for this software is:Processor Operating System Ram Memory Monitor Hard Disk Display Keyboard Printer Mouse Storage Device : : : : : : : : : : Pentium 3 or higher processor Microsoft window 98 128 MB VGA Monitor or high resolution Monitor 8.4 GB of free space required during installation MGA/CGA/EGA/VGA cord 104 keys H P Laser True Mouse Floppy Disk 1.44 MB 6.0

Visual Basic version :

Library Management System

FRONT END
VISUAL BASIC has been developed by Microsoft. Visual Basic can use a large number of reference libraries and components. Visual Basic-the environment provides integration with a variety of other tools, including source code management, component reuse tools and data manipulation. Visual Basic truly is much more of a programming environment than just a language. Using this environment, a single developer can quickly create a simple application; a team of developers can create a sophisticated, distributed application.

Features in Visual Basic 6.0


Data access Internet features Controls Component creation Language Wizards Visual Basic has evolved to be much more than a language-it is an application producing machine. No other development environment on the planet provides as wide a variety ofcapabilities in the box as Visual Basic. Even though Visual Basic is much more productive than other tools, it also requires more discipline to produce clean design. A key to improving your programming technique is to embrace the capabilities to create classes and ActiveX components in Visual Basic. As system become more complex and distributed, no single tool can address all of the needs of the system. Visual Basic provides the development environments with the raw tools needed to build small systems as well as components of large systems If we look at all of the new features and functions added to the 6.0 release of the Visual Basic, a couple of themes become evident: the internet and the database

Library Management System

BACK END
A database is a collection of information that's related to a particular subject 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 a variety of sources that you have having to coordinate and organize yourself. For example, suppose the phone numbers of your suppliers are stored in various locations: in a card file containing supplier phone numbers, in product information files in a file cabinet, and in a spreadsheet containing order information. If a supplier's phone number changes, you might have to update that information in all three places. In a database, however, you only have to update that information in one place the supplier's phone number is automatically updated wherever you use it in the database. Using Microsoft Access, you can manage all your information from a single database file. Within the file, you can use:

Tables to store your data. Queries to find and retrieve just the data you want. Forms to view, add, and update data in tables. Reports to analyze or print data in a specific layout. Data access pages to view, update, or analyze the database's data from the Internet or an intranet.

You can do the following to take advantage of the accessibility features in Access:

View and print lists of all available shortcut keys. Use the keyboard to define relationships, add or copy text boxes or other controls on forms and reports, and rearrange columns in Datasheet view. Create a toolbar that contains only the buttons and menus you use most often for the current database or for all your databases. You can also increase the size of the buttons and group related buttons together. Set menus to display all commands all the time. You can also change toolbars to appear as they did in earlier versions of Office. Create custom colors or change the background color for a section or control on a form or report. Insert repeated entries in a column quickly by using the keyboard. Automatically correct common typing errors and even specify a list of errors you want corrected as you type

Library Management System

10

Library Management System

Introduction Screen

Login Form

Change Password

Menu Form

Issue Form

Return Form

Member Form

Book Form

Book info Form

11

Library Management System

ACTIVITY 1 : SURVEY This activity is also known as the feasibility study. It begins with a request from the user for a new system. It involves the following: Identify the responsible users for the system. Clarify the user request. Identify deficiencies in the current system. Establish goals and objectives for the new system. Prepare a project charter that will be used to guide the remainder of the project.

ACTIVITY 2 : SYSTEM ANALYSIS

The objectivity of system analysis is to develop structured system specification for the proposed system. The structured system specification should describe what the proposed system would do, independent of technology that will be used to
12

Library Management System

implement these requirements. The structured system specification will be called the essential model in many books essential model is called the logical model. The essential model itself consists of multiple models, modelling different aspect of the system. The data flow diagrams may model the function of the system, entity relationship diagrams may model the data and their relationship and the state transition diagrams may model time dependent behaviour of the system. The essential model in this project consist of only process model i.e. data flow diagram. The essential model thus consist of the following : Context Diagram. Event List. Levelled Data Flow Diagram. Process Specification for the Flows and Stores on the DFDs. Understand the current information system. Analyse the current system to find the deficiencies in it. Develop the functional specification for the new system. Review the Feasibility, and Cost-Benefit Analysis.

ACTIVITY 3 : PRELIMINARY DESIGN

This activity deals with certain design issues, which are to be finalised in consultation with the user. The two most important design issues of the relevance to the user are the automation boundary and the human-machine interface, the output
13

Library Management System

of this proposed system. This model in addition to the essential model defines the following for the proposed system. Automation Boundary Report Layout. Screen Layout for the Data Entry Forms. The parts of the new system consist of. The physical layout of the input and output document. The user interface of the software for the system.

ACTIVITY 4: SYSTEM DESIGN

System design involves transformation of the user implementation model into software design. The design specification of the proposed system consist of the following: Develop the modules structure for the software. Develop the specification for each module. Design the file layout or the database.

0LEVEL DFD FOR LIBRARY MANAGEMENT SYSTEM


14

Library Management System

15

Library Management System

ACTIVITY 5: IMPLEMENTATION

This activity is actually concerned with the development of software. It includes various operations: Programming Testing Integration of modules into a progressively more complete system.

ACTIVITY 6: ACCEPTANCE TEST GENERATION

This activity generates a set of test data, which can be used to test the new system before accepting information technology.

ACTIVITY 7: QUALITY ASSURANCE

Quality assurance is also known as final testing or acceptance testing. This activity requires, as its input, acceptance test data generated in activity 6 and an integrated system produced by activity 5.

16

Library Management System

ACTIVITY 8: PROCEDURE DESCRIPTION

This activity involves the development of the user manual for the new system. Here we describe the process we have given in implementation activity.

ACTIVITY 9: DATABASE CONVERSION

This activity involves conversion of data from the existing system to the new system.

ACTIVITY 10: INSTALLATION

This is the last activity in the system development life cycle. The changeover from the current system to the new system is done. This project involved all the activities in the life cycle except for database conversion and installation

17

Library Management System

Problem With Conventional(Manual) System

This is Problem definition and it includes the description of the current system and the deficiencies in the current system. Current system is manual maintenance of all the entities and transaction of the library.

1.

Lack of the immediate information retrieval :

The manual system lacks immediate retrieval of information. This problem is common to all of us just to retrieve the information about the availability of Books, etc...

2.

Lack of immediate information storage :

The manual system lack immediate storage of information. To store proper information at proper place, we need to find a proper place in our books and we need to store the information at the places that can be easily searched.

3.

Lack prompt updating:

Nothing is permanent every thing changes, as time passes on. The same stands true with the system, which we are talking about, one can imagine, how difficult it
18

Library Management System

is, to alter some information written on the piece of paper. One way to alter is just cut off and throws away the paper and rewrites the same information with minor changes on the fresh sheet of paper. Another way is erase the previous information. Both are disgusting.

4.

Lack storing of information:

Information is not an information, if it is unordered. In fact it is nothing more than a raw data. To make data useful we need to store it on various basis like on the basis of Book code, Title id, subject id, etc., but imagine how to store information in a manual system.

5.

Redundancy of information:

We have to make transactions with number of book at a number of times. There are always chances of recording information about the same book number of times. This is redundancy. Redundancy invites inconsistency. In case some information about a member or book is maintained twice or more than twice in future, if modification done at one place then how will you be able to decide which of the various information about the same is correct.

6.

Preparation of accurate and prompt reports :

Preparation of fine report, total number of missing book reports etc. becomes really difficult in a manual system. Even after hard work if one able to prepare it then it is not guaranteed that the prepared report is accurate and up to date whereas this is not the case with computerised systems.
19

Library Management System

20

Library Management System

21

Library Management System

22

Library Management System

23

Library Management System

24

Library Management System

25

Library Management System

26

Library Management System

27

Library Management System

28

Library Management System

29

Library Management System

DATABASE TABLE NAME:-BOOK

FIELD NAME B_ID B_NAME B_SUBJECT B_COPY B_ISSUE B_LANGUAGE B_COST B_AUTHORNAME

DATA TYPE Long Text Text Long Long Text Integer Text

30

Library Management System

DATABASE TABLE NAME:-CUSTOMER

FIELD NAME C_ID C_NAME C_ADDRESS C_PHONENO C_MEMBERSHIPTYPE C_JOININGTIME C_TRANSACTION C_GNAME B_ID B_ISSUEDATE MEMBERSHIP_CHARGE

DATA TYPE Long Text Text Long Long Date/Time Long Text Long Date/Time Long

31

Library Management System

DATABASE TABLE NAME:-PASSWORD

FIELD NAME USER_NAME PASSWORD

DATA TYPE Text Text

32

Library Management System

DATABASE TABLE NAME:-PENALTY

FIELD NAME PENALTY_NO PENALTY REMARK PENALTY_DATE B_ID C_ID ISSUE_DATE RETURN_DATE

DATA TYPE Long Long Text Date/Time Long Long Date/Time Date/Time

33

Library Management System

DATABASE TABLE NAME:-TRANSACTION

FIELD NAME ISSUE_DATE RETURN_DATE PENALTY_NO STATUS B_ID C_ID T_NO

DATA TYPE Date/Time Date/Time Long Text Long Long Long

34

Library Management System

35

Library Management System


VERSION 5.00 Begin VB.Form frmSplash BackColor = &H00000000& BorderStyle = 3 'Fixed Dialog ClientHeight = 6795 ClientLeft = 255 ClientTop = 1410 ClientWidth = 8430 ClipControls = 0 'False ControlBox = 0 'False Icon = "peacesplash.frx":0000 KeyPreview = -1 'True LinkTopic = "Form2" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 6795 ScaleWidth = 8430 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen Begin VB.Timer Timer1 Interval = 2000 Left = 630 Top = 2400 End Begin VB.Label lblLicenseTo Alignment = 2 'Center BackStyle = 0 'Transparent BorderStyle = 1 'Fixed Single Caption = " LIBRARY MANAGEMENT SYSTEM" BeginProperty Font Name = "Arial" Size = 20.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 525 Left = 728 TabIndex = 5 Top = 360 Width = 6975 End Begin VB.Image Image1 Height = 2505 Left = 2595 Picture = "peacesplash.frx":000C Stretch = -1 'True Top = 930 Width = 3240 End Begin VB.Label Label1 BackStyle = 0 'Transparent Caption = $"peacesplash.frx":0124 BeginProperty Font Name = "MS Sans Serif"

36

Library Management System


Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Label Label2 BackStyle = Caption = BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Label Label3 BackStyle = Caption = BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Label Label4 BackStyle = Caption = BeginProperty Font Name Size Charset Weight = = = = = = 9.75 0 700 0 'False 0 'False 0 'False 1005 473 4 3720 7485 0 'Transparent "This project is develop by :" = = = = = = = "MS Sans Serif" 9.75 0 700 0 'False 0 'False 0 'False

285 3810 3 5310 2895 0 'Transparent "Km. Meenakshi " = = = = = = = "MS Sans Serif" 9.75 0 700 0 'False 0 'False 0 'False 285 5070 2 5730 1905 0 'Transparent "M.I.S (D.A.V College)" = = = = "MS Sans Serif" 9.75 0 700

37

Library Management System


Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Label Label5 BackStyle = Caption = BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Image Image2 Height = Left = Picture = Stretch = Top = Width = End End Attribute Attribute Attribute Attribute Attribute = = = 0 0 0 255 5070 1 5970 2355 0 'Transparent "Muzaffarnagar" = = = = = = = "MS Sans Serif" 9.75 0 700 0 'False 0 'False 0 'False 255 5070 0 6240 1605 6615 120 "peacesplash.frx":0298 -1 'True 90 8205 'False 'False 'False

VB_Name = "frmSplash" VB_GlobalNameSpace = False VB_Creatable = False VB_PredeclaredId = True VB_Exposed = False

Option Explicit Private Sub Timer1_Timer() frmLogin.Show Timer1.Enabled = False End Sub

38

Library Management System

VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 1980 ClientLeft = 60 ClientTop = 345 ClientWidth = 5460 LinkTopic = "Form1" ScaleHeight = 1980 ScaleWidth = 5460 StartUpPosition = 3 'Windows Default Begin VB.Frame Frame1 Caption = "Frame1" Height = 1695 Left = 120 TabIndex = 0 Top = 120 Width = 5175 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False

39

Library Management System


VERSION 5.00 Begin VB.Form menu BackColor = &H8000000B& Caption = "Menu Form" ClientHeight = 7335 ClientLeft = 60 ClientTop = 345 ClientWidth = 1590 Icon = "menu.frx":0000 LinkTopic = "Form2" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 7335 ScaleWidth = 1590 StartUpPosition = 3 'Windows Default Begin VB.Timer Timer2 Interval = 996 Left = 540 Top = 3000 End Begin VB.Timer Timer1 Interval = 500 Left = 1170 Top = 690 End Begin VB.Frame Frame2 BackColor = &H8000000A& Height = 3720 Left = 120 TabIndex = 5 Top = 3510 Width = 1305 Begin VB.CommandButton Cmdexit Caption = "&Exit" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 90 TabIndex = 4 ToolTipText = "Click here to Exit " Top = 3300 Width = 1155 End Begin VB.CommandButton Cmdbook Caption = "&Book" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700

40

Library Management System


Underline Italic Strikethrough EndProperty Height = Left = Style = TabIndex = ToolTipText = Top = Width = = = = 0 -1 0 'False 'True 'False

375 90 1 'Graphical 3 "To open the book form " 2511 1155

End Begin VB.CommandButton Cmdmember Caption = "&Member" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 90 Style = 1 'Graphical TabIndex = 2 ToolTipText = "To open the Member Information form" Top = 1724 Width = 1155 End Begin VB.CommandButton Cmdreturn Caption = "&Return" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 90 Style = 1 'Graphical TabIndex = 1 ToolTipText = "To open the Return form" Top = 937 Width = 1155 End Begin VB.CommandButton Cmdissue BackColor = &H8000000A& Caption = "&Issue" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0

41

Library Management System


Weight Underline Italic Strikethrough EndProperty Height = Left = Style = TabIndex = ToolTipText = Top = Width = End End Begin VB.Label Lbld Height = Left = TabIndex = Top = Width End Begin VB.Label Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Image BorderStyle Height Left Picture Stretch Top Width End Begin VB.Label Alignment BackColor = Lblt = = = = = Lbldat = = = = = = Lbltim = = = = = = Image1 = = = = = = = Label3 = = 345 810 11 2130 825 "Date" 315 60 10 2610 525 "Time" 315 60 9 2130 495 1 'Fixed Single 915 240 "menu.frx":0442 -1 'True 1080 975 2 'Center &H00C0C0FF& = = = = 700 0 'False -1 'True 0 'False 375 90 1 'Graphical 0 "To open the Issue form" 150 1155

345 810 12 2610 795

42

Library Management System


BackStyle = Caption = BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Label Label2 Alignment = BackColor = BackStyle = Caption = BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End Begin VB.Label Label1 Alignment = BackColor = BackStyle = Caption = BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End 0 'Transparent "SYSTEM" = = = = = = = "MS Sans Serif" 9.75 0 700 0 'False 0 'False 0 'False 300 120 8 600 1320 2 'Center &H00C0C0FF& 0 'Transparent "MANAGEMENT" = = = = = = = "MS Sans Serif" 9.75 0 700 0 'False 0 'False 0 'False 285 -15 7 360 1695 2 'Center &H00C0C0FF& 0 'Transparent "LIBRARY" = = = = = = = "MS Sans Serif" 9.75 0 700 0 'False 0 'False 0 'False 285 120 6 120 1305

43

Library Management System


End Attribute VB_Name = "menu" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Cmdbook_Click() On Error Resume Next menu.Show member.Hide book.Show return1.Hide End Sub Private Sub Cmdexit_Click() On Error Resume Next Dim choice As Integer choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then End End If End Sub Private Sub Cmdissue_Click() On Error Resume Next menu.Show member.Hide book.Hide issue.Show return1.Hide End Sub Private Sub Cmdmember_Click() On Error Resume Next member.Show menu.Show End Sub Private Sub Cmdreturn_Click() On Error Resume Next return1.Show issue.Hide menu.Show member.Hide book.Hide End Sub Private Sub Form_Load() On Error Resume Next Me.Top = 0 Me.Left = 0 Me.Height = Screen.Height - 420 Lblt.Caption = Time Lbld.Caption = Date

44

Library Management System


End Sub

Private Sub Timer1_Timer() On Error Resume Next Static c As Boolean If c = True Then Label1.ForeColor = Label2.ForeColor = Label3.ForeColor = c = False Else Label1.ForeColor = Label2.ForeColor = Label3.ForeColor = c = True End If End Sub Private Sub Timer2_Timer() Lblt.Caption = Time End Sub

QBColor(5) QBColor(5) QBColor(5) QBColor(4) QBColor(4) QBColor(4)

45

Library Management System


VERSION 5.00 Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" Begin VB.Form issue Caption = "issue" ClientHeight = 8595 ClientLeft = 60 ClientTop = 345 ClientWidth = 10920 Icon = "issue.frx":0000 LinkTopic = "Form1" ScaleHeight = 8595 ScaleWidth = 10920 StartUpPosition = 3 'Windows Default Begin VB.Frame Frame4 Height = 615 Left = 180 TabIndex = 48 Top = 7260 Width = 8175 Begin VB.CommandButton Cmdissue Caption = "Issue" Height = 330 Left = 5610 TabIndex = 50 ToolTipText = "Click here to issue the Book to the Customer" Top = 210 Width = 810 End Begin VB.CommandButton Cmdexit Caption = "Exit" Height = 330 Left = 7080 TabIndex = 49 ToolTipText = "Click here to exit" Top = 210 Width = 795 End Begin MSComCtl2.DTPicker DTPickerrdate Height = 255 Left = 3930 TabIndex = 51 ToolTipText = "Enter date of Book return" Top = 210 Width = 1125 _ExtentX = 1984 _ExtentY = 450 _Version = 393216 Format = 24510465 CurrentDate = 37715 End Begin MSComCtl2.DTPicker DTPickeridate Height = 255 Left = 1320 TabIndex = 52 ToolTipText = "Enter date of Book issue" Top = 210

46

Library Management System


Width _ExtentX _ExtentY _Version Format CurrentDate = = = = = = 1125 1984 450 393216 24510465 37714

End Begin VB.Label Lblidat Caption = "Issue_Date" Height = 240 Left = 150 TabIndex = 54 Top = 210 Width = 975 End Begin VB.Label Lblrdat Caption = "Return_Date" Height = 240 Left = 2640 TabIndex = 53 Top = 210 Width = 1110 End End Begin VB.Frame Frame3 Height = 3165 Left = 180 TabIndex = 26 Top = 4050 Width = 8145 Begin VB.CommandButton Cmdok Caption = "Ok" Height = 300 Left = 3060 TabIndex = 36 ToolTipText = "Click here to know the information about Book" Top = 315 Width = 585 End Begin VB.ComboBox Cmbbid Height = 315 Left = 1800 TabIndex = 35 ToolTipText = "Click here to select the Book id" Top = 285 Width = 900 End Begin VB.TextBox Txtbook Height = 315 Left = 5520 TabIndex = 34 Top = 2385 Width = 1035 End Begin VB.TextBox Txtissue Height = 315 Left = 1800

47

Library Management System


TabIndex Top Width = = = 33 2340 735

End Begin VB.TextBox Txtcopy Height = 315 Left = 5520 TabIndex = 32 Top = 1845 Width = 1050 End Begin VB.TextBox Txtsub Height = 315 Left = 1800 TabIndex = 31 Top = 1815 Width = 1860 End Begin VB.TextBox Txtcost Height = 315 Left = 5520 TabIndex = 30 Top = 1305 Width = 1425 End Begin VB.TextBox Txtlang Height = 315 Left = 1800 TabIndex = 29 Top = 1290 Width = 1845 End Begin VB.TextBox Txtbaname Height = 315 Left = 5520 TabIndex = 28 Top = 765 Width = 2250 End Begin VB.TextBox Txtbname Height = 315 Left = 1800 TabIndex = 27 Top = 765 Width = 1830 End Begin VB.Label Lblbook Caption = "Books_Remaining" Height = 360 Left = 3960 TabIndex = 47 Top = 2295 Width = 1305 End Begin VB.Label Lblmsg2 Caption = "Message" Height = 390

48

Library Management System


Left TabIndex Top Width = = = = 45 46 2745 990

End Begin VB.Label Lblissue Caption = "Book_Issue" Height = 375 Left = 60 TabIndex = 45 Top = 2310 Width = 1050 End Begin VB.Label Lblcopy Caption = "Book_Copy" Height = 375 Left = 3960 TabIndex = 44 Top = 1770 Width = 900 End Begin VB.Label Lblbid Caption = "Book_ID" Height Left TabIndex Top Width = = = = = 315 840 43 240 675 "Book_Subject" 330 30 42 1770 1275 "Book_Cost" 375 3960 41 1245 900 "Book_Language" 345 30 40 1230 1200

End Begin VB.Label Lblsub Caption = Height = Left = TabIndex = Top = Width = End Begin VB.Label Lblcost Caption = Height = Left = TabIndex = Top = Width = End Begin VB.Label Lbllang Caption = Height Left TabIndex Top Width = = = = =

End Begin VB.Label Lblbaname Caption = "Book_Author Name"

49

Library Management System


Height Left TabIndex Top Width = = = = = 360 3960 39 735 1545

End Begin VB.Label Lblbname1 Caption = "Book_Name" Height = 315 Left = 30 TabIndex = 38 Top = 705 Width = 1020 End Begin VB.Label Lblmess Height = 375 Left = 1170 TabIndex = 37 Top = 2760 Width = 6255 End End Begin VB.Frame Frame2 Height = 3015 Left = 180 TabIndex = 7 Top = 1050 Width = 8145 Begin VB.CommandButton Cmdok2 Caption = "Ok" Height = 315 Left = 3120 TabIndex = 15 ToolTipText = "Click here to know the information of member of a given Customer id" Top = 255 Width = 585 End Begin VB.ComboBox Cmbcid Height = 315 Left = 1890 TabIndex = 14 ToolTipText = "Click here to select Customer id " Top = 270 Width = 930 End Begin VB.TextBox Txtjdate Height = 315 Left = 5610 TabIndex = 13 Top = 1770 Width = 1365 End Begin VB.TextBox Txtpno Height = 315 Left = 5610

50

Library Management System


TabIndex Top Width = = = 12 1215 1575

End Begin VB.TextBox Txtaddress Height = 315 Left = 5610 MultiLine = -1 'True TabIndex = 11 Top = 660 Width = 2415 End Begin VB.TextBox Txtmemtype Height = 315 Left = 1890 TabIndex = 10 Top = 1770 Width = 705 End Begin VB.TextBox Txtfhn Height = 315 Left = 1890 MultiLine = -1 'True TabIndex = 9 Top = 1245 Width = 1830 End Begin VB.TextBox Txtname Height = 315 Left = 1890 MultiLine = -1 'True TabIndex = 8 Top = 720 Width = 1830 End Begin VB.Label Label6 Caption = "Year" Height = 375 Left = 2880 TabIndex = 25 Top = 1770 Width = 495 End Begin VB.Label Label10 Caption = "Message" Height = 375 Left = 90 TabIndex = 24 Top = 2250 Width = 1035 End Begin VB.Label Label9 Caption = "Customer_Joining Date" Height = 405 Left = 3870 TabIndex = 23 Top = 1740

51

Library Management System


Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Height Left TabIndex Top Width End = Label8 = = = = = = Label7 = = = = = = Label5 = = = = = = Label4 = = = = = = Label3 = = = = = = Label2 = = = = = = 1470 "Customer_Membership Type" 450 90 22 1740 1725 "Customer_PhoneNo" 285 3870 21 1260 1485 "Customer Father/Husband_Name " 360 90 20 1200 1755 "Customer_Address" 300 3870 19 780 1380 "Customer_Name" 270 90 18 720 1170 "Customer_ID" 300 870 17 240 945

Lblmessage = 405 = 1200 = 16 = 2220 = 6435

52

Library Management System


End Begin MSFlexGridLib.MSFlexGrid FlexGridD Height = 3555 Left = 8280 TabIndex = 6 Top = 480 Width = 2595 _ExtentX = 4577 _ExtentY = 6271 _Version = 393216 AllowUserResizing= 1 End Begin VB.Frame Frame1 Height = 945 Left = 1950 TabIndex = 3 Top = 90 Width = 4965 Begin MSFlexGridLib.MSFlexGrid FlexGridc Height = 3615 Left = 6120 TabIndex = 4 Top = 510 Width = 2565 _ExtentX = 4524 _ExtentY = 6376 _Version = 393216 AllowUserResizing= 1 End Begin VB.Label Lblcaption BorderStyle = 1 'Fixed Single Caption = "ISSUE BOOK" BeginProperty Font Name = "Monotype Corsiva" Size = 20.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 705 Left = 1680 TabIndex = 5 Top = 180 Width = 2505 End Begin VB.Image Image1 BorderStyle = 1 'Fixed Single Height = 855 Left = 60 Picture = "issue.frx":0442 Stretch = -1 'True Top = 90 Width = 1080 End End

53

Library Management System


Begin VB.Timer Timer1 Interval = 700 Left = 390 Top = 210 End Begin MSFlexGridLib.MSFlexGrid FlexGridb Height = 3585 Left = 8340 TabIndex = 0 Top = 4440 Width = 2565 _ExtentX = 4524 _ExtentY = 6324 _Version = 393216 AllowUserResizing= 1 End Begin VB.Label Label12 Caption = "ABOUT BOOK" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 315 Left = 8370 TabIndex = 2 Top = 4080 Width = 2505 End Begin VB.Label Label1 Caption = "ABOUT CUSTOMER " BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 8190 TabIndex = 1 Top = 60 Width = 2655 End End Attribute VB_Name = "issue" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim r As Integer

54

Library Management System


Dim Dim Dim Dim rS1 As Recordset rS2 As Recordset db As Database rS3 As Recordset

Private Sub Cmdexit_Click() On Error Resume Next Dim choice As Integer choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then Me.Hide End If End Sub Private Sub Cmdissue_Click() On Error Resume Next db.Execute ("update BOOK set B_ISSUE=B_ISSUE+1 where B_ID=" & Cmbbid.Text) db.Execute ("update CUSTOMER set B_ISSUEDATE = #" & DTPickeridate.Value & "# where c_id=" & Val(Cmbcid.Text)) db.Execute ("update CUSTOMER set B_ID=" & Val(Cmbbid.Text) & " where c_id=" & Val(Cmbcid.Text)) rS3.AddNew rS3("B_ID") = Val(Cmbbid.Text) rS3("C_ID") = Val(Cmbcid.Text) rS3("ISSUE_DATE") = DTPickeridate.Value rS3("RETURN_DATE") = DTPickerrdate.Value rS3.Update Set rS3 = db.OpenRecordset("select max(t_no) from transaction") db.Execute ("update CUSTOMER set c_transaction=" & rS3(0) & " where c_id=" & Val(Cmbcid.Text)) Cmdissue.Enabled = False End Sub Private Sub Cmdok2_Click() On Error Resume Next rS1.MoveFirst rS1.FindFirst ("c_id=" & Cmbcid.Text) If rS1.NoMatch = False Then If Not rS1("B_ID") = "" Then MsgBox "We cannot issue more book to this customer" Cmdissue.Enabled = False cmdOK.Enabled = False Else cmdOK.Enabled = True Txtname.Text = rS1("c_name") Txtaddress.Text = rS1("c_address") Txtfhn.Text = rS1("c_gname") Txtpno.Text = rS1("c_phoneno") Txtmemtype.Text = rS1("c_membership type") Txtjdate.Text = rS1("c_joining date") Lblmessage.Caption = "The Member Record is exist" End If Else Lblmess.Caption = "The Book Record is not exist" End If End Sub

55

Library Management System


Private Sub cmdOK_Click() On Error Resume Next rS2.MoveFirst rS2.FindFirst ("b_id=" & Cmbbid.Text) If rS2.NoMatch = False Then Txtbname.Text = rS2("B_NAME") Txtbaname.Text = rS2("B_AUTHORNAME") Txtlang.Text = rS2("B_LANGUAGE") Txtcost.Text = rS2("B_COST") Txtsub.Text = rS2("B_SUBJECT") Txtcopy.Text = rS2("B_COPY") Txtissue.Text = rS2("B_ISSUE") Txtbook.Text = rS2("B_COPY") - rS2("B_ISSUE") Lblmess.Caption = "The Book Record is exist" Cmdissue.Enabled = True If Val(Txtissue.Text) >= Val(Txtcopy.Text) Then MsgBox "There is no Book to issue" Cmdissue.Enabled = False Txtbname.Text = "" Txtbaname.Text = "" Txtlang.Text = "" Txtcost.Text = "" Txtsub.Text = "" Txtcopy.Text = "" Txtissue.Text = "" Txtbook.Text = "" End If Else MsgBox "No Book is exist" End If End Sub Private Sub FlexGridb_Click() On Error Resume Next FlexGridb.Col = 0 Cmbbid.Text = FlexGridb.Text End Sub Private Sub FlexGridD_Click() On Error Resume Next FlexGridD.Col = 0 Cmbcid.Text = FlexGridD.Text End Sub Private Sub Form_Load() On Error Resume Next r = 1 Me.Top = 0 Me.Height = Screen.Height Me.Left = menu.Width Me.Width = Screen.Width - menu.Width Set db = OpenDatabase("c:\PEACE\PEACE.MDB") Set rS1 = db.OpenRecordset("SELECT * FROM CUSTOMER") Set rS2 = db.OpenRecordset("SELECT * FROM BOOK") Set rS3 = db.OpenRecordset("SELECT * FROM TRANSACTION") rS2.MoveLast FlexGridb.Rows = rS2.AbsolutePosition + 2 FlexGridb.Col = 0 FlexGridb.Row = 0

56

Library Management System


FlexGridb.Text = "ID" FlexGridb.Col = 1 FlexGridb.Row = 0 FlexGridb.Text = "Book Name" rS2.MoveFirst Do While Not rS2.EOF Cmbbid.AddItem (rS2(0)) FlexGridb.Col = 0 FlexGridb.Row = r FlexGridb.Text = rS2("B_ID") FlexGridb.Col = 1 FlexGridb.Row = r FlexGridb.Text = rS2("B_NAME") r = r + 1 rS2.MoveNext Loop r = 1 rS1.MoveLast FlexGridD.Rows = rS1.AbsolutePosition + 2 rS1.MoveFirst FlexGridD.Col = 0 FlexGridD.Row = 0 FlexGridD.Text = "ID" FlexGridD.Col = 1 FlexGridD.Row = 0 FlexGridD.Text = "Customer Name" Do While Not rS1.EOF Cmbcid.AddItem (rS1(0)) FlexGridD.Col = 0 FlexGridD.Row = r FlexGridD.Text = rS1("C_ID") FlexGridD.Col = 1 FlexGridD.Row = r FlexGridD.Text = rS1("C_NAME") r = r + 1 rS1.MoveNext Loop Cmdissue.Enabled = False End Sub Private Sub Timer1_Timer() Static c As Boolean On Error Resume Next If c = True Then Lblcaption.ForeColor = QBColor(2) c = False Else Lblcaption.ForeColor = QBColor(4) c = True End If End Sub

VERSION 5.00 Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" Begin VB.Form return1

57

Library Management System


Caption ClientHeight ClientLeft ClientTop ClientWidth = = = = = "return" 8130 60 345 8460

Icon = "return.frx":0000 LinkTopic = "Form1" ScaleHeight = 8130 ScaleWidth = 8460 StartUpPosition = 3 'Windows Default Begin VB.Timer Timer2 Interval = 700 Left = 480 Top = 7530 End Begin MSFlexGridLib.MSFlexGrid FlexGridid Height = 1425 Left = 4470 TabIndex = 47 Top = 0 Width = 4065 _ExtentX = 7170 _ExtentY = 2514 _Version = 393216 Cols = 3 AllowUserResizing= 1 End Begin VB.Frame Frame4 Height = 1425 Left = 210 TabIndex = 45 Top = -60 Width = 4215 Begin VB.Timer Timer1 Interval = 996 Left = 150 Top = 1290 End Begin VB.Label Labeldate Height = 315 Left = 3000 TabIndex = 51 Top = 1020 Width = 1125 End Begin VB.Label Labeltime Height = 315 Left = 840 TabIndex = 50 Top = 1020 Width = 1125 End Begin VB.Label Label20 Caption = "Date" BeginProperty Font Name = "MS Sans Serif"

58

Library Management System


Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = Top = Width = = = = = = = 9.75 0 400 0 'False 0 'False 0 'False 345 2340 49 1020 795

End Begin VB.Label Label19 Caption = "Time" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 345 Left = 120 TabIndex = 48 Top = 1020 Width = 705 End Begin VB.Image Image1 BorderStyle = 1 'Fixed Single Height = 765 Left = 30 Picture = "return.frx":0442 Stretch = -1 'True Top = 120 Width = 1110 End Begin VB.Label Labelcap BorderStyle = 1 'Fixed Single Caption = "RETURN BOOK" BeginProperty Font Name = "Monotype Corsiva" Size = 20.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 645 Left = 1200 TabIndex = 46 Top = 180 Width = 2925 End

59

Library Management System


End Begin VB.Frame Frame3 Height = 780 Left = 210 TabIndex = 41 Top = 7260 Width = 8325 Begin VB.CommandButton Cmdexit Caption = "Exit" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 435 Left = 4800 TabIndex = 20 ToolTipText = "Click here to exit" Top = 210 Width = 960 End Begin VB.CommandButton Cmdreturn Caption = "Return" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 435 Left = 2400 TabIndex = 19 ToolTipText = "Click here to return the Book" Top = 210 Width = 960 End End Begin VB.Frame Frame2 Caption = "Information About Book" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 3060 Left = 210

60

Library Management System


TabIndex = 22 Top = 4140 Width = 8340 Begin VB.TextBox Txtpen Enabled = 0 'False Height = 315 Left = 6120 TabIndex = 18 Top = 2640 Width = 1335 End Begin VB.TextBox Txtcurrent Enabled = 0 'False Height = 315 Left = 2400 TabIndex = 17 Top = 2520 Width = 1455 End Begin VB.TextBox Txtret Enabled = 0 'False Height = 315 Left = 6120 TabIndex = 16 Top = 2160 Width = 1335 End Begin VB.TextBox Txtbid Enabled = 0 'False Height = 315 Left = 2400 TabIndex = 8 Top = 240 Width = 960 End Begin VB.TextBox Txtcopy Enabled = 0 'False Height = 315 Left = 6120 TabIndex = 14 Top = 1680 Width = 1125 End Begin VB.TextBox Txtcost Enabled = 0 'False Height = 315 Left = 6120 TabIndex = 12 Top = 1200 Width = 1485 End Begin VB.TextBox Txtbaname Enabled = 0 'False Height = 315 Left = 6120 MultiLine = -1 'True TabIndex = 10

61

Library Management System


Top Width = = 720 2085

End Begin VB.TextBox Txtissuedate Enabled = 0 'False Height = 315 Left = 2400 TabIndex = 15 Top = 2064 Width = 1515 End Begin VB.TextBox Txtsub Enabled = 0 'False Height = 315 Left = 2400 TabIndex = 13 Top = 1608 Width = 1560 End Begin VB.TextBox Txtlang Enabled = 0 'False Height = 315 Left = 2400 TabIndex = 11 Top = 1152 Width = 1530 End Begin VB.TextBox Txtbname Enabled = 0 'False Height = 315 Left = 2400 TabIndex = 9 Top = 720 Width = 1620 End Begin VB.Label Label9 Caption = "Penalty" Height = 255 Left = 4320 TabIndex = 44 Top = 2520 Width = 1335 End Begin VB.Label Lblcurrent Caption = "Current Date" Height = 255 Left = 120 TabIndex = 43 Top = 2520 Width = 1335 End Begin VB.Label Lblreturn Caption = "Book_Return Date" Height = 255 Left = 4320 TabIndex = 42 Top = 2070

62

Library Management System


Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width = Label17 = = = = = = Label16 = = = = = = Label15 = = = = = = Label14 = = = = = = Label13 = = = = = = Label12 = = = = = = Label11 = = = = = = 1575 "Book_Issue Date" 270 120 39 2094 1380 "Book_Copy" 285 4320 38 1590 1125 "Book_Subject" 255 120 37 1686 1545 "Book_Cost" 255 4320 36 1140 1215 "Book_Language" 315 120 35 1218 1350 "Book_Author Name" 210 4320 34 735 1470 "Book_Name" 330 120 33 735 1095

63

Library Management System


End Begin VB.Label Label10 Caption = "Book_ID" Height = 360 Left = 945 TabIndex = 32 Top = 210 Width = 840 End End Begin VB.Frame Frame1 Caption = "Information About Customer" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 2655 Left = 210 TabIndex = 21 Top = 1410 Width = 8355 Begin VB.ComboBox Cmbcid Height = 315 Left = 2430 TabIndex = 0 ToolTipText = "Click here to select the customer id" Top = 345 Width = 870 End Begin VB.TextBox Txtjdate Enabled = 0 'False Height = 285 Left = 6390 TabIndex = 7 Top = 1845 Width = 1590 End Begin VB.TextBox Txtpno Enabled = 0 'False Height = 285 Left = 6390 TabIndex = 5 Top = 1387 Width = 1860 End Begin VB.TextBox Txtaddress Enabled = 0 'False Height = 465 Left = 6390 MultiLine = -1 'True TabIndex = 3 Top = 750

64

Library Management System


Width = 1770 End Begin VB.TextBox Txtmemtype Enabled = 0 'False Height = 285 Left = 2430 TabIndex = 6 Top = 1875 Width = 930 End Begin VB.TextBox Txtfhn Enabled = 0 'False Height = 285 Left = 2430 TabIndex = 4 Top = 1375 Width = 1680 End Begin VB.TextBox Txtcname Enabled = 0 'False Height = 285 Left = 2430 TabIndex = 2 Top = 875 Width = 1605 End Begin VB.CommandButton Cmdok Caption = "Ok" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic Strikethrough EndProperty Height = Left = TabIndex = ToolTipText = customer" Top Width = = 360 540 End Begin VB.Label Label21 Caption = "Year" Height = 270 Left = 3480 TabIndex = 40 Top = 1860 Width = 615 End Begin VB.Label Lblmessage Height = 330 Left = 1080 = = 0 0 'False 'False

315 3360 1 "Click here to display the information of

65

Library Management System


TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width = = = Label8 = = = = = = Label7 = = = = = = Label6 = = = = = = Label5 = = = = = = Label4 = = = = = = 31 2250 3840 "Message" 375 180 30 2280 750 "Customer_Joining Date" 405 4665 29 1800 1395 "Customer_Membership Type" 435 165 28 1805 1665 "Customer_Phone No" 405 4665 27 1335 1560 "Customer Father/Husband Name" 405 165 26 1300 1680 "Customer_Address" 360 4665 25 840 1425 "Customer_Name" 360 165

End Begin VB.Label Label3 Caption = Height = Left = TabIndex = Top = Width = End Begin VB.Label Label2 Caption = Height = Left =

66

Library Management System


TabIndex Top Width = = = 24 825 1215 "Customer_ID" 330 1380 23 375 945

End Begin VB.Label Label1 Caption = Height = Left = TabIndex = Top = Width = End

End End Attribute VB_Name = "return1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim rS3 As Recordset Dim rS1 As Recordset Dim rS2 As Recordset Dim db As Database Dim dt As Recordset Dim rt As Recordset Dim rS4 As Recordset Private Sub Cmdexit_Click() Dim choice As Integer On Error Resume Next choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then Me.Hide End If End Sub

Private Sub cmdOK_Click() On Error Resume Next Dim dA As Integer Dim ptY As Integer rS1.MoveFirst rS1.FindFirst ("c_id=" & Cmbcid.Text) If rS1.NoMatch = False Then Txtcname.Text = rS1("c_name") Txtaddress.Text = rS1("c_address") Txtfhn.Text = rS1("c_gname") Txtpno.Text = rS1("c_phoneno") Txtmemtype.Text = rS1("c_membership type") Txtjdate.Text = rS1("c_joining date") Lblmessage.Caption = "The Member Record is exist" rS2.FindFirst ("b_id=" & Val(rS1(8))) If Not IsNull(rS1(8)) Then If rS2.NoMatch = False Then

67

Library Management System


Cmdreturn.Enabled = True Txtbid.Text = rS2("B_ID") Txtbname.Text = rS2("B_NAME") Txtbaname.Text = rS2("B_AUTHORNAME") Txtlang.Text = rS2("B_LANGUAGE") Txtcost.Text = rS2("B_COST") Txtsub.Text = rS2("B_SUBJECT") Txtcopy.Text = rS2("B_COPY") Txtissue.Text = rS2("B_ISSUE") rS3.MoveFirst rS3.FindFirst ("t_no=" & rS1("c_transaction")) If rS3.NoMatch = False Then Txtret.Text = rS3("RETURN_DATE") Txtissuedate.Text = rS1("B_ISSUEDATE") Txtcurrent.Text = Date If CDate(Txtcurrent.Text) > CDate(Txtret.Text) Then Txtpen.Text = (CDate(Txtcurrent.Text) CDate(Txtret.Text)) * 10 Else Txtpen.Text = 0 End If Else Txtret.Text = "" End If Else Txtpen.Text = "" End If Else Txtret.Text = "" Txtbid.Text = "" Txtbname.Text = "" Txtbaname.Text = "" Txtlang.Text = "" Txtcost.Text = "" Txtsub.Text = "" Txtcopy.Text = "" Txtissue.Text = "" Txtissuedate.Text = "" Txtret.Text = "" Txtcurrent.Text = "" Txtpen.Text = "" End If Else Txtbid.Text = "" Txtbname.Text = "" Txtbaname.Text = "" Txtlang.Text = "" Txtcost.Text = "" Txtsub.Text = "" Txtcopy.Text = "" Txtissue.Text = "" Txtissuedate.Text = ""

68

Library Management System


Txtret.Text = "" Txtcurrent.Text = Txtissuedate.Text Txtret.Text = "" Txtcurrent.Text = Txtpen.Text = "" Lblmess.Caption = End If

"" = "" "" ""

End Sub Private Sub Cmdreturn_Click() On Error Resume Next Dim strMessage As String Cmdreturn.Enabled = False db.Execute ("Update customer set B_ID=null where C_ID=" & Val(Cmbcid.Text)) db.Execute ("update book set B_ISSUE=B_ISSUE-1 where B_ID=" & Val(Txtbid.Text)) If Val(Txtpen.Text) > 0 Then strMessage = "Book is not returned on return date" rS4.AddNew rS4("PENALTY") = Val(Txtpen.Text) rS4("REMARK") = CStr(strMessage) rS4("PENALTY_DATE") = CDate(Date) rS4("B_ID") = Val(Txtbid.Text) rS4("C_ID") = Val(Cmbcid.Text) rS4("ISSUE_DATE") = CDate(Txtissuedate.Text) rS4("RETURN_DATE") = CDate(Txtret.Text) rS4.Update End If End Sub Private Sub FlexGridid_Click() FlexGridid.Col = 1 Cmbcid.Text = FlexGridid.Text End Sub Private Sub Form_Load() Dim r As Integer On Error Resume Next Me.Top = 0 Me.Height = Screen.Height Me.Left = menu.Width Me.Width = Screen.Width - menu.Width Set db = OpenDatabase("c:\PEACE\PEACE.MDB") Set rS1 = db.OpenRecordset("SELECT * FROM CUSTOMER") Set rS2 = db.OpenRecordset("SELECT * FROM BOOK") Set rS3 = db.OpenRecordset("SELECT * FROM TRANSACTION") Set rS4 = db.OpenRecordset("SELECT * FROM PENALTY") Labeltime.Caption = Time Labeldate.Caption = Date

69

Library Management System


rS1.MoveLast FlexGridid.Rows = rS1.AbsolutePosition + 2 r = 1 FlexGridid.Col = 1 FlexGridid.Row = 0 FlexGridid.Text = "ID" FlexGridid.Col = 2 FlexGridid.Row = 0 FlexGridid.Text = "Customer Name" rS1.MoveFirst Do While Not rS1.EOF FlexGridid.Col = 0 FlexGridid.Row = r FlexGridid.Text = r FlexGridid.Col = 1 FlexGridid.Row = r FlexGridid.Text = r FlexGridid.Col = 1 FlexGridid.Row = r FlexGridid.Text = rS1("C_ID") FlexGridid.Col = 2 FlexGridid.Row = r FlexGridid.Text = rS1("C_NAME") r = r + 1 rS1.MoveNext Loop rS1.MoveFirst Do While Not rS1.EOF Cmbcid.AddItem (rS1("C_ID")) rS1.MoveNext Loop Cmbcid.ListIndex = 0 Cmdreturn.Enabled = False End Sub Private Sub Timer1_Timer() Labeltime.Caption = Time Labeldate.Caption = Date End Sub Private Sub Timer2_Timer() Static c As Boolean On Error Resume Next If c = True Then Labelcap.ForeColor = QBColor(2) c = False Else Labelcap.ForeColor = QBColor(4) c = True End If End Sub VERSION 5.00 Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "CRYSTL32.OCX"

70

Library Management System


Begin VB.Form member Caption = "member" ClientHeight = 7815 ClientLeft = 285 ClientTop = 570 ClientWidth = 11880 Icon = "member.frx":0000 LinkTopic = "Form1" ScaleHeight = 7815 ScaleWidth = 11880 Begin Crystal.CrystalReport cR2 Left = 9600 Top = 6720 _ExtentX = 741 _ExtentY = 741 _Version = 262150 ReportFileName = "C:\PEACE\repcustomer.rpt" End Begin VB.Timer Timer1 Interval = 200 Left = 180 Top = 495 End Begin VB.Frame Frame4 Height = 645 Left = 1613 TabIndex = 28 Top = 5340 Width = 8430 Begin VB.CommandButton Cmdfirst Caption = "<<" Height = 360 Left = 90 TabIndex = 5 ToolTipText = "First Record" Top = 195 Width = 825 End Begin VB.CommandButton Cmdpre Caption = "<" Height = 360 Left = 1920 TabIndex = 6 ToolTipText = "Previous Record" Top = 195 Width = 825 End Begin VB.CommandButton Cmdnext Caption = ">" Height = 360 Left = 3750 TabIndex = 7 ToolTipText = "Next Record" Top = 195 Width = 825 End Begin VB.CommandButton Cmdlast

71

Library Management System


Caption Height Left TabIndex ToolTipText Top Width = = = = = = = ">>" 360 5580 8 "Last Record" 195 825

End Begin VB.CommandButton Cmdfind Caption = "&Find" Height Left TabIndex ToolTipText Top Width = = = = = = 360 7410 9 "Find any Existing Record" 195 825

End End Begin VB.Frame Frame3 BackColor = &H00C0C0C0& Height = 3600 Left = 255 TabIndex = 20 Top = 1275 Width = 11610 Begin MSComCtl2.DTPicker DTPicker1 Height Left TabIndex ToolTipText Top Width _ExtentX _ExtentY _Version Format CurrentDate = = = = = = = = = = = 315 2535 16 "Enter joining Date of customer" 2895 1140 2011 556 393216 24510465 37708

End Begin VB.ComboBox Cmbchoice Height = 315 ItemData = "member.frx":0442 Left = 6930 List = "member.frx":044F TabIndex = 31 Text = "Mr." ToolTipText = "Enter Gender choice" Top = 405 Width = 675 End Begin VB.ComboBox Cmbcmt Height = 315 ItemData = "member.frx":0463 Left = 2640 List = "member.frx":0476 TabIndex = 3

72

Library Management System


Text ToolTipText Top Width = = = = "0-Whole life" "Enter Duration of customer membership" 2280 1245

End Begin VB.TextBox Txtfhn Height = 285 Left = 7680 TabIndex = 2 ToolTipText = "Enter Father or Husband Name" Top = 1380 Width = 1230 End Begin VB.TextBox Txtcid Enabled = 0 'False Height = 285 Left = 2565 TabIndex = 21 ToolTipText = "Enter customer ID" Top = 330 Width = 1095 End Begin VB.TextBox Txtcn Height = 285 Left = 7755 TabIndex = 0 ToolTipText = "Enter Customer Name" Top = 435 Width = 3615 End Begin VB.TextBox Txtca Height = 585 Left = 2550 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 1 ToolTipText = "Enter Customer Address" Top = 1215 Width = 2310 End Begin VB.TextBox Txtcpno Height = 285 Left = 7710 TabIndex = 4 ToolTipText = "Enter Customer phone no" Top = 2235 Width = 1815 End Begin VB.Label Lblmr Caption = "Mr." Height = 270 Left = 7095 TabIndex = 32 Top = 1395 Width = 450 End Begin VB.Label Lbly

73

Library Management System


Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption Height Left TabIndex Top Width End Begin VB.Label Caption = = = = = = Lblfhn = = = = = = Lblcid = = = = = = Lblcn = = = = = = Lblca = = = = = = Lblcpno = = = = = = Lblcmt = = = = = = Lblcjd = "Year" 315 3930 30 2295 660 "Father/Husband name" 315 5280 29 1395 1755 "Customer ID" 255 255 27 345 1935 "Customer Name" 255 5340 26 420 1935 "Customer Address" 255 240 25 1410 1935 "Customer PhoneNo" 255 5295 24 2325 1935 "Customer Membership Type" 255 210 23 2295 2175 "Customer joining Date"

74

Library Management System


Height Left TabIndex Top Width = = = = = 255 225 22 2955 1935

End End Begin VB.Frame Frame2 Height = 645 Left = 1613 TabIndex = 19 Top = 6000 Width = 8430 Begin VB.CommandButton Cmdsave Caption = "&Save" Height = 330 Left = 1539 TabIndex = 11 ToolTipText = "To save the Record" Top = 225 Width = 870 End Begin VB.CommandButton Cmdreport Caption = "&Report" Height = 330 Left = 7335 TabIndex = 15 Top = 240 Width = 870 End Begin VB.CommandButton Cmdadd Caption = "&Add" Height = 330 Left = 90 TabIndex = 10 ToolTipText = "To add any new Record" Top = 225 Width = 870 End Begin VB.CommandButton Cmddelete Caption = "&Delete" Height = 330 Left = 2988 TabIndex = 12 ToolTipText = "To delete any existing Record" Top = 225 Width = 870 End Begin VB.CommandButton Cmdmodify Caption = "&Modify" Height = 330 Left = 4437 Style = 1 'Graphical TabIndex = 13 ToolTipText = "To modify any existing Record" Top = 225 Width = 870

75

Library Management System


End Begin VB.CommandButton Caption = Height = Left = TabIndex = ToolTipText = Top = Width = End

Cmdexit "&Exit" 330 5886 14 "Click here to exit " 225 870

End Begin VB.Frame Frame1 BackColor = &H00808080& ForeColor = &H8000000A& Height = 975 Left = 1800 TabIndex = 17 Top = 120 Width = 8415 Begin VB.Image Image1 BorderStyle = 1 'Fixed Single Height = 855 Left = 0 Picture = "member.frx":0494 Stretch = -1 'True Top = 120 Width = 1140 End Begin VB.Label Lblcaption Alignment = 2 'Center AutoSize = -1 'True BackColor = &H8000000B& Caption = "Form for Customer Details" BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough EndProperty Height = Left = TabIndex = Top = Width = End End End Attribute Attribute Attribute Attribute Attribute VB_Name = "member" VB_GlobalNameSpace = False VB_Creatable = False VB_PredeclaredId = True VB_Exposed = False = 0 'False

435 1560 18 360 4755

76

Library Management System


Dim db As Database Dim RS As Recordset Dim ch As Boolean Dim fd As Integer Dim cHk As Boolean Private Sub Cmdpre_Click() On Error Resume Next RS.MovePrevious Call crecord End Sub Private Sub Cmdreport_Click() On Error Resume Next cR2.Action = True End Sub Private Sub Cmdsave_Click() On Error Resume Next Cmdpre.Enabled = True Cmdadd.Enabled = True Cmddelete.Enabled = True Cmdmodify.Enabled = True Cmdexit.Enabled = True Cmdfirst.Enabled = True Cmdnext.Enabled = True Cmdlast.Enabled = True Cmdfind.Enabled = True Cmdreport.Enabled = True Call Compare If cHk = True Then If ch Then RS.AddNew Else RS.Edit End If RS("c_name") = UCase(Cmbchoice.Text & " " & CStr(Txtcn.Text)) RS("c_address") = UCase(CStr(Txtca.Text)) RS("c_gname") = UCase(CStr(Txtfhn.Text)) RS("c_phoneno") = Val(Txtcpno.Text) RS("c_membership type") = Val(Cmbcmt.Text) RS("c_joining date") = DTPicker1.Value If Cmbcmt.Text = "1" Then RS("MEMBERSHIP_CHARGE") = 500 End If If Cmbcmt.Text = "2" Then RS("MEMBERSHIP_CHARGE") = 600 End If If Cmbcmt.Text = "3" Then RS("MEMBERSHIP_CHARGE") = 700 End If If Cmbcmt.Text = "4" Then RS("MEMBERSHIP_CHARGE") = 800 End If If Cmbcmt.Text = "0-whole life" Then RS("MEMBERSHIP_CHARGE") = 1000 End If RS.Update MsgBox "Transaction complete" End If

77

Library Management System


End Sub Private Sub Cmdadd_Click() On Error Resume Next Dim fd As String ch = True Cmdpre.Enabled = False Cmdadd.Enabled = False Cmddelete.Enabled = False Cmdmodify.Enabled = False Cmdexit.Enabled = False Cmdfirst.Enabled = False Cmdnext.Enabled = False Cmdlast.Enabled = False Cmdsave.Enabled = True Cmdfind.Enabled = True Cmdreport.Enabled = True Txtcid.Text = " " Txtcn.Text = " " Txtca.Text = " " Txtfhn.Text = " " Txtcpno.Text = " " Cmbcmt.Text = " " End Sub Private Sub Cmddelete_Click() On Error Resume Next Cmdpre.Enabled = False Cmdadd.Enabled = False Cmddelete.Enabled = False Cmdmodify.Enabled = False Cmdexit.Enabled = False Cmdfirst.Enabled = False Cmdnext.Enabled = False Cmdlast.Enabled = False Cmdsave.Enabled = True Cmdfind.Enabled = False Cmdreport.Enabled = False RS.Delete Refresh RS.MoveFirst Call crecord End Sub Private Sub Cmdmodify_Click() On Error Resume Next ch = False Cmdsave.Enabled = True Cmdpre.Enabled = False Cmdadd.Enabled = False Cmddelete.Enabled = False Cmdmodify.Enabled = False Cmdexit.Enabled = False Cmdfirst.Enabled = False Cmdnext.Enabled = False Cmdlast.Enabled = False

78

Library Management System


Cmdfind.Enabled = False Cmdreport.Enabled = False End Sub Private Sub Cmdexit_Click() On Error Resume Next Dim choice As Integer choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then Me.Hide End If End Sub Private Sub Cmdfirst_Click() On Error Resume Next RS.MoveFirst Call crecord End Sub Private Sub Cmdnext_Click() On Error Resume Next RS.MoveNext Call crecord End Sub Private Sub Cmdlast_Click() On Error Resume Next RS.MoveLast Call crecord End Sub Private Sub Cmdfind_Click() On Error Resume Next Txtcid.Text = " " Txtcn.Text = " " Txtca.Text = " " Txtfhn.Text = " " Txtcpno.Text = " " Cmbcmt.Text = " " fd = Val(InputBox("Enter Customer ID to find the Record")) RS.MoveFirst Do While Not RS.EOF If fd = RS("C_ID") Then Call crecord End If RS.MoveNext Loop End Sub Private Sub Form_Load() On Error Resume Next Cmdsave.Enabled = False Me.Top = 0 Me.Height = Screen.Height Me.Left = menu.Width Me.Width = Screen.Width - menu.Width cHk = True Set db = OpenDatabase("c:\PEACE\PEACE.MDB")

79

Library Management System


Set RS = db.OpenRecordset("SELECT * FROM customer") Call crecord End Sub Private Sub Timer1_Timer() On Error Resume Next Static c As Boolean If c = True Then Lblcaption.ForeColor = QBColor(2) c = False Else Lblcaption.ForeColor = QBColor(4) c = True End If End Sub Public Sub crecord() On Error Resume Next Txtcid.Text = RS("c_id") Txtcn.Text = RS("c_name") Txtca.Text = RS("c_address") Txtfhn.Text = RS("c_gname") Txtcpno.Text = RS("c_phoneno") Cmbcmt.Text = RS("c_membership type") DTPicker1.Value = RS("c_joining date") End Sub Public Sub Compare() On Error Resume Next Dim msG As String If InStr(1, Txtcn.Text, "0") Or InStr(1, Txtcn.Text, "1") Or InStr(1, Txtcn.Text, "2") Or InStr(1, Txtcn.Text, "3") Or InStr(1, Txtcn.Text, "4") Or InStr(1, Txtcn.Text, "5") Or InStr(1, Txtcn.Text, "6") Or InStr(1, Txtcn.Text, "7") Or InStr(1, Txtcn.Text, "8") Or InStr(1, Txtcn.Text, "9") Then msG = "Customer_Name field can accept only text values" & vbNewLine cHk = False End If If InStr(1, Txtfhn.Text, "0") Or InStr(1, Txtfhn.Text, "1") Or InStr(1, Txtfhn.Text, "2") Or InStr(1, Txtfhn.Text, "3") Or InStr(1, Txtfhn.Text, "4") Or InStr(1, Txtfhn.Text, "5") Or InStr(1, Txtfhn.Text, "6") Or InStr(1, Txtfhn.Text, "7") Or InStr(1, Txtfhn.Text, "8") Or InStr(1, Txtfhn.Text, "9") Then msG = msG & "Customer_Father/Husband Name field can accept only text values" & vbNewLine cHk = False End If If isString(Txtcpno.Text) Then msG = msG & "Please Enter only Numeric value in customer phone no" cHk = False End If MsgBox msG End Sub VERSION 5.00 Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "CRYSTL32.OCX" Begin VB.Form book Caption = "book" ClientHeight = 8265 ClientLeft = 60

80

Library Management System


ClientTop = 345 ClientWidth = 10830 Icon = "book.frx":0000 LinkTopic = "Form1" ScaleHeight = 8265 ScaleWidth = 10830 StartUpPosition = 3 'Windows Default Begin VB.Frame Frame4 Height = 705 Left = 1440 TabIndex = 27 Top = 6720 Width = 6585 Begin VB.CommandButton Cmdexit Caption = "&Exit" Height = 375 Left = 5745 Style = 1 'Graphical TabIndex = 33 ToolTipText = "Click here to exit " Top = 210 Width = 690 End Begin VB.CommandButton Cmdadd Caption = "&Add" Height = 375 Left = 210 Style = 1 'Graphical TabIndex = 32 ToolTipText = "To add a new Record" Top = 210 Width = 690 End Begin VB.CommandButton Cmdsave Caption = "&Save" Height = 375 Left = 1320 Style = 1 'Graphical TabIndex = 31 ToolTipText = "To save the Record" Top = 210 Width = 690 End Begin VB.CommandButton Cmddelete Caption = "&Delete" Height = 375 Left = 2430 Style = 1 'Graphical TabIndex = 30 ToolTipText = "To delete a Record" Top = 210 Width = 690 End Begin VB.CommandButton Cmdmodify Caption = "&Modify" Height = 375 Left = 3525

81

Library Management System


Style TabIndex ToolTipText Top Width = = = = = 1 'Graphical 29 "To modify a Record" 210 690 Cmdreport "&Report" 375 4650 1 'Graphical 28 "To see the report of Records" 210 690

End Begin VB.CommandButton Caption = Height = Left = Style = TabIndex = ToolTipText = Top = Width = End End Begin VB.Frame Frame3 Height = 765

Left = 1440 TabIndex = 21 Top = 5910 Width = 6585 Begin VB.CommandButton Cmdfind Caption = "Find" Height = 375 Left = 5655 Style = 1 'Graphical TabIndex = 26 ToolTipText = "To find a Record" Top = 240 Width = 690 End Begin VB.CommandButton Cmdlast Caption = ">>" Height = 375 Left = 4320 Style = 1 'Graphical TabIndex = 25 ToolTipText = "Last Record" Top = 240 Width = 690 End Begin VB.CommandButton Cmdnext Caption = ">" Height = 375 Left = 2985 Style = 1 'Graphical TabIndex = 24 ToolTipText = "Next Record" Top = 240 Width = 690 End Begin VB.CommandButton Cmdpre Caption = "<"

82

Library Management System


Height Left Style TabIndex ToolTipText Top Width = = = = = = = 375 1650 1 'Graphical 23 "Previous Record" 240 690 Cmdfirst "<<" 375 300 1 'Graphical 22 "First Record" 240 690

End Begin VB.CommandButton Caption = Height = Left = Style = TabIndex = ToolTipText = Top = Width = End

End Begin VB.Frame Frame2 Height = 4695 Left = 1440 TabIndex = 2 Top = 1170 Width = 6585 Begin VB.TextBox Txtrbook Height = 315 Left = 2340 TabIndex = 11 ToolTipText = "Remaining copies of Book" Top = 4200 Width = 2445 End Begin VB.TextBox Txtbid Height = 285 Left = 2340 TabIndex = 10 ToolTipText = "Enter Book Id" Top = 240 Width = 1140 End Begin VB.TextBox Txtbname Height = 285 Left = 2340 TabIndex = 9 ToolTipText = "Enter Book Name" Top = 735 Width = 4185 End Begin VB.TextBox Txtbaname Height = 285 Left = 2340 TabIndex = 8 ToolTipText = "Enter Author Name" Top = 1230 Width = 2040 End

83

Library Management System


Begin VB.TextBox Txtlang Height = 285 Left = 2340 TabIndex = 7 ToolTipText = "Enter Book Language" Top = 1725 Width = 2175 End Begin VB.TextBox Txtcost Height = 285 Left = 2340 TabIndex = 6 ToolTipText = "Enter Book cost" Top = 2220 Width = 2280 End Begin VB.TextBox Txtsubj Height = 285 Left = 2340 TabIndex = 5 ToolTipText = "Enter Book Subject" Top = 2715 Width = 2325 End Begin VB.TextBox Txtcopy Height = 285 Left = 2340 TabIndex = 4 ToolTipText = "Enter how many Copies of Book" Top = 3210 Width = 2250 End Begin VB.TextBox Txtissue Height = 285 Left = 2340 TabIndex = 3 ToolTipText = "Enter how many copies of this Book are Issued" Top = 3705 Width = 2400 End Begin VB.Label Lblbook BackStyle = 0 'Transparent Caption = "Book_Remaining" Height = 330 Left = 465 TabIndex = 20 Top = 4170 Width = 1230 End Begin VB.Label Lblbid BackStyle = 0 'Transparent Caption = "Book_ID" Height = 285 Left = 975 TabIndex = 19 Top = 240

84

Library Management System


Width End Begin VB.Label BackStyle Caption Height Left TabIndex Top Width End Begin VB.Label BackStyle Caption Height Left TabIndex Top Width End Begin VB.Label BackStyle Caption Height Left TabIndex Top Width End Begin VB.Label BackStyle Caption Height Left TabIndex Top Width = 720

Lblbname = 0 'Transparent = "Book_Name" = 285 = 780 = 18 = 735 = 915 Lblbaname = 0 'Transparent = "Book_AuthorName" = 285 = 300 = 17 = 1230 = 1395 Lbllang = = = = = = = 0 'Transparent "Book_Language" 285 450 16 1740 1245

Lblcost = 0 'Transparent = "Book_Cost" = 285 = = = = 795 15 2250 900

End Begin VB.Label Lblsubj BackStyle = 0 'Transparent Caption = "Book_Subject" Height = 285 Left = 585 TabIndex = 14 Top = 2745 Width = 1110 End Begin VB.Label Lblcopy BackStyle = 0 'Transparent Caption = "Book_Copy" Height = 285 Left = 765 TabIndex = 13 Top = 3255 Width = 930 End

85

Library Management System


Begin VB.Label Lblissue BackStyle = 0 'Transparent Caption = "Book_Issue" Height = 285 Left = 735 TabIndex = 12 Top = 3765 Width = 960 End End Begin VB.Frame Frame1 Height = 885 Left = 780 TabIndex = 0 Top = 90 Width = 7515 Begin VB.Image Image1 BorderStyle = 1 'Fixed Single Height = 735 Left = 30 Picture = "book.frx":0442 Stretch = -1 'True Top = 120 Width = 960 End Begin VB.Label Label1 BackStyle = 0 'Transparent BorderStyle = 1 'Fixed Single Caption = "INFORMATION ABOUT BOOK" BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 555 Left = 1620 TabIndex = 1 Top = 210 Width = 5775 End End Begin VB.Timer Timer1 Interval = 700 Left = 480 Top = 930 End Begin Crystal.CrystalReport cR3 Left = 5220 Top = 7830 _ExtentX = 741 _ExtentY = 741 _Version = 262150 ReportFileName = "C:\PEACE\rptbo.rpt"

86

Library Management System


End Begin VB.Image Image3 Height = Left = Picture = Top = Width = End

6585 120 "book.frx":055A 8340 9600

End Attribute VB_Name = "book" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim RS As Recordset Dim db As Database Dim fd As Integer Dim ch As Boolean Dim cHk As Boolean Dim rS1 As Recordset Dim msG As String Private Sub Cmdadd_Click() On Error Resume Next ch = True Cmdpre.Enabled = False Cmdadd.Enabled = False Cmddelete.Enabled = False Cmdmodify.Enabled = False Cmdexit.Enabled = False Cmdfirst.Enabled = False Cmdnext.Enabled = False Cmdlast.Enabled = False Cmdsave.Enabled = True Cmdfind.Enabled = True Cmdreport.Enabled = True Txtbname.Text = " " Txtbaname.Text = " " Txtlang.Text = " " Txtcost.Text = " " Txtsubj.Text = " " Txtcopy.Text = " " Txtissue.Text = " " Txtrbook.Text = " " End Sub Private Sub Cmddelete_Click() Dim choice As Integer On Error Resume Next choice = MsgBox("Do You Want To Delete This Record", vbYesNo + vbQuestion) If choice = vbYes Then End If On Error Resume Next Cmdpre.Enabled = False Cmdadd.Enabled = False Cmddelete.Enabled = False Cmdmodify.Enabled = False Cmdexit.Enabled = False

87

Library Management System


Cmdfirst.Enabled = False Cmdnext.Enabled = False Cmdlast.Enabled = False Cmdsave.Enabled = True Cmdfind.Enabled = False Cmdreport.Enabled = False RS.Delete Refresh RS.MoveFirst Call rchange End Sub Private Sub Cmdexit_Click() Dim choice As Integer On Error Resume Next choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then Me.Hide End If End Sub Private Sub Cmdfind_Click() On Error Resume Next Txtbname.Text = " " Txtbaname.Text = " " Txtlang.Text = " " Txtcost.Text = " " Txtsubj.Text = " " Txtcopy.Text = " " Txtissue.Text = " " fd = Val(InputBox("Enter Book ID to find the Record")) RS.MoveFirst Do While Not RS.EOF If fd = RS("B_ID") Then Call rchange End If RS.MoveNext Loop End Sub Private Sub Cmdfirst_Click() Dim choice As Integer On Error Resume Next choice = MsgBox("Do You Want To GO To The First Record", vbYesNo + vbQuestion) If choice = vbYes Then RS.MoveFirst End If Call rchange End Sub Private Sub Cmdlast_Click() Dim choice As Integer On Error Resume Next choice = MsgBox("Do You Want To GO To The Last Record", vbYesNo + vbQuestion) If choice = vbYes Then RS.MoveLast End If

88

Library Management System


Call rchange End Sub Private Sub Cmdmodify_Click() On Error Resume Next ch = False Cmdsave.Enabled = True Cmdpre.Enabled = False Cmdadd.Enabled = False Cmddelete.Enabled = False Cmdmodify.Enabled = False Cmdexit.Enabled = False Cmdfirst.Enabled = False Cmdnext.Enabled = False Cmdlast.Enabled = False Cmdfind.Enabled = False Cmdreport.Enabled = False End Sub Private Sub Cmdnext_Click() Dim choice As Integer On Error GoTo er1 choice = MsgBox("Do You Want To GO To The Next Record", vbYesNo + vbQuestion) If choice = vbYes Then RS.MoveNext Call rchange End If Exit Sub er1: MsgBox "This is the Last Record" End Sub Private Sub Cmdpre_Click() Dim choice As Integer On Error Resume Next choice = MsgBox("Do You Want To GO To The Previous Record", vbYesNo + vbQuestion) If choice = vbYes Then If RS.AbsolutePosition = 0 Then MsgBox "This is the First Record" Else RS.MovePrevious Call rchange End If End If End Sub Private Sub Cmdreport_Click() On Error Resume Next cR3.Action = True End Sub Private Sub Cmdsave_Click() On Error Resume Next Call Compare If cHk = True Then Cmdpre.Enabled = True Cmdadd.Enabled = True Cmddelete.Enabled = True Cmdmodify.Enabled = True Cmdexit.Enabled = True

89

Library Management System


Cmdfirst.Enabled = True Cmdnext.Enabled = True Cmdlast.Enabled = True Cmdfind.Enabled = True Cmdreport.Enabled = True If ch Then Set rS1 = db.OpenRecordset("select max(B_ID) from BOOK") RS.AddNew Txtrbook.Text = Val(Txtcopy.Text) - Val(Txtissue.Text) Else RS.Edit End If RS("B_ID") = rS1(0) + 1 RS("B_NAME") = UCase(CStr(Txtbname.Text)) RS("B_AUTHORNAME") = UCase(CStr(Txtbaname.Text)) RS("B_LANGUAGE") = UCase(CStr(Txtlang.Text)) RS("B_COST") = Val(Txtcost.Text) RS("B_SUBJECT") = UCase(CStr(Txtsubj.Text)) RS("B_COPY") = Val(Txtcopy.Text) RS("B_ISSUE") = Val(Txtissue.Text) RS.Update MsgBox "Transaction complete" Else MsgBox msG cHk = True End If End Sub Private Sub Form_Load() On Error Resume Next Txtbid.Text = " " Txtbid.Enabled = False Cmdsave.Enabled = False cHk = True Me.Top = 0 Me.Height = Screen.Height Me.Left = menu.Width Me.Width = Screen.Width - menu.Width Set db = OpenDatabase("c:\PEACE\PEACE.MDB") Set RS = db.OpenRecordset("SELECT * FROM book") Call rchange End Sub Public Sub rchange() On Error Resume Next Txtbid.Text = UCase(RS("B_ID")) Txtbname.Text = UCase(RS("B_NAME")) Txtbaname.Text = UCase(RS("B_AUTHORNAME")) Txtlang.Text = UCase(RS("B_LANGUAGE")) Txtcost.Text = RS("B_COST") Txtsubj.Text = UCase(RS("B_SUBJECT")) Txtcopy.Text = RS("B_COPY") Txtissue.Text = RS("B_ISSUE") End Sub Public Sub Compare() On Error Resume Next msG = "" If Not isString(Txtbname.Text) Then msG = msG & "Book Name must be in Characters" & vbNewLine

90

Library Management System


cHk = False End If If Not isString(Txtbaname.Text) Then msG = msG & "Book Author Name must be in Characters" & vbNewLine cHk = False End If If Not isString(Txtlang.Text) Then msG = msG & "Book Language must be in Characters" & vbNewLine cHk = False End If If Not isString(Txtsubj.Text) Then msG = msG & "Book Subject must be in Characters" & vbNewLine cHk = False End If If Not IsNumeric(Txtissue.Text) Then msG = msG & " Book Issue must be number" & vbNewLine cHk = False End If If Not IsNumeric(Txtcopy.Text) Then msG = msG & "Book Copy must be number" & vbNewLine cHk = False End If If Not IsNumeric(Txtcost.Text) Then msG = msG & "Book Cost must be number" & vbNewLine cHk = False End If Cmdexit.Enabled = True End Sub Private Sub Timer1_Timer() Static c As Boolean On Error Resume Next If c = True Then Label1.ForeColor = QBColor(2) c = False Else Label1.ForeColor = QBColor(4) c = True End If End Sub

VERSION 5.00 Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "CRYSTL32.OCX" Begin VB.Form bookinfo Caption = "Book Information" ClientHeight = 8595 ClientLeft = 60

91

Library Management System


ClientTop = 345 ClientWidth = 11880 BeginProperty Font Name = "Impact" Size = 18 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Icon = "Book_Information.frx":0000 LinkTopic = "Form1" ScaleHeight = 8595 ScaleWidth = 11880 StartUpPosition = 3 'Windows Default Begin VB.Frame Frame1 Height = 1095 Left = 2108 TabIndex = 10 Top = 60 Width = 7665 Begin VB.Image Image1 BorderStyle = 1 'Fixed Single Height = 825 Left = 30 Picture = "Book_Information.frx":0442 Stretch = -1 'True Top = 270 Width = 960 End Begin VB.Label Lblhead BackStyle = 0 'Transparent BorderStyle = 1 'Fixed Single Caption = " INFORMATION ABOUT BOOK" BeginProperty Font Name = "Monotype Corsiva" Size = 20.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 615 Left = 1800 TabIndex = 11 Top = 360 Width = 5715 End End Begin VB.Timer Timer1 Interval = 700 Left = 120 Top = 510 End

92

Library Management System


Begin Crystal.CrystalReport cR1 Left = 8790 Top = 1200 _ExtentX = 741 _ExtentY = 741 _Version = 262150 ReportFileName = "C:\PEACE\repbook.rpt" End Begin VB.CommandButton Cmdpr2 Caption = "Print" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 8610 Style = 1 'Graphical TabIndex = 5 ToolTipText = "Click here to print the report according to Book name" Top = 1650 Width = 735 End Begin Crystal.CrystalReport cR Left = 3630 Top = 1170 _ExtentX = 741 _ExtentY = 741 _Version = 262150 ReportFileName = "C:\PEACE\repauth.rpt" End Begin VB.CommandButton Cmdpr1 Caption = "Print" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 3570 Style = 1 'Graphical TabIndex = 2 ToolTipText = "Click here to print the report according to Book Author Name" Top = 1650 Width = 735 End Begin VB.ComboBox Cmbaname

93

Library Management System


BeginProperty Font Name Size Charset Weight Underline Italic Strikethrough EndProperty Height = Left = TabIndex = ToolTipText = Top = Width =

= = = = = = =

"MS Sans Serif" 8.25 0 400 0 'False 0 'False 0 'False 315 450 0 "Click here to select the Book author Name " 1680 1815

End Begin VB.CommandButton Cmdok BackColor = &H8000000A& Caption = "Ok" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 2640 MaskColor = &H00404000& Style = 1 'Graphical TabIndex = 1 ToolTipText = "Click here to display the information of Book according to book author name" Top = 1650 Width = 615 End Begin VB.ComboBox Cmbname BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 5580 TabIndex = 3 ToolTipText = "Click here to select the Book name" Top = 1680 Width = 1815 End Begin VB.CommandButton Cmdok1 BackColor = &H8000000A&

94

Library Management System


Caption = "Ok" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 7650 Style = 1 'Graphical TabIndex = 4 ToolTipText = "Click here to display the information of Book according to book name" Top = 1650 Width = 615 End Begin VB.CommandButton Cmdexit Caption = "Exit" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 435 Left = 420 Style = 1 'Graphical TabIndex = 6 ToolTipText = "Click here to Exit" Top = 6660 Width = 9015 End Begin MSFlexGridLib.MSFlexGrid MSFlexGridaname Height = 4605 Left = 450 TabIndex = 7 Top = 2070 Width = 9015 _ExtentX = 15901 _ExtentY = 8123 _Version = 393216 Rows = 4 Cols = 8 BackColor = 16777215 BackColorBkg = 7566195 AllowUserResizing= 1 PictureType = 1 BorderStyle = 0 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25

95

Library Management System


Charset Weight Underline Italic Strikethrough EndProperty = = = = = 0 700 0 'False 0 'False 0 'False

End Begin VB.Label Lblaname BackStyle = 0 'Transparent Caption = "Book_Author Name" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 480 TabIndex = 9 Top = 1380 Width = 1695 End Begin VB.Label Lblname BackStyle = 0 'Transparent Caption = "B_Name" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 5640 TabIndex = 8 Top = 1380 Width = 975 End End Attribute Attribute Attribute Attribute Attribute Dim RS As Dim aN As Dim sA As Dim sN As Dim db As VB_Name = "bookinfo" VB_GlobalNameSpace = False VB_Creatable = False VB_PredeclaredId = True VB_Exposed = False Recordset Recordset Recordset Recordset Database

96

Library Management System


Private Sub Cmdexit_Click() On Error Resume Next Dim choice As Integer choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then Me.Hide End If End Sub Private Sub cmdOK_Click() Dim r As Integer On Error Resume Next Set RS = db.OpenRecordset("SELECT * FROM book where b_authorname='" & Cmbaname.Text & "'") RS.MoveLast MSFlexGridaname.Rows = RS.AbsolutePosition + 2 r = 1 MSFlexGridaname.Col = 1 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "ID" MSFlexGridaname.Col = 2 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "NAME" MSFlexGridaname.Col = 3 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "SUBJECT" MSFlexGridaname.Col = 4 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "COPY" MSFlexGridaname.Col = 5 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "ISSUE" MSFlexGridaname.Col = 6 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "LANGUAGE" MSFlexGridaname.Col = 7 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "COST" RS.MoveFirst Do While Not RS.EOF MSFlexGridaname.Col = 0 MSFlexGridaname.Row = r MSFlexGridaname.Text = r MSFlexGridaname.Col = 1 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_ID") MSFlexGridaname.Col = 2 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_NAME") MSFlexGridaname.Col = 3 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_SUBJECT") MSFlexGridaname.Col = 4 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_COPY") MSFlexGridaname.Col = 5 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_ISSUE")

97

Library Management System


MSFlexGridaname.Col = 6 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_LANGUAGE") MSFlexGridaname.Col = 7 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_COST") r = r + 1 RS.MoveNext Loop End Sub Private Sub Cmdok1_Click() Dim r As Integer On Error Resume Next Set RS = db.OpenRecordset("SELECT * FROM book where b_name='" & Cmbname.Text & "'") RS.MoveLast MSFlexGridaname.Rows = RS.AbsolutePosition + 2 r = 1 MSFlexGridaname.Col = 1 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "ID" MSFlexGridaname.Col = 2 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "AUTHOR NAME" MSFlexGridaname.Col = 3 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "SUBJECT" MSFlexGridaname.Col = 4 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "COPY" MSFlexGridaname.Col = 5 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "ISSUE" MSFlexGridaname.Col = 6 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "LANGUAGE" MSFlexGridaname.Col = 7 MSFlexGridaname.Row = 0 MSFlexGridaname.Text = "COST" RS.MoveFirst Do While Not RS.EOF MSFlexGridaname.Col = 0 MSFlexGridaname.Row = r MSFlexGridaname.Text = r MSFlexGridaname.Col = 1 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_ID") MSFlexGridaname.Col = 2 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_AUTHORNAME") MSFlexGridaname.Col = 3 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_SUBJECT") MSFlexGridaname.Col = 4 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_COPY") MSFlexGridaname.Col = 5

98

Library Management System


MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_ISSUE") MSFlexGridaname.Col = 6 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_LANGUAGE") MSFlexGridaname.Col = 7 MSFlexGridaname.Row = r MSFlexGridaname.Text = RS("B_COST") r = r + 1 RS.MoveNext Loop End Sub Private Sub Cmdpr1_Click() On Error Resume Next cR.ReplaceSelectionFormula ("{book.b_authorName}='" & Cmbaname.Text & "'") cR.Action = True End Sub Private Sub Cmdpr2_Click() On Error Resume Next cR1.ReplaceSelectionFormula ("{book.b_name}='" & Cmbname.Text & "'") cR1.Action = True End Sub Private Sub Form_Load() On Error Resume Next Me.Top = 0 Me.Height = Screen.Height Me.Left = menu.Width Me.Width = Screen.Width - menu.Width Set db = OpenDatabase("c:\PEACE\PEACE.MDB") Set sN = db.OpenRecordset("select distinct B_NAME from BOOK") Set sA = db.OpenRecordset("select distinct B_AUTHORNAME from BOOK ") Do While Not sA.EOF Cmbaname.AddItem (sA(0)) sA.MoveNext Loop Cmbaname.ListIndex = 0 Do While Not sN.EOF Cmbname.AddItem (sN(0)) sN.MoveNext Loop Cmbname.ListIndex = 0 End Sub Private Sub Timer1_Timer() Static c As Boolean On Error Resume Next If c = True Then Lblhead.ForeColor = QBColor(2) c = False Else Lblhead.ForeColor = QBColor(4) c = True End If End Sub

99

Library Management System

Attribute VB_Name = "Module1" Public Function isString(str As String) As Boolean Dim c As String Dim i As Integer Dim b As Boolean b = True l = Len(str)

100

Library Management System


For i = 1 To l c = Mid(str, i, 1) If Not ((UCase(c) >= "A" And UCase(c) <= "Z" Or c = " ")) Then b = False End If Next If b Then isString = True Else isString = False End If End Function

101

Library Management System

TESTING & IMPLEMENTATION


Test plans are very important to the quality point of view and it should be written as soon as the specifications ready.

102

Anda mungkin juga menyukai