library anshulfinal

130
Library Management System INDEX ACKNOWLEDGEMENT :02 CERTIFICATE :03 INTRODUCTION :04 SYSTEM ANALYSIS :05 PREFACE :06 HARDWARE REQUIREMENT:07 FRONT END :08 BACK END :09 STRUCTURE CHART :10-11 INTERFACES :12-20 DATABASE DESIGN :21-26 CODING :27-93 TESTING & IMPLEMENTATIONS:94 1

Upload: accord123

Post on 28-Apr-2015

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Library ANSHULfinal

Library Management System

INDEX

ACKNOWLEDGEMENT :02

CERTIFICATE :03

INTRODUCTION :04

SYSTEM ANALYSIS :05

PREFACE :06

HARDWARE REQUIREMENT:07

FRONT END :08

BACK END :09

STRUCTURE CHART :10-11

INTERFACES :12-20

DATABASE DESIGN :21-26

CODING :27-93

TESTING & IMPLEMENTATIONS:94

1

Page 2: Library ANSHULfinal

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.

2

Page 3: Library ANSHULfinal

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))

3

Page 4: Library ANSHULfinal

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 member’s 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.

4

Page 5: Library ANSHULfinal

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

5

Page 6: Library ANSHULfinal

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.

6

Page 7: Library ANSHULfinal

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 : Pentium 3 or higher processor

Operating System : Microsoft window 98

Ram Memory : 128 MB

Monitor : VGA Monitor or high resolution Monitor

Hard Disk : 8.4 GB of free space required during installation

Display : MGA/CGA/EGA/VGA cord

Keyboard : 104 keys

Printer : H P Laser

Mouse : True Mouse

Storage Device : Floppy Disk 1.44 MB

Visual Basic version : 6.0

7

Page 8: Library ANSHULfinal

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

8

Page 9: Library ANSHULfinal

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

9

Page 10: Library ANSHULfinal

Library Management System

10

Page 11: Library ANSHULfinal

Library Management System

11

Introduction Screen

Login Form

Change Password Menu Form

Issue Form Book Form

Book info Form

Member Form

Return Form

Page 12: Library ANSHULfinal

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

Page 13: Library ANSHULfinal

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

Page 14: Library ANSHULfinal

Library Management System

of this proposed system. This model in addition to the essential model defines the following for the proposed system.

1. Automation Boundary

2. Report Layout.

3. Screen Layout for the Data Entry Forms.

4. The parts of the new system consist of.

5. The physical layout of the input and output document.

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

7. Develop the modules structure for the software.

8. Develop the specification for each module.

9. Design the file layout or the database.

0’LEVEL DFD FOR LIBRARY MANAGEMENT SYSTEM

14

Page 15: Library ANSHULfinal

Library Management System

15

Page 16: Library ANSHULfinal

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

Page 17: Library ANSHULfinal

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

Page 18: Library ANSHULfinal

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

18

Page 19: Library ANSHULfinal

Library Management System

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

Page 20: Library ANSHULfinal

Library Management System

20

Page 21: Library ANSHULfinal

Library Management System

21

Page 22: Library ANSHULfinal

Library Management System

22

Page 23: Library ANSHULfinal

Library Management System

23

Page 24: Library ANSHULfinal

Library Management System

24

Page 25: Library ANSHULfinal

Library Management System

25

Page 26: Library ANSHULfinal

Library Management System

26

Page 27: Library ANSHULfinal

Library Management System

27

Page 28: Library ANSHULfinal

Library Management System

`

28

Page 29: Library ANSHULfinal

Library Management System

29

Page 30: Library ANSHULfinal

Library Management System

DATABASE TABLE NAME:-BOOK

FIELD NAME DATA TYPEB_ID LongB_NAME TextB_SUBJECT TextB_COPY LongB_ISSUE LongB_LANGUAGE TextB_COST IntegerB_AUTHORNAME Text

30

Page 31: Library ANSHULfinal

Library Management System

DATABASE TABLE NAME:-CUSTOMER

FIELD NAME DATA TYPEC_ID LongC_NAME TextC_ADDRESS TextC_PHONENO LongC_MEMBERSHIPTYPE LongC_JOININGTIME Date/TimeC_TRANSACTION LongC_GNAME TextB_ID LongB_ISSUEDATE Date/TimeMEMBERSHIP_CHARGE Long

31

Page 32: Library ANSHULfinal

Library Management System

DATABASE TABLE NAME:-PASSWORD

FIELD NAME DATA TYPEUSER_NAME TextPASSWORD Text

32

Page 33: Library ANSHULfinal

Library Management System

DATABASE TABLE NAME:-PENALTY

FIELD NAME DATA TYPEPENALTY_NO LongPENALTY LongREMARK TextPENALTY_DATE Date/TimeB_ID LongC_ID LongISSUE_DATE Date/TimeRETURN_DATE Date/Time

33

Page 34: Library ANSHULfinal

Library Management System

DATABASE TABLE NAME:-TRANSACTION

FIELD NAME DATA TYPEISSUE_DATE Date/TimeRETURN_DATE Date/TimePENALTY_NO LongSTATUS TextB_ID LongC_ID LongT_NO Long

34

Page 35: Library ANSHULfinal

Library Management System

35

Page 36: Library ANSHULfinal

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

Page 37: Library ANSHULfinal

Library Management System

Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 1005 Left = 473 TabIndex = 4 Top = 3720 Width = 7485 End Begin VB.Label Label2 BackStyle = 0 'Transparent Caption = "This project is develop by :" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 3810 TabIndex = 3 Top = 5310 Width = 2895 End Begin VB.Label Label3 BackStyle = 0 'Transparent Caption = "Km. Meenakshi " BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 5070 TabIndex = 2 Top = 5730 Width = 1905 End Begin VB.Label Label4 BackStyle = 0 'Transparent Caption = "M.I.S (D.A.V College)" BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700

37

Page 38: Library ANSHULfinal

Library Management System

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

Option Explicit

Private Sub Timer1_Timer() frmLogin.Show Timer1.Enabled = FalseEnd Sub

38

Page 39: Library ANSHULfinal

Library Management System

VERSION 5.00Begin 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 EndEndAttribute VB_Name = "Form1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = False

39

Page 40: Library ANSHULfinal

Library Management System

VERSION 5.00Begin 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

Page 41: Library ANSHULfinal

Library Management System

Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 90 Style = 1 'Graphical TabIndex = 3 ToolTipText = "To open the book form " Top = 2511 Width = 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

Page 42: Library ANSHULfinal

Library Management System

Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 375 Left = 90 Style = 1 'Graphical TabIndex = 0 ToolTipText = "To open the Issue form" Top = 150 Width = 1155 End End Begin VB.Label Lbld Height = 345 Left = 810 TabIndex = 12 Top = 2610

Width = 795 End Begin VB.Label Lblt Height = 345 Left = 810 TabIndex = 11 Top = 2130 Width = 825 End Begin VB.Label Lbldat Caption = "Date" Height = 315 Left = 60 TabIndex = 10 Top = 2610 Width = 525 End Begin VB.Label Lbltim Caption = "Time" Height = 315 Left = 60 TabIndex = 9 Top = 2130 Width = 495 End Begin VB.Image Image1 BorderStyle = 1 'Fixed Single Height = 915 Left = 240 Picture = "menu.frx":0442 Stretch = -1 'True Top = 1080 Width = 975 End Begin VB.Label Label3 Alignment = 2 'Center BackColor = &H00C0C0FF&

42

Page 43: Library ANSHULfinal

Library Management System

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

43

Page 44: Library ANSHULfinal

Library Management System

EndAttribute VB_Name = "menu"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Cmdbook_Click()On Error Resume Next menu.Show member.Hide book.Show return1.HideEnd Sub

Private Sub Cmdexit_Click()On Error Resume NextDim choice As Integer choice = MsgBox("Do You Want To Exit", vbYesNo + vbQuestion) If choice = vbYes Then End End IfEnd 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.ShowEnd 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

Page 45: Library ANSHULfinal

Library Management System

End Sub

Private Sub Timer1_Timer()On Error Resume Next Static c As Boolean If c = True Then Label1.ForeColor = QBColor(5) Label2.ForeColor = QBColor(5) Label3.ForeColor = QBColor(5) c = False Else Label1.ForeColor = QBColor(4) Label2.ForeColor = QBColor(4) Label3.ForeColor = QBColor(4) c = True End IfEnd Sub

Private Sub Timer2_Timer() Lblt.Caption = TimeEnd Sub

45

Page 46: Library ANSHULfinal

Library Management System

VERSION 5.00Object = "{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

Page 47: Library ANSHULfinal

Library Management System

Width = 1125 _ExtentX = 1984 _ExtentY = 450 _Version = 393216 Format = 24510465 CurrentDate = 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

Page 48: Library ANSHULfinal

Library Management System

TabIndex = 33 Top = 2340 Width = 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

Page 49: Library ANSHULfinal

Library Management System

Left = 45 TabIndex = 46 Top = 2745 Width = 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 = 315 Left = 840 TabIndex = 43 Top = 240 Width = 675 End Begin VB.Label Lblsub Caption = "Book_Subject" Height = 330 Left = 30 TabIndex = 42 Top = 1770 Width = 1275 End Begin VB.Label Lblcost Caption = "Book_Cost" Height = 375 Left = 3960 TabIndex = 41 Top = 1245 Width = 900 End Begin VB.Label Lbllang Caption = "Book_Language"

Height = 345 Left = 30 TabIndex = 40 Top = 1230 Width = 1200 End Begin VB.Label Lblbaname Caption = "Book_Author Name"

49

Page 50: Library ANSHULfinal

Library Management System

Height = 360 Left = 3960 TabIndex = 39 Top = 735 Width = 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

Page 51: Library ANSHULfinal

Library Management System

TabIndex = 12 Top = 1215 Width = 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

Page 52: Library ANSHULfinal

Library Management System

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

52

Page 53: Library ANSHULfinal

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

Page 54: Library ANSHULfinal

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 EndEndAttribute VB_Name = "issue"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseDim r As Integer

54

Page 55: Library ANSHULfinal

Library Management System

Dim rS1 As RecordsetDim rS2 As RecordsetDim db As DatabaseDim 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 IfEnd 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 = FalseEnd SubPrivate 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 IfEnd Sub

55

Page 56: Library ANSHULfinal

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 IfEnd SubPrivate Sub FlexGridb_Click() On Error Resume Next FlexGridb.Col = 0 Cmbbid.Text = FlexGridb.TextEnd SubPrivate Sub FlexGridD_Click() On Error Resume Next FlexGridD.Col = 0 Cmbcid.Text = FlexGridD.TextEnd 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

Page 57: Library ANSHULfinal

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 = FalseEnd 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 IfEnd Sub

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

57

Page 58: Library ANSHULfinal

Library Management System

Caption = "return" ClientHeight = 8130 ClientLeft = 60 ClientTop = 345 ClientWidth = 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

Page 59: Library ANSHULfinal

Library Management System

Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 345 Left = 2340 TabIndex = 49 Top = 1020 Width = 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

Page 60: Library ANSHULfinal

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

Page 61: Library ANSHULfinal

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

Page 62: Library ANSHULfinal

Library Management System

Top = 720 Width = 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

Page 63: Library ANSHULfinal

Library Management System

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

63

Page 64: Library ANSHULfinal

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

Page 65: Library ANSHULfinal

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 = 0 'False Strikethrough = 0 'False EndProperty Height = 315 Left = 3360 TabIndex = 1 ToolTipText = "Click here to display the information of customer" Top = 360 Width = 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

65

Page 66: Library ANSHULfinal

Library Management System

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

TabIndex = 26 Top = 1300 Width = 1680 End Begin VB.Label Label3 Caption = "Customer_Address" Height = 360 Left = 4665 TabIndex = 25 Top = 840 Width = 1425 End Begin VB.Label Label2 Caption = "Customer_Name" Height = 360 Left = 165

66

Page 67: Library ANSHULfinal

Library Management System

TabIndex = 24 Top = 825 Width = 1215 End Begin VB.Label Label1 Caption = "Customer_ID" Height = 330 Left = 1380 TabIndex = 23 Top = 375 Width = 945 End EndEndAttribute VB_Name = "return1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseDim rS3 As RecordsetDim rS1 As RecordsetDim rS2 As RecordsetDim db As DatabaseDim dt As RecordsetDim rt As RecordsetDim 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 IfEnd 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

Page 68: Library ANSHULfinal

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

Page 69: Library ANSHULfinal

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

Page 70: Library ANSHULfinal

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 = DateEnd 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 IfEnd Sub

VERSION 5.00Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "CRYSTL32.OCX"

70

Page 71: Library ANSHULfinal

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

Page 72: Library ANSHULfinal

Library Management System

Caption = ">>" Height = 360 Left = 5580 TabIndex = 8 ToolTipText = "Last Record" Top = 195 Width = 825 End Begin VB.CommandButton Cmdfind Caption = "&Find"

Height = 360 Left = 7410 TabIndex = 9 ToolTipText = "Find any Existing Record" Top = 195 Width = 825 End End Begin VB.Frame Frame3 BackColor = &H00C0C0C0& Height = 3600 Left = 255 TabIndex = 20 Top = 1275 Width = 11610 Begin MSComCtl2.DTPicker DTPicker1

Height = 315 Left = 2535 TabIndex = 16 ToolTipText = "Enter joining Date of customer" Top = 2895 Width = 1140 _ExtentX = 2011 _ExtentY = 556 _Version = 393216 Format = 24510465 CurrentDate = 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

Page 73: Library ANSHULfinal

Library Management System

Text = "0-Whole life" ToolTipText = "Enter Duration of customer membership" Top = 2280 Width = 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

Page 74: Library ANSHULfinal

Library Management System

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

74

Page 75: Library ANSHULfinal

Library Management System

Height = 255 Left = 225 TabIndex = 22 Top = 2955 Width = 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

Page 76: Library ANSHULfinal

Library Management System

End Begin VB.CommandButton Cmdexit Caption = "&Exit" Height = 330 Left = 5886 TabIndex = 14 ToolTipText = "Click here to exit " Top = 225 Width = 870 End 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 = 0 'False EndProperty Height = 435 Left = 1560 TabIndex = 18 Top = 360 Width = 4755 End End

EndAttribute VB_Name = "member"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = False

76

Page 77: Library ANSHULfinal

Library Management System

Dim db As DatabaseDim RS As RecordsetDim ch As BooleanDim fd As IntegerDim cHk As BooleanPrivate Sub Cmdpre_Click() On Error Resume Next RS.MovePrevious Call crecordEnd SubPrivate Sub Cmdreport_Click() On Error Resume Next cR2.Action = TrueEnd SubPrivate 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

Page 78: Library ANSHULfinal

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 crecordEnd 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

Page 79: Library ANSHULfinal

Library Management System

Cmdfind.Enabled = False Cmdreport.Enabled = FalseEnd 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 IfEnd Sub

Private Sub Cmdfirst_Click() On Error Resume Next RS.MoveFirst Call crecordEnd Sub

Private Sub Cmdnext_Click() On Error Resume Next RS.MoveNext Call crecordEnd Sub

Private Sub Cmdlast_Click() On Error Resume Next RS.MoveLast Call crecordEnd 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 LoopEnd SubPrivate 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

Page 80: Library ANSHULfinal

Library Management System

Set RS = db.OpenRecordset("SELECT * FROM customer") Call crecordEnd SubPrivate 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 IfEnd SubPublic 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 SubPublic 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 msGEnd Sub

VERSION 5.00Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "CRYSTL32.OCX"Begin VB.Form book Caption = "book" ClientHeight = 8265 ClientLeft = 60

80

Page 81: Library ANSHULfinal

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

Page 82: Library ANSHULfinal

Library Management System

Style = 1 'Graphical TabIndex = 29 ToolTipText = "To modify a Record"

Top = 210 Width = 690 End Begin VB.CommandButton Cmdreport Caption = "&Report" Height = 375 Left = 4650 Style = 1 'Graphical TabIndex = 28 ToolTipText = "To see the report of Records" Top = 210 Width = 690 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

Page 83: Library ANSHULfinal

Library Management System

Height = 375 Left = 1650 Style = 1 'Graphical TabIndex = 23 ToolTipText = "Previous Record" Top = 240 Width = 690 End Begin VB.CommandButton Cmdfirst Caption = "<<" Height = 375 Left = 300 Style = 1 'Graphical TabIndex = 22 ToolTipText = "First Record" Top = 240 Width = 690 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

Page 84: Library ANSHULfinal

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

Page 85: Library ANSHULfinal

Library Management System

Width = 720 End Begin VB.Label Lblbname BackStyle = 0 'Transparent Caption = "Book_Name" Height = 285 Left = 780 TabIndex = 18 Top = 735 Width = 915 End Begin VB.Label Lblbaname BackStyle = 0 'Transparent Caption = "Book_AuthorName" Height = 285 Left = 300 TabIndex = 17 Top = 1230 Width = 1395 End Begin VB.Label Lbllang BackStyle = 0 'Transparent Caption = "Book_Language" Height = 285 Left = 450 TabIndex = 16 Top = 1740 Width = 1245 End Begin VB.Label Lblcost BackStyle = 0 'Transparent Caption = "Book_Cost" Height = 285

Left = 795 TabIndex = 15 Top = 2250 Width = 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

Page 86: Library ANSHULfinal

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

Page 87: Library ANSHULfinal

Library Management System

End Begin VB.Image Image3 Height = 6585 Left = 120 Picture = "book.frx":055A Top = 8340 Width = 9600 EndEndAttribute VB_Name = "book"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseDim RS As RecordsetDim db As DatabaseDim fd As IntegerDim ch As BooleanDim cHk As BooleanDim rS1 As RecordsetDim msG As StringPrivate 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

Page 88: Library ANSHULfinal

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 rchangeEnd 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 IfEnd 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 LoopEnd SubPrivate 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 rchangeEnd SubPrivate 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

Page 89: Library ANSHULfinal

Library Management System

Call rchangeEnd SubPrivate 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 = FalseEnd SubPrivate 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 Suber1: MsgBox "This is the Last Record"End SubPrivate 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 IfEnd SubPrivate Sub Cmdreport_Click() On Error Resume Next cR3.Action = TrueEnd SubPrivate 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

Page 90: Library ANSHULfinal

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 IfEnd SubPrivate 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 rchangeEnd SubPublic 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 SubPublic Sub Compare() On Error Resume Next msG = "" If Not isString(Txtbname.Text) Then msG = msG & "Book Name must be in Characters" & vbNewLine

90

Page 91: Library ANSHULfinal

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 = TrueEnd SubPrivate 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 IfEnd Sub

VERSION 5.00Object = "{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

Page 92: Library ANSHULfinal

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

Page 93: Library ANSHULfinal

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

Page 94: Library ANSHULfinal

Library Management System

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 = 450 TabIndex = 0 ToolTipText = "Click here to select the Book author Name " Top = 1680 Width = 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

Page 95: Library ANSHULfinal

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

Page 96: Library ANSHULfinal

Library Management System

Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty 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 EndEndAttribute VB_Name = "bookinfo"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseDim RS As RecordsetDim aN As RecordsetDim sA As RecordsetDim sN As RecordsetDim db As Database

96

Page 97: Library ANSHULfinal

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 IfEnd SubPrivate 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

Page 98: Library ANSHULfinal

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 LoopEnd SubPrivate 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

Page 99: Library ANSHULfinal

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 LoopEnd SubPrivate Sub Cmdpr1_Click() On Error Resume Next cR.ReplaceSelectionFormula ("{book.b_authorName}='" & Cmbaname.Text & "'") cR.Action = TrueEnd SubPrivate Sub Cmdpr2_Click() On Error Resume Next cR1.ReplaceSelectionFormula ("{book.b_name}='" & Cmbname.Text & "'") cR1.Action = TrueEnd SubPrivate 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 = 0End SubPrivate 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 IfEnd Sub

99

Page 100: Library ANSHULfinal

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

Page 101: Library ANSHULfinal

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

Page 102: Library ANSHULfinal

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