Nishank Documentation

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 66

A Project Report on

VIDEO LIBRARY MANAGEMENT SYSTEM


Submitted By

Nishank M M (17P4SB7023)

A 5th Semester Project Report submitted in partial fulfilment of the requirements for the
award of Degree in

BACHELOR OF COMPUTER APPLICATIONS


Under the Guidance of

Mr. Hidayatullah

INDO ASIAN ACADEMY DEGREE COLLEGE


HRBR 2nd Block, Adjacent to KalayaNagar Bus Depot.

KalyanNagar, Bangalore - 560043

INDO ASIAN ACADEMY DEGREE COLLEGE


Bangalore – 560043

UNDERTAKING
I Nishank M M studying in 5th Semester BCA, hereby undertake that the

project has been carried out by me as a fulfilment of the


requirements for the award of the degree as prescribed by Bangalore
University. The Project was carried out under the guidance of Mrs. .

This Project report has not formed the basis for the award of the
Degree of Bangalore University.

Signature of Students :

Date :
INDO ASIAN ACADEMY DEGREE COLLEGE
Bangalore – 560043

CERTIFICATE

Certified that this Project Report Titled VIDEO LIBRARY


MANAGEMENT SYSTEM based on the Project Work carried out by
Nishank M M bearing respectively Registration Number 17P4SB7023
of 5th Semester BCA. This Report is submitted in partial fulfilment of
the requirements for the award of the Degree in Bachelor of
Computer Applications by Bangalore University, during the Academic
Year 2018.

HOD

Mr. Hidayatullah
(Dept. of Computer Science)
INDO ASIAN ACADEMY DEGREE COLLEGE
Bangalore – 560043

CERTIFICATE

Certified that this Project Report Titled VIDEO LIBRARY


MANAGEMENT SYSTEM based on the Project Work carried out by
Nishank M M bearing respectively Registration Number 17P4SB7023
of 5th Semester BCA. This Report is submitted in partial fulfilment of
the requirements for the award of the Degree in Bachelor of
Computer Applications by Bangalore University, during the Academic
Year 2018.

Examiner
Name :
Signature :
ACKNOWLEDGEMENT

We take this opportunity to express our deep sense of gratitude to


our Founder Chairman Prof.T.Ekambaram Naidu.
Prof.N.Bharathi, Principal for her valuable guidance, keen interest
and helpful during the course of study.

We express our sincere thanks to our respected HOD Mr.


Hidayatullah for providing all necessary help during our project work
and for giving guidance during our project work.

Last but never the least we would like to thanks our friends, staff and
all other who have directly and indirectly helped us in the successful
completion of this project.

TEAM MEMBERS
Preethi R Y (17p4sb7025)
Aishwarya R (17p4sb7006)
Nishank M M (17p4sb7023)
VIDEO LIBRARY MANAGEMENT SYSTEM

1. Introduction
1.1 Overview of the Project
1.2 System Specification
1.2.1 Hardware Requirements
1.2.2 Software Requirements

2. System Study
2.1 Introduction
2.2 Initial Investigation
2.3 Proposed system
2.4 About Operation System

3. Data Flow Diagrams


3.1 DFD for Login Module
32 DFD for Billing process
3.3 Entity Relationship Diagrams

4. Software Description
4.1 Microsoft Visual Basic 6.0
4.2 Starting Visual Basic
4.3 Parts of Visual Basic Project
4.4 Parts of the Visual Basic Programs
4.4.1 Main Window
4.4.2 Form Window
4.4.3 Properties
4.4.4 Form Events
4.45 Toolbox Window
4.5 Features of Visual Basic
4.6 SQL Plus

5. Database Design

6. Coding

7. Outputs

8. Conclusion

9. Bibliography
CHAPTER 1
INTRODUCTION
INTRODUCTION
Using current Video Library Management System customers can find
their CD by checking their names, singers etc manually. This video
library management system may sometimes make customers
unhappy by not finding their products. Managers or working
employees cannot find the sales details of particular CD and thus
cannot categorize then properly. Under one store there are various
types of CD sold and their managers find difficulties to maintain the
records of their vendors. It also creates difficulties in generating
reports and analyzes market situations as per customer demands
and requirements.
To help user in finding their products easily and thus saving time. To
eliminate manual process of storing information by using the
concept of database as backend and providing graphical user
interface by using Visual Basic as front end. Eliminating file keeping
system and implementing the use of data backup options to save
their precious data.

Overview of Project
This video library management system will help their customers to
find their products as per their query in less time. User can search
any particular video cd using their year of release, any particular
song name, artist, details, film name etc. Thus saving their time and
eliminating the process of searching manually by using video library
management system.

Admin only will have the authority to add records, delete records,
modify any existing records, giving permission to any employee.
Admin can generate report as per their requirement. Admin will also
be able to add vendor details from where they purchased along with
video CD name, price of CD and date of purchase records by using
information stored in the database.

Working employee will have a valid user and password. Employee


will be eligible to generate bills for customers and receive payments.
When the employee will enter the first letter of the video CD, then a
list of available CD will appear from where they can select the name,
its price with its details will appear on screen. They have to only
enter the total number of quantity or items, then after system will
generate the total amount which is to be paid by the customer.
1.2 SYSTEM SPECIFICATION

1.2.1 Hardware Requirements

Processor: Intel Pentium IV (2.4 GHZ or above)


Clock speed : 500 MHZ
System bus : 32 bits
RAM : 256MB of RAM
HDD: 40 GB or higher
Monitor: SVGA COLOR
Keyboard: 108 keys
Mouse: 2 button mouse

1.2.2 Software Requirements

OS : MS WINDOWS XP SP2
Front End : Visual Basic 6.0
Back End : SQL +
CHAPTER 2
SYSTEM STUDY
2. SYSTEM STUDY

2.1 INTRODUCTION
The goal of any system development is to develop and implement
the system cost effectively user-friendly and most suited to the
user's analysis is the heart of the process. Analysis is the study of
the various operations performed by the system and their
relationship within and outside of the system. During analysis,
data collected on the files, decision points and transactions
handled by the present system. Different kinds of tools are used in
analysis of which interview is a common one.

2.2 INITIAL INVESTIGATION


The first step in system development life cycle is the identification
of need of change to improve or enhance an existing system. An
initial investigation on existing system was carried out. The
present system of hospital is completely manual. Many problems
were identified during the initial study of the existing system.

2.3 PROPOSED SYSTEM


The drawback of the existing system is that it is very difficult to
retrieve data from case files. It is difficult to handle the whole system
manually and it is less accurate and to keep the data in case files for
future reference because it may get destroyed. Moreover it is very
difficult to retrieve data. Redundancy of data may occur and this may
lead to the inconsistency. The manual system is so time-consuming.
The proposed system is very easy to operate. Speed and accuracy are
the main advantages of proposed system. There is no redundancy of
data. The data are stored in the computer's secondary memories like
hard disk, etc. it can be easily receive and used at any time. The
proposed system will easily handle all the data and the work done by
the existing systems. The proposed systems eliminate the drawbacks
of the existing system to a great extent and it provides tight security
to data.

2.4 ABOUT OPERATING SYSTEM


Windows XP is a line of operating systems developed by Microsoft
for use on general purpose computer systems, including home and
business desktops, notebook computers and media centres. The
letters 'XPstand for experience. Windows XP is the successor to both
Windows 2000 and Windows Me and is first consumer oriented
operating system produced by Microsoft to be built on the Windows
NT kernel and architecture. The most common editions of operating
systems are Windows XP home edition, which is targeted at home
users, and Windows XP professional, which has additional features
such as, support for Windows server domain and two physical
processors and is targeted at power users and business clients.
Windows XP Tablet PC edition is designed to run the ink-aware
Tablet PC platform. Two separate 64 bit versions of Windows XP
were also released, Windows XP 64 bit edition for IA-64(Itanium)
processors and Windows XP Professional x64 edition for x86-64
processors.
CHAPTER 3
DATA FLOW DIAGRAMS
Chapter 4
SOFTWARE
DESCRIPTION
4. SOFTWARE DESCRIPTION

4.1 Microsoft Visual Basic 6.0


Visual Basic 6 is Microsoft's latest and greatest version of the Visual
Basic programming language. Although writing programs can be a
tedious chore at times, Visual Basic reduces the effort required on
your part and makes programming enjoyable. Visual Basic makes
many aspects of programming as simple as dragging graphic objects
onto the screen with your mouse.
Microsoft based Visual Basic on a programming language written for
beginners called BASIC.
BASIC has been around for more than 35 years in one form or
another. The original language designers wanted to develop a
programming language that beginners could use. With BASIC, new
programmers could become proficient right away.
BASIC stands for Beginner's All-purpose Symbolic Instruction Code.
That's some abbreviation!
A programming language is a set of commands and command
options, called arguments that you use to give instructions to the
computer. Computers cannot (yet) understand human languages
because people deal well with ambiguous commands, and a computer
cannot understand such ambiguity. A programming language must be
more precise than a spoken language.

4.1.1 The Programming Process

Over time you'll find your own way of writing programs that works
best for you. Nevertheless,
You’ll generally follow these standard set of steps when creating your
Visual Basic programs:
1. Decide what your application is to do by creating an overall design.
2. Create the visual portion of your application (the screens and
menus that your users will interact with).
3. Add Visual Basic programming language code to tie the visual
elements together and to automate the program.
4. Test your application to locate and remove any bugs you find.
5. Compile your tested application and distribute the compiled
application to your users.

4.1.2 Understanding Program Maintenance

Bugs are not the only reason that you will work on a program after
you think you're completely done with it. Program maintenance is
necessary because requirements change, companies change, and laws
change. You must also change the programs you write so that they
remain viable programs; you will need to update your program
periodically to reflect changes that impact the program. In addition,
users will think of new things that they want the program to do.
Program maintenance is the term used for the updating of a program
after the program is put into use. This update may be a result of a
user's request or a change in the way the program needs to operate.
It is said that a program is written once and modified many times. The
more program maintenance you perform, the more likely that your
program will be up-to-date and in use. You may want to release new
versions of your program so that users can, with a different version
number on the opening screen that you place there, keep track of the
latest version installed on their system.

4.1.3 Visual Basic Is a Smart Language


The main reason why Visual Basic is so popular and powerful is the
same reason behind the success of Windows. Microsoft took a
complex technology (writing computer programs) and made it easier
to use through a graphical interface. Suppose you have to write a
program for your company. In a visual programming environment,
you can quickly design the windows that the user sees by drawing and
arranging them just as you would lay out elements for a newspaper.
In a text-based programming system, you control the user interface
through program language commands. Common sense tells you that
the visual programming method is easier for newcomers to learn and
requires less time to maintain. In this case, the old adage “a picture is
worth a thousand words” truly applies. However, do not let me give
you the impression that Visual Basic is just another pretty interface.
Another key concept of Visual Basic is the ability to create and use
self-contained components, or objects.

4.1.4 Tool Box Controls


The toolbox contains all the custom control needed for a visual basic
application .several advanced controls can be added to the project
from the menu bar tool, Project – Components. Each control has its
own properties, Events and methods. The properties of a control can
be set either through code or in the properties window user – defined
controls can also be created and added to the tool box. Controls work
with multimedia and internet too.
4.1.5 Adding controls
Controls can be added to a form in two ways:
*Double-click on a control in the toolbox and it appears on the form.
*Click on the control icon. Move the mouse over the form, click and
draw the control to the required size.

4.1.6 Removing controls


To remove a control from the form
*Select the control.
*Press the delete key.
Controls can be placed anywhere on the form. Their size can be
changed by using the sizing handle which appear when a control in
selected.

4.1.7 Intrinsic controls


The default controls which are automatically displayed in a toolbox
when a form is loaded are known as intrinsic controls. The intrinsic
controls in visual basic are very powerful, since objects such as
buttons, labels, text boxes, and combo or list boxes can be added to a
form easily and coded. Some common intrinsic controls which are
described below:
Label
Command button
Text box
Frame
Option button
Check box
Picture box
Inage box
Timer
Combo box
List box
Horizontal & vertical scroll box
Shape and line
OLE

4.1.8 Label
Label control allows the user to display text on a form, which does
not change. For example
Label1.caption=”Name;”
Generally labels are used to print captions for other controls. Text
printed on labels cannot be edited during runtime.

4.1.9 Command buttons


Commands buttons is one of the most powerful and frequently used
controls in windows application. It is used to invoke response from
the user or to invoke special functions on the form.
4.1.10 Textbox control
Textbox control is one of the most popular and versatile mechanism
used to display and enters text in a window user interface. It behaves
like a mini text editor providing all the basic text editing facilities.

Basic text properties


The basic properties of a textbox determine the appearance and
functionality of a textbox control. Some of them are as described
below:
Enabled: Indicates whether the user can interact with the control or
not.
Index: Determine the control array index.
Locked: Boolean. Indicates whether the user can type in the textbox
or not.
Max Length: Indicates the maximum number of characters input in
the textbox. Default values are 0, which means any number of
characters. The maximum of text can be typed in a textbox is nearly
64 kb.
Max length property can be set to a specific value restricting the user
to type only that many character.
Multi Line: Specifies whether the textbox will hold a single line or
multiple lines.
Password char: Specifies the masking character for text displayed in
the textbox. Suppose the password is set to “*”, the user than sees an
asterisk in the place of every character typed in that textbox.
Scrollbars: Indicates horizontal scrollbars, vertical scrollbars or both
for the textbox. This property is used with multiline property.
Multiline textboxes can have horizontal, vertical or both scroll bars. If
a horizontal scrollbar is attached to a text box, the text will not wrap
automatically. The user must press enter to start new line.
Text: Specifies the text in the textbox.
Alignment: Alignment of text in a textbox can be Left-justified,
centered or right-justified.
SelText: Returns the selected text. A selected text can be converted to
uppercase by the following code:
Text1. SelText= Ucase(Text1.SelText)
SelStart: Specifies the position of the first character of the selected
text.

SetLength: Returns the length of the selected text. The most common
use of these properties is to select a piece of text at runtime to select
the text in a textbox.
Text1.selstart=1
Text1.selLength=Len (Text1)
Click: Click event is called when the text box is clicked with the
mouse.
Key press: Occurs every time a key is pressed and stores the ASCII
code of the key pressed in keyascii (an integer type). This event can
be used to restrict the user to type only certain characters.
Controls are elements you can use when designing a user interface.
Visual Basic controls enable you to add features to your programs
without you having to be involved in the details of how these features
work. For example, receiving input from a user of your program is as
simple as drawing a control that accepts input. This is a great
advantage of visual programming languages—you can concentrate on
what you want your program to do, not how to get the programming
language to do it.

4.1.11 What does VB 6.0 have….


Just about everything we could write about Visual Basic is, from
language reference to ADO database handling, from creating Web
browsers to dragging and dropping data across applications, from
email applications to multimedia players, from creating ActiveX
controls and ActiveX
Documents to setup programs, it’s all here.
Here’s some of what we’ll see:
• ActiveX controls
• ActiveX documents
• ADO, DAO, and RDO database applications
• Multimedia AVI, MPG, WAV, and MID players
• CD players that play CDs from the computer’s CD-ROM drive
• Bitmapped menu items
• Full Web browsers
• Pie charts, line charts, bar charts, and others
• Code clients that call methods in programs like Microsoft Excel
• Code components (OLE automation servers)
• Graphics animation
• Applications that use the Windows Common Dialogs
• Customized toolbars with embedded controls like combo boxes
• Data entry forms
• Database editing applications
• Direct connections to the Windows API
• Direct connections to code written in Visual C++
• Drag/drop operations
• Graphics applications that draw arcs, circles, rectangles, lines, and
more
• Email applications
• Error handlers
• Applications that use the printer
• Word processor applications
• File handlers for text and binary data
• FTP applications
• Dialog boxes
• Windows Help files
• MDI applications
• Pop-up menus activated with right mouse clicks
• Application deployment
• HTTP applications
• Image handling: blur, emboss, engrave, flip, sweep, stretch images,
and more
• OLE applications
• Applications that use the Windows Registry
• List views and tree views
• Applications that create controls at runtime
• Mouse capture
• OLE drags (dragging data between applications)
• Online user registration
• Picture clip applications
• Setup programs
• Screen capture
• Spreadsheets
• Status bars and toolbars
• Tab strips, progress bars, and others

4.1.12 Visual Basic with Databases

A database is a collection of information. This information is stored


in a very structured manner. By exploiting this known structure, we
can access and modify the information quickly and correctly.

For database management, Visual Basic application acts as a front-


end to the database. This means the Visual Basic application provides
the interface between the user and the database. This interface allows
the user to tell the database what he or she needs and allows the
database to respond to the request displaying the requested
information in some manner.
A Visual Basic application cannot directly interact with a database.
There are two intermediate components between the application and
the database: the data control and the database engine:
The data control is a Visual Basic object that connects the
application to the database via the database engine. It is the conduit
between the application and the engine, passing information back and
forth between the two.

The database engine is the heart of a Visual Basic database


management system. It is the actual application that does the
management. Having this engine saves programmers a lot of work.
The database engine native to Visual Basic is known as the Jet
engine. It is the same engine used by Microsoft Access for database
management. Hence, it is primarily used to work with Access
databases, but it can also work with others.
4.1.13 ActiveX Data Object Components

The first step in editing an ADO database is to open that database,


which is called a data source in ADO terminology, by setting up a
Connection object.
To use that and other ADO objects in code, use the Project References
item, select the Microsoft ActiveX Data Objects Library item, and
click on OK, adding the ADO Object Library to your program.

Now create a new ADO Connection object with the Connection


object’s Open method:
Here are the arguments for this method:
• Connection String—String containing connection information.
• UserID—String containing a username to use when establishing the
connection.
• Password—String containing a password to use when establishing
the connection.
• OpenOptions—if set to adConnectAsync, the connection will be
opened asynchronously.
Here are the possible values for the Type argument:
• dbOpenKeyset—opens a dynaset-type Recordset object, which is
like an ODBC keyset cursor.
• dbOpenDynamic— opens a dynamic-type Recordset object, which
lets the application see changes made by other users.
• dbOpenStatic—Opens a static-type Recordset object.
• DbOpenForwardOnly—opens a forward-only-type Recordset
object, where you can only use
MoveNext to move.

Here are the possible values for the Lock Type argument:

• AdLockReadOnly—The default; read-only.


• adLockPessimistic—Pessimistic locking, record by record.
• adLockOptimistic—Optimistic locking, record by record.
• adLockBatchOptimistic—Optimistic batch updates.

Here are the possible values for the Options argument:


• adCmdText—Provider should evaluate Source as a definition of a
command.
• adCmdTable—ADO should generate an SQL query to return all
rows from the table named in Source.
• adCmdTableDirect—Provider should return all rows from the table
named in Source.
• adCmdStoredProc—Provider should evaluate Source as a stored
procedure.
• adCmdUnknown—Type of command in the Source argument is
not known.
• adCommandFile—Record set should be restored from the file
named in Source.
• adExecuteAsync—Source should be executed asynchronously.
• adFetchAsync—After the initial quantity specified in the
CacheSize property is fetched, any remaining rows should be
fetched asynchronously
4.2 Introduction to SQL

Introduction and Objectives


We have used Oracle 10G which is uses SQL to create the database
for our project. It is used for manipulating database by performing
operations like insert, update and delete.

SQL has the capability to specify more general constraints called


assertions. It has transaction control commands. These are used to
specify units of database processing for concurrency control and
recovery purposes. Using Oracle forms on a client server workstation,
an end user can run a forms application for data entry and on screen
reporting with an Oracle release. Oracle forms, part of
Developer/2000 application development suite, is an Oracle tool that
both end users and application developers use.

Table:
Tables are the main units of data storage in a database. A table is a
collection of data about a specific topic; it is made up of one of more
fields.

Data type:
Data types are the properties of each field. A field only has one
data type, such as Character, Number or Date.
Design View:
It provides the tools for creating fields in a table.

Datasheet View:
It allows you to update, edit, and delete information from a table.
Chapter 5

DATABASE
DESIGN
DATABASE DESIGN

Database design is concerned with the data focus from the


perspective of the system designer. The end product is called a
database schema, a technical blueprint of database.
Database design translates the data models that were
developed for the system users during the definition phase in
to data structures supported by the chosen database
technology. The goals of database design are as follows:
• A database should provide for the efficient storage,
update and retrieval of data.
• A database should be reliable-the stored data should have
high integrity to promote user trust in that data.
A database should be adaptable and scalable to new and unforeseen
requirements and applications.
Table Name: CUSTOMERS

CUSTOMERID CUSTOMERNAME OCCUPATION ADDRESS


TELEPHONE
---------- --------------- --------------- -------------------- ----------
1 dinesh Student huhujfhhfju 9008765432
2 Aishu Teacher Kalayan nagar 8907654321
APS4 Anju Student Tin Factory 7890654321
4 Nishank Student Indira nagar 7689054321
16M Kritika Koramangala 7841525692
Table Name: RENTVIDEO

CUSTOMERID REFNO VIDEOCODE DATEISSUE RETURNDAT


AMOUNTDUE
---------- -------------------- ---------- --------- --------- ----------
1 1-V002-12/05/2009 V002 12-MAY-09 15-MAY-09
10500
2 2-V001-12/05/2009 V001 12-MAY-09 17-MAY-09
25000
APS4 APS4-V67T-24/5/2009 V67T 24-MAY-09 27-MAY-09
23400
Table Name: VIDEOS

VIDEOCODE VIDEONAME RENTALPRICE CATEGORY

---------- -------------------- ----------- --------------------

DIRECTOR YEAR

------------------------- ----------

V67T Lord Of The Rings 7800 Epic

Kazembe 2003

V001 Hamsa 5000 Epic

Raju 2003
Table Name: RETURNVIDEO
CHAPTER 6
CODING
MDI FORM

Private Sub mnuCustomerMaster_Click ()


On Error Resume Next
rptCustomerMaster.Show
End Sub

Private Sub mnuCustomers_Click ()


frmCustomerMaster.Show vbModal
End Sub

Private Sub mnuExit_Click()


End
End Sub

Private Sub mnuReceiveRentedVideos_Click()


frmReturnVideo.Show vbModal
End Sub
Private Sub mnuRentedVideos_Click()
On Error Resume Next
rptRentedVideos.Show
End Sub

Private Sub mnuRentVideos_Click()


FrmRentVideo.Show vbModal
End Sub

Private Sub mnuVideos_Click()


frmVideosMaster.Show vbModal
End Sub

Private Sub mnuVideosMaster_Click ()


On Error Resume Next
rptVideos.Show
End Sub

Private Sub Picture1_Click()


End Sub

Private Sub Timer1_Timer()


Me.Timer1.Enabled = False

End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As


MSComctlLib.Button)
Select Case Button.Key
Case "keyCustomers"
Call mnuCustomers_Click

Case "keyVideos"
Call mnuVideos_Click

Case "keyRent"
Call mnuRentVideos_Click

Case "keyReturn"
Call mnuReceiveRentedVideos_Click

Case "keyCustomersReport"
Call mnuCustomerMaster_Click

Case "keyVideosReport"
Call mnuVideosMaster_Click

Case "keyRentReport"
Call mnuRentedVideos_Click
End Select
End Sub

VIDEO MASTER

Private Sub cmdAddNew_Click()


On Error Resume Next
Me.AdoVideos.Recordset.AddNew
Me.cmdFirst.Enabled = False
Me.cmdLast.Enabled = False
Me.cmdNext.Enabled = False
Me.cmdPrev.Enabled = False
Me.cmdDel.Enabled = False
Me.txtVideoCode.SetFocus
End Sub

Private Sub cmdCancel_Click()


On Error Resume Next
Me.AdoVideos.Recordset.CancelUpdate
Me.cmdFirst.Enabled = True
Me.cmdLast.Enabled = True
Me.cmdNext.Enabled = True
Me.cmdPrev.Enabled = True
Me.cmdDel.Enabled = True
End Sub

Private Sub cmdClose_Click()


On Error Resume Next
Unload Me
End Sub

Private Sub cmdDel_Click()


On Error Resume Next
Dim x As Integer
x = MsgBox("Are you sure you want to delete this
customer?", vbQuestion + vbYesNo, "Delete?")
If x = vbYes Then
Me.AdoVideos.Recordset.Delete
Me.AdoVideos.Recordset.MoveNext
If Me.AdoVideos.Recordset.EOF = True Then
Me.AdoVideos.Recordset.MovePrevious
End If
End If
End Sub

Private Sub cmdFirst_Click ()


On Error Resume Next
Me.AdoVideos.Recordset.MoveFirst
End Sub

Private Sub cmdLast_Click ()


On Error Resume Next
Me.AdoVideos.Recordset.MoveLast
End Sub

Private Sub cmdNext_Click ()


On Error Resume Next
Me.AdoVideos.Recordset.MoveNext
If Me.AdoVideos.Recordset.EOF = True Then
Me.AdoVideos.Recordset.MoveLast
MsgBox "End of file reached!", vbInformation, "EOF"
End If
End Sub

Private Sub cmdPrev_Click ()


On Error Resume Next
Me.AdoVideos.Recordset.MovePrevious
If Me.AdoVideos.Recordset.BOF = True Then
Me.AdoVideos.Recordset.MoveFirst
MsgBox "Begining of file reached!", vbInformation,
"BOF"
End If
End Sub

Private Sub cmdSave_Click()


On Error Resume Next
Dim x As Integer
x = MsgBox("Are you sure you want to add this
customer?", vbQuestion + vbYesNo, "Add?")
If x = vbYes Then
Me.AdoVideos.Recordset!Available = 1
Me.AdoVideos.Recordset.Update
MsgBox "Customer Added successfully!", vbInformation,
"Customer Added"
Me.cmdFirst.Enabled = True
Me.cmdLast.Enabled = True
Me.cmdNext.Enabled = True
Me.cmdPrev.Enabled = True
Me.cmdDel.Enabled = True
End If
End Sub

RETURN VIDEO
Private Sub cboRefNumber_Change ()
On Error Resume Next

Me.AdoRentedVideos.Recordset.MoveFirst
Me.AdoRentedVideos.Recordset.Find "RefNo = '" &
Me.cboRefNumber.Text & "'"
Me.txtVideoCode.Text =
Me.AdoRentedVideos.Recordset!VideoCode
Me.txtVideoName.Text =
Me.AdoRentedVideos.Recordset!VideoName
Me.txtCustomerID.Text =
Me.AdoRentedVideos.Recordset!CustomerID
Me.txtCustomerName.Text =
Me.AdoRentedVideos.Recordset!CustomerName
Me.AdoVideos.Recordset.MoveFirst
Me.AdoVideos.Recordset.Find "VideoCode = '" &
Me.AdoRentedVideos.Recordset!VideoCode & "'"
End Sub

Private Sub cmdPost_Click()


On Error Resume Next
Dim x As Integer
x = MsgBox("Are you sure you want to return the video?",
vbQuestion + vbYesNo, "Return Video")
If x = vbYes Then
Me.AdoVideos.Recordset!Available = 1
Me.AdoVideos.Recordset.Update
MsgBox "Video has been successfully returned!",
vbInformation, "Video Returned"
End If
End Sub
RENT VIDEO

Dim blnID As Boolean, blnName As Boolean

Private Sub cboCustomerID_Change()


On Error Resume Next
If blnID = True Then
Me.AdoCustomers.Recordset.MoveFirst
Me.AdoCustomers.Recordset.Find "CustomerID = '" &
Me.cboCustomerID.Text & "'"
Me.cboCustomerName.Text =
Me.AdoCustomers.Recordset!CustomerName
Me.Address.Text =
Me.AdoCustomers.Recordset!Address
End If
End Sub

Private Sub cboCustomerID_GotFocus ()


'Me.cboCustomerID.ReFill
blnID = True
blnName = False
End Sub

Private Sub cboCustomerName_Change()


On Error Resume Next
If blnName = True Then
Me.AdoCustomers.Recordset.MoveFirst
Me.AdoCustomers.Recordset.Find "CustomerName = '"
& Me.cboCustomerName.Text & "'"
Me.cboCustomerID.Text =
Me.AdoCustomers.Recordset!CustomerID
Me.Address.Text =
Me.AdoCustomers.Recordset!Address
End If
End Sub

Private Sub cboCustomerName_GotFocus()


blnID = False
blnName = True
End Sub
Private Sub cboVideoCode_Change()
On Error Resume Next
If blnID = True Then
Me.AdoVideos.Recordset.MoveFirst
Me.AdoVideos.Recordset.Find "VideoCode = '" &
Me.cboVideoCode.Text & "'"
Me.cboVideoName.Text =
Me.AdoVideos.Recordset!VideoName
Me.txtPrice.Text = Me.AdoVideos.Recordset!RentalPrice
Me.txtCategory.Text =
Me.AdoVideos.Recordset!Category
End If
End Sub

Private Sub cboVideoCode_GotFocus()


Me.cboVideoCode.ReFill
blnID = True
blnName = False
End Sub
Private Sub cboVideoName_Change()
On Error Resume Next
If blnName = True Then
Me.AdoVideos.Recordset.MoveFirst
Me.AdoVideos.Recordset.Find "VideoName = '" &
Me.cboVideoName.Text & "'"
Me.cboVideoCode.Text =
Me.AdoVideos.Recordset!VideoCode
Me.txtPrice.Text = Me.AdoVideos.Recordset!RentalPrice
Me.txtCategory.Text =
Me.AdoVideos.Recordset!Category
End If
End Sub

Private Sub cboVideoName_GotFocus()


Me.cboVideoName.ReFill
blnID = False
blnName = True
End Sub

Private Sub cmdPost_Click ()


On Error Resume Next
Dim x As Integer
x = MsgBox("Are you sure you want to rent this video?",
vbQuestion + vbYesNo, "Rent Video?")
If x = vbYes Then
Me.AdoRentVideo.Recordset.AddNew
Me.AdoRentVideo.Recordset!RefNo = Me.txtRefNo.Text
Me.AdoRentVideo.Recordset!CustomerID =
Me.cboCustomerID.Text
Me.AdoRentVideo.Recordset!VideoCode =
Me.cboVideoCode.Text
Me.AdoRentVideo.Recordset!DateIssued =
Me.DTPicker1.Value
Me.AdoRentVideo.Recordset!ReturnDate =
Me.DTPicker2.Value
Me.AdoRentVideo.Recordset!AmountDue =
Val(Me.txtDays.Text) *
Val(Me.AdoVideos.Recordset!RentalPrice & "")
Me.AdoRentVideo.Recordset.Update

Me.AdoVideos.Recordset!Available = 0
Me.AdoVideos.Recordset.Update
Me.AdoVideos.Refresh

Me.cboCustomerID.Text = ""
Me.cboCustomerName.Text = ""
Me.cboVideoCode.Text = ""
Me.cboVideoName.Text = ""
Me.txtAddress.Text = ""
Me.txtCategory.Text = ""
Me.txtDays.Text = ""
Me.txtPrice.Text = ""
Me.txtTotalAmountDue.Text = ""

MsgBox "Video has been successfully rented out!",


vbInformation, "Video Rented"
Me.cboCustomerID.SetFocus
End If
End Sub

Private Sub DTPicker2_CloseUp()


On Error Resume Next
Me.txtDays.Text = DateDiff("d", Me.DTPicker1.Value,
Me.DTPicker2.Value)
Me.txtTotalAmountDue.Text =
Format(Val(Me.txtDays.Text) *
Val(Me.AdoVideos.Recordset!RentalPrice & ""),
"###,###,##0.00")
End Sub

Private Sub DTPicker2_GotFocus ()


On Error Resume Next
Me.txtRefNo.Text = UCase (Me.cboCustomerID.Text & "-"
& UCase (Me.cboVideoCode) & "-" &
Format(Me.DTPicker1.Value, "DD/MM/YYYY"))
End Sub

Private Sub Form_Load ()


On Error Resume Next
Me.DTPicker1.Value = Date
Me.DTPicker2.Value = Date
End Sub
LOGIN FORM

Private Sub cmdCancel_Click ()


Unload Me
End Sub

Private Sub cmdOK_Click ()


If UserName = "Admin" And Password = "abcd" Then
MsgBox "login successfully"
MDIForm1.Show

Else
MsgBox "invalid username and password"
End If

End Sub

CUSTOMER
Private Sub cmdAddNew_Click ()
On Error Resume Next
Me.AdoCustomers.Recordset.AddNew
Me.cmdFirst.Enabled = False
Me.cmdLast.Enabled = False
Me.cmdNext.Enabled = False
Me.cmdPrev.Enabled = False
Me.cmdDel.Enabled = False
Me.txtCustomerID.SetFocus
End Sub

Private Sub cmdCancel_Click ()


On Error Resume Next
Me.AdoCustomers.Recordset.CancelUpdate
Me.cmdFirst.Enabled = True
Me.cmdLast.Enabled = True
Me.cmdNext.Enabled = True
Me.cmdPrev.Enabled = True
Me.cmdDel.Enabled = True
End Sub

Private Sub cmdClose_Click()


On Error Resume Next
Unload Me
End Sub

Private Sub cmdDel_Click()


On Error Resume Next
Dim x As Integer
x = MsgBox("Are you sure you want to delete this
customer?", vbQuestion + vbYesNo, "Delete?")
If x = vbYes Then
Me.AdoCustomers.Recordset.Delete
Me.AdoCustomers.Recordset.MoveNext
If Me.AdoCustomers.Recordset.EOF = True Then
Me.AdoCustomers.Recordset.MovePrevious
End If
End If
End Sub

Private Sub cmdFirst_Click ()


On Error Resume Next
Me.AdoCustomers.Recordset.MoveFirst
End Sub

Private Sub cmdLast_Click ()


On Error Resume Next
Me.AdoCustomers.Recordset.MoveLast
End Sub
Private Sub cmdNext_Click ()
On Error Resume Next
Me.AdoCustomers.Recordset.MoveNext
If Me.AdoCustomers.Recordset.EOF = True Then
Me.AdoCustomers.Recordset.MoveLast
MsgBox "End of file reached!", vbInformation, "EOF"
End If
End Sub
Private Sub cmdPrev_Click ()
On Error Resume Next
Me.AdoCustomers.Recordset.MovePrevious
If Me.AdoCustomers.Recordset.BOF = True Then
Me.AdoCustomers.Recordset.MoveFirst
MsgBox "Begining of file reached!", vbInformation, "BOF"
End If
End Sub
Private Sub cmdSave_Click ()
On Error Resume Next
Dim x As Integer
x = MsgBox("Are you sure you want to add this
customer?", vbQuestion + vbYesNo, "Add?")
If x = vbYes Then
Me.AdoCustomers.Recordset.Update
MsgBox "Customer Added successfully!", vbInformation,
"Customer Added"
Me.cmdFirst.Enabled = True
Me.cmdLast.Enabled = True
Me.cmdNext.Enabled = True
Me.cmdPrev.Enabled = True
Me.cmdDel.Enabled = True
End If
End Sub
CHAPTER 7
OUTPUTS
CHAPTER 8
CONCLUSION

You might also like