Project Rpt Hospital

Embed Size (px)

Citation preview

  • 8/8/2019 Project Rpt Hospital

    1/106

    DOCUMENTATION:CARE N CURE

    Project On

    Hospital Management System

    Submitted by

    Name: Aasiya Amin

    Registration #: 227086

    Date of Submission: 07-04-2004

    Under the guidance of: Mr. Arshid HussainB.E. (Electronics & Communication).

    _______________A-Levels________________

    CNC Aasiya Amin DOEACC A-Levels Projecti

  • 8/8/2019 Project Rpt Hospital

    2/106

    Care N Cure(CNC)

    (Project Title)

    Start Date: July 7, 2003

    End Date: March 3, 2004

    Name of the Coordinator (Guide): Mr. Arshid HussainB.E. (Electronics & Communication)

    Names of Developer: Aasiya Amin

    Date of Submission: 07-04-2004

    Submitted in partial fulfillment of the requirements for qualifying DOEACC A Levels

    CNC Aasiya Amin DOEACC A-Levels Projectii

  • 8/8/2019 Project Rpt Hospital

    3/106

    Forwarding Letter

    Executive Director

    DOEACC Society

    6, CGO Complex,

    Lodhi Road,

    New Delhi 110003

    Subject: Submission of Project Report

    Level A

    Registration No. 227086

    Sir,

    I am submitting my A Level Project for evaluation. Details of my

    Registration and postal address, etc. are as under:

    Name : Aasiya Amin

    Parentage : M.A. Bhat

    Address : Rozabal Khanyar

    Srinagar 190003

    J & K, India.

    Phone No. : 0194-2477880

    E-mail : [email protected]

    Thanking you.

    Yours faithfully,

    Aasiya Amin

    CNC Aasiya Amin DOEACC A-Levels Projectiii

  • 8/8/2019 Project Rpt Hospital

    4/106

    Acknowledgement

    I have benefited a lot from the feedback and suggestions given to me by

    Mr. Arshid Hussain Sesia Consulting Web site and my friends.

    CNC Aasiya Amin DOEACC A-Levels Projectiv

  • 8/8/2019 Project Rpt Hospital

    5/106

    CERTIFICATE

    This is to certify that this report titled Care N Cureembodiesthe original work

    done by Aasiya Amin (Registration# 227086) in partial fulfillment of A Levels

    course requirement at DOEACC under my direct supervision and guidance.

    Coordinator:

    Arshid Hussain

    B. E. (Electronics & Communication)

    Specialization in C/C++ under Unix System

    Work Experience: About 8 years

    Address: Karan Nagar, Srinagar (J & K) Dated: 07-04-2004

    CNC Aasiya Amin DOEACC A-Levels Projectv

    DOEACC

  • 8/8/2019 Project Rpt Hospital

    6/106

    Table of Contents

    # Description Page #

    1 Introduction ---------------------------------------------------------------------- 1

    2 Goals to be achieved ------------------------------------------------------------ 3

    3 Project Initiation Note ----------------------------------------------------------- 4

    4 Project Plan ----------------------------------------------------------------------- 5

    5 System Development Life Cycle ----------------------------------------------- 7

    6 Methods used for Maintenance and Evaluation ---------------------------- 9

    7 Development Environment ----------------------------------------------------- 12

    8 Data Flow Diagram -------------------------------------------------------------- 13

    9 E R Diagram -------------------------------------------------------------------- 16

    10 Structure Chart ------------------------------------------------------------------ 17

    11 Database Schema ---------------------------------------------------------------- 18

    12 Test Report ------------------------------------------------------------------------ 20

    13 Program Listings ----------------------------------------------------------------- 22

    Database Script.. 22

    Project File. 25

    Main Form. 26

    Login Form 29

    Main Navigation Form 32

    Album Navigation Form 37

    Data Entry for Album Form. 39

    Title Entry Form.. 47

    Song Entry Form. 58

    Song Search by First Line Form. 72

    Report Centre Form 75

    General Dialog Form..

    82

    Favorite Song Search Form.. 83

    User Administration Form 88

    The Main Standard Module. 93

    Reports.. 96

    Audio Management Library System Help (ALMS Help) .. 97

    14 Suggested Enhancements ------------------------------------------------------ 98

    15 Conclusion------------------------------------------------------------------------- 99

    16 Instructions for Executing Project --------------------------------------------- 100

    CNC Aasiya Amin DOEACC A-Levels Projectvi

  • 8/8/2019 Project Rpt Hospital

    7/106

    Introduction

    Medical profession is one of the most honored professions. Due to changing

    atmosphere and new diseases, the job is becoming more complex and difficult. So

    this profession also needs some of backup, which can help in identifying disease,

    and history of the patient for the eradication of disease.

    There is one dimension where computers play an important part. This is the

    CARE N CURE system, which includes clinical laboratories and pathological

    investigations as well. Thus, one sees that is a whole plethora of computer

    applications in medicines, surgery, laboratory management, patient care and most

    importantly in the development of human resources.

    The main problem of the present system in the hospital is that it is still

    managed manually. This manual management takes a lot of time in effort. This

    problem can be reduced by introducing a simple software. Our motive of making

    project is to automate the existing system so that the time can be saved.

    It is our sincere hope that this project namely CARE N CURE system will

    find acceptance in the medical profession.

    CNC Aasiya Amin DOEACC A-Levels Project1

  • 8/8/2019 Project Rpt Hospital

    8/106

    Computer science is rapidly advancing field and is hard to predict where it

    is heading. Researchers at universities and industrial research labs are constantly

    thinking of new ideas, some of which go nowhere but some of which become the

    corner stone of future products and have massive impact on the industry and

    users telling which in turns out to be easier to do in hindsight than in real time.

    When MS-Dos was introduced as an operating system no one had predicted that it

    would lead to development of graphical and user-friendly windows operating

    system.

    The system is developed for hospital; it reduces lots of documentation,

    paper work and also saves lots of energy and time. The system is being developed

    with the object to eliminate big files and forms and to organize the information

    effectively and systematically. It reduces not only paper work but maintains hugedata with least effort. It reduces the clerical work.

    CNC Aasiya Amin DOEACC A-Levels Project2

    Scope Of The Project

  • 8/8/2019 Project Rpt Hospital

    9/106

    Goals To Be Achieved

    1. Automation (Computerization) of the system will save the unnecessary effort i.e it

    reduces paper work and maintains huge data with least efforts.

    2. The system has GUI thus completely user-friendly and easy to operate even by a

    nave or a parametric user.

    3. It reduces the probability of mistake occurrence which oftenly occur during data

    entry.

    4. User can access various types of information with in minutes with the help of

    computers.

    5. To store information of each and every person separately.

    6. To deliver particular patients information using queries and searching with the help

    of software.

    7. It lightens the burden of many employees in hospital and maintains the record of

    hospital in an ordered manner.

    8. Provision for generating various statistical reports.

    9. To provide patient details in an integrated manner so that all his information is

    connected thus reducing redundant data.

    10. To provide safe and secure data.

    CNC Aasiya Amin DOEACC A-Levels Project3

  • 8/8/2019 Project Rpt Hospital

    10/106

    Project Initiation Note

    Client: Gousia Hospital,

    Khanyar

    Near Ploice Station

    Project Name: CARE N CURE (CNC)

    Effort (person-months): 8 months Duration (Calendar days): 240days

    Quality Reviewer: Mr. Arshad Hussain

    Initiated by: Aasiya Amin Date:0707-2003

    CNC Aasiya Amin DOEACC A-Levels Project4

  • 8/8/2019 Project Rpt Hospital

    11/106

    Project Plan

    Title & scope of project

    Title: Care N Cure

    Scope: Automation of Hospital Management System.

    Project Code: 070-7-037

    Initial Activity: Project Plan

    Final activity: Project Walkthrough

    Client Details

    Client Name: Gousia Hospital.

    Address: Khanyar, Near Police Station.

    Outputs or deliverables for the project

    # Item Requirements Planned Date Actual Date

    1 Software 2 Copies 09-08-2003 11-03-2004

    2 Documents 2 Copy 21-08-2003 15-03-2004

    Resource requirements

    # Resource Name Why would you

    need the

    resource

    Where would you

    get the resource

    from

    How long would you need

    the resource

    1 H/w (A personal

    Computer

    having at

    least 200

    MHz

    processor,

    128 MB

    RAM and 1

    GB free

    Disk space,

    Windows

    based virus

    free, with a

    CD-RW

    Drive,

    preferable

    with a

    For

    construction

    of the system

    Personal Throughout the

    construction phase of

    the project as well as

    during the walkthrough

    CNC Aasiya Amin DOEACC A-Levels Project5

  • 8/8/2019 Project Rpt Hospital

    12/106

    # Resource Name Why would you

    need the

    resource

    Where would you

    get the resource

    from

    How long would you need

    the resource

    floppy

    drive)

    2 S/W (Microsoft

    Visual Studio.Net)

    For

    construction

    Personal Throughout the

    construction phase of

    the project as well as

    during the walkthrough

    3 MSDN Help For further

    reference and

    sample codes

    Personal Through-out the

    construction phase of

    the project

    4 Books on Visual

    Basic.Net, SQL,

    Microsoft Access

    For additional

    information

    Personal Through-out the

    construction phase of

    the project

    Risks identified in the project

    # Risk Probability(%)

    Severity(%)

    Action plan

    1 Defects in the

    end product

    due to

    problemsfaced during

    integration

    90 100 Discuss the problems that may be

    faced during integration with the

    Coordinator. Find out information about

    integrating different modules frombooks and MSDN help. In order to

    ensure that database connectivity

    information does not need to be

    changed on each and every form, create

    a single component that contains the

    connectivity information and use the

    same component in Windows Forms.

    2 Difference in

    standards

    followed, such

    as naming

    conventions

    80 15 Discuss the naming conventions with

    the Coordinator.

    Task List

    # Task

    1. Creating the database and database objects

    2. Creating the necessary reusable components and testing them

    3. Creating Windows forms

    4. Designing reports

    CNC Aasiya Amin DOEACC A-Levels Project6

  • 8/8/2019 Project Rpt Hospital

    13/106

    # Task

    5. Creating Help files

    CNC Aasiya Amin DOEACC A-Levels Project7

  • 8/8/2019 Project Rpt Hospital

    14/106

    System Development Life Cycle

    To developthis project, different models like prototyping, RAD, JAD etc. were looked

    at. It was decided to follow traditional waterfall or System Development Life Cycle.

    The reasons for using this model were many. Firstly this model is the one that is

    followed by the most. Therefore the success rate is high. Besides that having first

    hand experience in dealing with the existing system, there was more knowledge

    about user requirements. Hence not much need for user interaction.

    This is a traditional systems development method. It is five-step life cycle:

    1. Systems Planning2. Systems Analysis

    3. Systems Design

    4. Systems Implementation

    5. Systems Maintenance

    Planning

    CNC Aasiya Amin DOEACC A-Levels Project8

  • 8/8/2019 Project Rpt Hospital

    15/106

    The main objective of this phase is to clearly identify the problem (problem definition.

    A preliminary investigation report is produced at the end of this phase. A project can

    go ahead after this stage only when it is approved.

    Analysis

    This is fact-finding process. It involves gathering the facts and analyzing them to

    develop a specific plan, known as Systems Requirement Document. All the functions

    of the existing system are analyzed to recommend the necessary improvements.

    Design

    In this phase a design is developed which suits the requirements specified in the

    systems requirement documents. The design is documented and the end report,

    known as the design specification, is submitted to the client.

    Implementation

    During this phase, a complete system is developed and delivered. It involves a post

    implementation evaluation to make sure that the system is working properly.

    Maintenance

    Changes are made to fix the problems identified by the end users.

    CNC Aasiya Amin DOEACC A-Levels Project9

  • 8/8/2019 Project Rpt Hospital

    16/106

    Methods used for Maintenance and Evaluation

    Proper protocols will be followed to document the system and the findings. The reason

    for this is that it will help in tracking/ evaluating the system and will also be helpful in

    updating/ expanding or even maintaining the system.

    The methods that will be followed to document the system are:

    DFD

    ERD

    Structure Chart Module Specification

    Data Flow Diagram (DFD)

    Data flow diagrams represent the flow of data in a system. The four entities that must

    be represented in a DFD are:

    Data Flows Movement of data in the system

    Data Stores Data repositories for data that is not moving

    Processes Transforms of incoming data flow(s) to outgoing data flow(s)

    External Entities Sources or destinations outside the specified system

    boundary

    Data Flow External Entity Process Data Store Repository

    E-R Diagram

    The Entity Relationship (E-R) data model is based on a perception of a real world

    that consists of a collection of basic objects called entities and of relationships among

    these objects. An entity is a thing or object in the real world that is distinguishable

    from other objects e.g. each person is an entity, bank accounts can be considered to

    CNC Aasiya Amin DOEACC A-Levels Project10

  • 8/8/2019 Project Rpt Hospital

    17/106

    be entities. Entities are described in database by a set of attributes. A relationship is

    an association among several entities. The set of all entities of the same type and the

    set of all relationship are termed as an entity set and relationship set respectively.

    The overall structure of a database can be expressed graphically by an E-R diagram,

    which is built up from the following components:

    Rectangle which represents entity sets

    Ellipse which represents attributes

    Diamond which represents relationships among entity sets

    Lines which link attributes to entity sets and entity sets to

    relationships

    Rectangle Ellipse Diamond Line

    Structure Chart

    The three main features of structure chart are:

    1. The modules are shown in rectangular boxes.

    2. Arrowed lines represent the control relationships between modules.

    3. The communication between modules is shown by small arrows with a circle at

    the tail of the arrow shaft.

    Module Specification

    A module is a collection of program statements with three basic attributes:

    1. An input what it receives from the module that invokes it.

    2. An output what it returns to the module that invokes it.

    3. A function what is does to its input to produce its output.

    CNC Aasiya Amin DOEACC A-Levels Project11

  • 8/8/2019 Project Rpt Hospital

    18/106

    Development Environment

    Development Tool

    Since the System is to be developed for Windows platform, therefore, the best-suited

    development tool available is Microsoft Visual Basic 6.0. Data Management is done

    using Microsoft Access as well as Oracle SQL. The can be used both in Standalone

    Environment as well as in Network Environment. For that reason for users of

    Standalone System Microsoft Access is available and for users of Network

    Environment Oracle SQL is available.

    Data Access Technology

    We have vide range of Data Access Technologies available which are suitable for vide

    range of environments. But the most powerful technology available today is ActiveX

    Data Object (ADO) technology, which is meant for both standalone as well as network

    environment. Since Visual Basic has inbuilt support for ADO technology, so I am using

    this technology in the system.

    CNC Aasiya Amin DOEACC A-Levels Project12

  • 8/8/2019 Project Rpt Hospital

    19/106

    Data Flow Diagram

    Context Diagram

    CNC Aasiya Amin DOEACC A-Levels Project13

    Artist Input

    Banner Input

    Category Input

    Director Input

    Language Input

    Producer Input

    Raga Input

    Rec Company Input

    Remarks Input

    Song Type Input

    Type Input

    Lyrists Input

    Music Dir Input

    Details Entry:

    Title, Song, Album

    Search / Query

    Reports

    Artist

    Director

    Producer

    Music Dir

    Lyrists

    Rec Company

    Language

    Type

    Song Type

    Raga

    Category

    Banner

    Remarks

  • 8/8/2019 Project Rpt Hospital

    20/106

    Data Flow Diagram for Album, Title and Songs

    CNC Aasiya Amin DOEACC A-Levels Project14

    Input DataInput DataInput Data

    For Album

    Apply

    Validation

    Rules

    RetrieveRecords

    Input Data

    Validate Input

    Data

  • 8/8/2019 Project Rpt Hospital

    21/106

    Data Flow Diagram to Search a Song using Title as input

    CNC Aasiya Amin DOEACC A-Levels Project15

    Input TitleInput Title to

    Search

    Apply

    Validation

    Rules

    RetrieveRecords

    Data SourceGenerateReport

  • 8/8/2019 Project Rpt Hospital

    22/106

    E-R Diagram

    CNC Aasiya Amin DOEACC A-Levels Project16

    Album

    Album ID

    Station CodeCode

    RecordingCompany Year of

    Manufacture

    Album No

    Signatory

    No.

    Type

    Contain

    s

    Album Details

    Detail ID

    Banner Director

    Producer

    Name

    Film Based

    Product

    Year

    Album Content

    Song ID

    Song Type

    Approved

    Cut

    Side

    Duration

    Artist3

    Artist2

    Artist1

    Language

    First Line

    Category

    Remarks

    Music Dir

    Lyrists

    Raga

    Contain

    s

    1

    M

    1

    M

  • 8/8/2019 Project Rpt Hospital

    23/106

    Structure Chart

    CNC Aasiya Amin DOEACC A-Levels Project17

    Splash

    Main Window

    Login Dialog

    Navigation Window

    Data Entry

    Window

    Song Entry

    WindowReport

    Window

    Data Entry

    Window

    Song Entry

    Window

    Report

    Window

    Year-wise

    Song ReportWindow

    Choice

    Songs

    ReportWindow

    Selected

    Lyricist

    ReportWindow

    Film-wise

    Song ReportWindow

    Selected

    Composer

    ReportWindow

    Selected

    Singer

    ReportWindow

  • 8/8/2019 Project Rpt Hospital

    24/106

    Database Schema

    Patients

    Name Type Meaning

    CardNo Text Card No

    PtName Text Patients Name

    PtParentage Text Patients Parentage

    PtAddress Text Patients Address

    Age Text Patients Age

    Sex Text Patients Gender

    PtType Text Patients Type

    EDate Date Patients Entry Date

    AlbumContent

    Name Type Meaning

    SongID Number Song ID

    DetailID Number Detail ID

    FirstLine Text First Line of Song

    Category Text Category of Song

    Remarks Text Remarks about Song

    Raga Text Raga

    Language Text Language of Song

    Artist1 Text Artist # 1

    Artist2 Text Artist # 2

    Artist3 Text Artist # 3

    Lyrics Text Lyricists

    MusicDir Text Music Director

    Duration Number Duration of Song

    Side Text # Of Side

    Cut Number # Of Cuts

    Approved Text Approved or not

    SongType Text Type of Song

    AlbumDetails

    Name Type Meaning

    DetailID Number Detail ID

    AlbumID Number Album ID

    FilmBased Number Film Based or not

    Name Text Name of Album/Film

    Producer Text Producer

    Director Text Director

    Banner Text Under Banner of

    ProductYear Date Year of Production

    Artist

    Name Type Meaning

    ArtistIDNumber

    Artist ID

    ArtistName Text Name of Artist

    Banner

    Name Type Meaning

    BannerIDNumbe

    rBanner ID

    Banner Text Banner

    Category

    Name Type Meaning

    CategoryIDNumber

    Category ID

    Category Text Category of Song

    CNC Aasiya Amin DOEACC A-Levels Project18

  • 8/8/2019 Project Rpt Hospital

    25/106

  • 8/8/2019 Project Rpt Hospital

    26/106

    Test Report

    The application needs very little effort from the user to enter data, and hence avoids

    data entry mistakes to a large extent. I have used user-friendly controls as much as

    possible, such as, Combo Boxes, Check Boxes, Option Boxes, and Spinners etc. The

    field where date is to be entered, the user has to only select the date from the

    calendar attached with the date control. Lot of work is done through mouse. There is

    very less chance of Data Entry Errors.

    Following Table Lists down any possible Data Entry Errors from users end and way of

    rectification of the error.

    # Path Input Output Actual Result

    Form: Logon

    1. If a wrong user name and

    password is entered, an

    error message should be

    displayed

    Any invalid

    user name and

    password

    An error message An error

    message

    2. If in all 3 attempts a wrong

    user name and password isspecified, an error should

    be displayed and the

    application should be

    terminated.

    Any invalid

    user name andpassword,

    then click the

    Login button

    three times

    An error message in

    first two attempts.Third time, a

    message

    Unauthorized

    access. Aborting

    An error

    message in firsttwo attempts.

    Third time, a

    message

    Unauthorized

    access.

    Aborting

    3. If a valid user name and

    password is provided, it

    should display the

    Navigation Form

    User Name:

    Admin

    Password:

    Admin

    Navigation Form Navigation Form

    Form: Data Entry Album Form

    1. Enter invalid number for

    Album #, Album Code,

    Signatory # and Station

    Code

    Enter 12A in

    any of the

    Field and

    press Tab

    Error Invalid

    Data. Please Re-

    enter

    Error Invalid

    Data. Please Re-

    enter

    2. Enter valid number for

    Album#, Album Code,

    Signatory # and Station

    Code

    Enter 123 in

    any of Field

    and press Tab

    -- --

    Form: Data Enter Song Form

    1. Enter invalid Side # Enter A in Error Invalid Error Invalid

    CNC Aasiya Amin DOEACC A-Levels Project20

  • 8/8/2019 Project Rpt Hospital

    27/106

    # Path Input Output Actual Result

    Side field and

    press Tab

    Value for this

    Field

    Value for this

    Field

    2. Enter valid Side # Enter 2 in Side field and

    press Tab

    -- --

    Test Procedure Review

    # Areas of concern Result

    1. Test cases have been identified and listed with their expected

    results

    OK

    2. Acceptable criteria from expected results have been specified. OK

    3. Error handling has been tested. OK

    CNC Aasiya Amin DOEACC A-Levels Project21

  • 8/8/2019 Project Rpt Hospital

    28/106

    Program Listings

    The Database Script

    --Creating the Database

    create database ALMS

    go

    --Creating the Album Table

    create table Album (

    AlbumID number(4) primary key,

    STNCode char(7) not null,

    Code char(10) not null,

    Type char(3) not null,

    AlbumNo varchar2(10) not null,

    Year date,RecCompany varchar2(40),

    SignatoryNo varchar2(10) )

    go

    --Creating the AlbumDetail Table

    create table AlbumDetail (

    DetailID number(4) primary key,

    AlbumID number(4) references Album(AlbumID),

    FilmBased number(1) not null,

    Name varchar2(40),

    Producer varchar2(40),

    Director varchar2(40),Banner varchar2(40),

    ProductYear date )

    go

    --Creating the AlbumContent Table

    create table AlbumContent (

    SongID number(4) primary key,

    DetailID number(4) references AlbumDetail(DetailID),

    FirstLine varchar2(255),

    Category varchar2(30),

    Remarks varchar2(255),

    Raga varchar2(40),Language varchar2(40),

    Artist1 varchar2(40),

    Artist2 varchar2(40),

    Artist3 varchar2(40),

    Lyrics varchar2(40),

    MusicDir varchar2(40),

    Duration number(2),

    Side varchar2(12),

    Cut number(3),

    Approved varchar2(12),

    SongType varchar2(40) )

    go

    CNC Aasiya Amin DOEACC A-Levels Project22

  • 8/8/2019 Project Rpt Hospital

    29/106

  • 8/8/2019 Project Rpt Hospital

    30/106

    go

    --Creating the Producer Table

    create table Producer (

    ProducerID number(4) not null unique,

    Producer varchar2(40) )

    go

    --Creating the Raga Table

    create table Raga (

    RagaID number(4) not null unique,

    RagaDetails varchar2(40) )

    go

    --Creating the RecCompany Table

    create table RecCompany (

    RecCompID number(4) not null unique,

    RecCompany varchar2(40) )

    go

    --Creating the Remarks Table

    create table Remarks (

    RemarksID number(4) not null unique,

    Remarks varchar2(255) )

    go

    --Creating the SongType Table

    create table SongType (

    SongTypeID number(4) not null unique,

    SongType varchar2(40) )

    go

    --Creating the Type Table

    create table Type (

    Type varchar2(7) )

    go

    CNC Aasiya Amin DOEACC A-Levels Project24

  • 8/8/2019 Project Rpt Hospital

    31/106

    Project File:AudioLab.vbpThis file is the main Visual Basic Project File containing all modules. It includes14 Form Modules, One Standard Module and 3 Report Modules.Type=ExeReference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SYSTEM\stdole2.tlb#OLE AutomationReference=*\G{00000201-0000-0010-8000-00AA006D2EA4}#2.1#0#C:\PROGRAMFILES\COMMON FILES\SYSTEM\ADO\msado15.dll#Microsoft ActiveX Data Objects2.1 LibraryReference=*\G{78E93843-85FD-11D0-8487-00A0C90DC8A9}#1.0#0#C:\WINDOWS\SYSTEM\MSDBRPT.DLL#Microsoft Data ReportDesigner v6.0Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX

    Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCT2.OCXForm=Login.frmForm=ALMain.frmForm=ALTitle.frmModule=modALMain; modALMain.basForm=Dialog.frmForm=Main.frmForm=AddUser.frmForm=Album.frmForm=SongEntry.frmForm=TitleEntry.frmForm=ReportCentre.frmForm=SongSearchReport.frmForm=AlbumNavigator.frmDesigner=rptSongSearch.Dsr

    Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#C:\WINDOWS\SYSTEM\MSSTDFMT.DLL#Microsoft DataFormatting Object LibraryDesigner=rptFilmWise.DsrDesigner=rptGeneral.DsrForm=SongSearchFL.frmForm=About.frmObject={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCXIconForm="frmLogin"Startup="frmALTitle"HelpFile=""Command32=""Name="AudioLab"HelpContextID="0"

    CompatibleMode="0"MajorVer=1MinorVer=0RevisionVer=0AutoIncrementVer=0ServerSupportFiles=0VersionCompanyName="Aay Ech Enterprises"CompilationType=0OptimizationType=0FavorPentiumPro(tm)=0CodeViewDebugInfo=0NoAliasing=0BoundsCheck=0OverflowCheck=0FlPointCheck=0

    FDIVCheck=0

    CNC Aasiya Amin DOEACC A-Levels Project25

  • 8/8/2019 Project Rpt Hospital

    32/106

    UnroundedFP=0StartMode=0Unattended=0Retained=0ThreadPerObject=0

    MaxNumberOfThreads=1

    Main Form

    This is applications MDI Form, having a Menu Bar containing menus forperforming different tasks, a Toolbar containing Iconic buttons for commontasks and a Status bar showing status of various operations, messages, date,time etc. All the other forms are child form of this form.

    Main Form

    Form Properties

    Property Value

    Name ALMain

    Caption Audio Library Management System

    Controls used in the form

    Control for Control Type Properties Values

    Tool Bar Toolbar Name tbrAL

    To Show Status Statusbar Name stbAL

    Images for Toolbar ImageList Name imlAL

    To Provide On-line Help CommonDialog Name cdlgALHelp

    Code

    Private Sub MDIForm_Load()

    Dim i As Byte

    CNC Aasiya Amin DOEACC A-Levels Project26

  • 8/8/2019 Project Rpt Hospital

    33/106

    Me.Left = (Screen.Width - Me.Width) / 2

    Me.Top = (Screen.Height - Me.Height) / 2

    Me.mnuAlbum.Enabled = False

    For i = 1 To 11

    Me.tbrAL.Buttons(i).Enabled = False

    Next i

    blnLogin = False

    getConnection

    App.HelpFile = App.Path & "\ALMS Help.hlp"

    cdlgALHelp.HelpCommand = &H3&

    cdlgALHelp.HelpFile = App.Path & "\ALMS Help.hlp"

    End Sub

    Private Sub MDIForm_Resize()

    frmLogin.Left = (Me.ScaleWidth - frmLogin.Width) / 2

    frmLogin.Top = (Me.ScaleHeight - frmLogin.Height) / 2

    End Sub

    Private Sub mnuAlbumEntry_Click()

    frmAlbum.Show

    End Sub

    Private Sub mnuAlbumSongEntry_Click()

    On Error Resume Next

    frmSongEntry.Show

    End Sub

    Private Sub mnuAlbumTitleEntry_Click()

    frmTitleEntry.Show

    End Sub

    Private Sub mnuFileAddNewUser_Click()

    Dim rsTemp As New adodb.Recordset

    Dim strPass, strQuery As String

    strPass = InputBox("Enter Administrator's Password", "Checking

    CNC Aasiya Amin DOEACC A-Levels Project27

  • 8/8/2019 Project Rpt Hospital

    34/106

    Authorization...")

    If strPass "" Then

    strQuery = "Select * from Login where Username = 'Admin' and

    Password = " + "'" + strPass + "'"If rsTemp.State = adStateOpen Then rsTemp.Close

    rsTemp.Open strQuery, conAudioLib, adOpenKeyset,adLockPessimistic, adCmdText

    If rsTemp.RecordCount

  • 8/8/2019 Project Rpt Hospital

    35/106

    On Error GoTo errHandler

    Dim strKey As String

    strKey = Button.Key

    Select Case strKey

    Case "keyAlbumEntry": mnuAlbumEntry_Click

    Case "keyTitleEntry": mnuAlbumTitleEntry_Click

    Case "keySongEntry": mnuAlbumSongEntry_Click

    Case "keyReports": frmReportCentre.Show

    Case "keySongSearch": frmSongSearchReport.Show

    Case "keyNavigator": frmMain.Show

    Case "keyAddUser": mnuFileAddNewUser_Click

    Case "keyExit":

    Do While Not Me.ActiveForm Is Nothing

    Unload Me.ActiveForm

    Loop

    End

    End Select

    Exit Sub

    errHandler:

    MsgBox "Unable to open"

    End Sub

    Login Form

    This form accepts user name and password and provides option for type ofdatabase to use. Only valid user can move forward from this window. LoginForm also provides list of built-in users also called Application System Usersuch as Admin, Guest and Super user. The other users are automatically addedto the list after first use.

    Login Form

    Form Properties

    Property Value

    Name frmLogin

    Caption Authentication Check

    BorderStyle Fixed

    CNC Aasiya Amin DOEACC A-Levels Project29

  • 8/8/2019 Project Rpt Hospital

    36/106

    MDIChild True

    Controls used in the form

    Control for Control Type Properties Values

    Database Option 1 OptionButton Name

    Caption

    Value

    optAccess

    Microsoft Access

    True

    Database Option 2 OptionButton Name

    Caption

    optOracle

    Oracle SQL

    User Name ComboBox Name cmbUserName

    Password TextBox Name

    PasswordChar

    txtPassword

    _

    OK CommandButton Name

    Caption

    Default

    cmdOK

    &OK

    True

    Cancel CommandButton Name

    Caption

    Cancel

    cmdCancel

    &Cancel

    True

    Code

    Private Sub cmdCancel_Click()

    Unload Me

    End Sub

    Private Sub cmdOK_Click()

    On Error Resume Next

    Dim strQuery As String

    Dim rsLogin As New adodb.Recordset

    Dim i As Byte

    If Me.optOracle.Value = True Then strProvider = "ORACLE"

    If txtPassword.Text = "" Or cmbUserName.Text = "" Then

    MsgBox "Please provide Username and Password",vbInformation, "Incomplete info...."

    Exit Sub

    End If

    CNC Aasiya Amin DOEACC A-Levels Project30

  • 8/8/2019 Project Rpt Hospital

    37/106

    strQuery = "Select * from Login where Username = "

    strQuery = strQuery + "'" + cmbUserName.Text + "' and Password= '"

    strQuery = strQuery + txtPassword.Text + "'"If rsLogin.State = adStateOpen Then rsLogin.Close

    rsLogin.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic, adCmdText

    If rsLogin.RecordCount

  • 8/8/2019 Project Rpt Hospital

    38/106

    End If

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub Form_Load()

    On Error Resume Next

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    strProvider = "ACCESS"

    Me.optAccess.Value = True

    Me.optOracle.Value = False

    End Sub

    Private Sub optAccess_Click()

    strProvider = "ACCESS"

    End Sub

    Private Sub optOracle_Click()

    MsgBox "This facility is available in ALMSNet version" & vbCrLf& "You can't use this option in the current version", _

    vbOKOnly + vbInformation, "Not provided"

    'strProvider = "ORACLE"

    optAccess.Value = True

    End Sub

    Main Navigation Form

    This form provides Iconic Buttons to access different section of Application,such as, Data Entry, Song Search, Report Generation.

    CNC Aasiya Amin DOEACC A-Levels Project32

  • 8/8/2019 Project Rpt Hospital

    39/106

    Main Navigation Form

    Form Properties

    Property Value

    Name frmMain

    Caption Navigator

    BorderStyle Fixed Single

    MDIChild True

    KeyPreview True

    Controls used in the form

    Control for Control Type Properties Values

    Data Entry Label

    Image

    Name

    Caption

    Name

    lblDataEntry

    &Data Entry

    imgMain1

    Song Search Label

    Image

    Name

    Caption

    Name

    lblSongSearch

    &Song Search

    imgMain2

    Report Label

    Image

    Name

    Caption

    Name

    lblReport

    &Report

    imgMain3

    Exit Label

    Image

    Name

    Caption

    Name

    lblExit

    E&xit

    imgMain4

    Image Mouse Up Image Picture Mouse Up Picture

    Image Mouse Down Image Picture Mouse Down Picture

    CNC Aasiya Amin DOEACC A-Levels Project33

  • 8/8/2019 Project Rpt Hospital

    40/106

    Code

    Dim intLeft As IntegerDim intDiff As IntegerDim blnForward As Boolean

    Dim blnReverse As BooleanPrivate Sub Form_KeyPress(KeyAscii As Integer)

    Select Case Chr(KeyAscii)

    Case "D", "d"

    imgMain1_Click

    Case "S", "s"

    imgMain2_Click

    Case "R", "r"

    imgMain3_Click

    Case "X", "x"

    imgMain4_Click

    End Select

    If KeyAscii = vbKeyEscape Then Unload Me

    End Sub

    Private Sub Form_Load()

    blnForward = True

    blnReverse = False

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    lblTitle1.Left = (Me.ScaleWidth - lblTitle1.Width) / 2

    lblTitle2.Left = (Me.ScaleWidth - lblTitle2.Width) / 2

    Shape1.Left = (Me.ScaleWidth - Shape1.Width) / 2

    Shape2.Left = (Me.ScaleWidth - Shape2.Width) / 2

    lblByArshad.Left = Shape2.Left

    intDiff = Shape2.Width - Shape1.Width

    intLeft = Shape2.Left

    imgMain1.Picture = imgUp.Picture

    imgMain2.Picture = imgUp.Picture

    imgMain3.Picture = imgUp.Picture

    imgMain4.Picture = imgUp.Picture

    End Sub

    'This form's DATA ENTRY button

    '/////////////////////////////

    Private Sub imgMain1_Click()

    Load frmAlbumNavigator

    CNC Aasiya Amin DOEACC A-Levels Project34

  • 8/8/2019 Project Rpt Hospital

    41/106

    frmAlbumNavigator.Show

    Unload Me

    End Sub

    Private Sub imgMain1_MouseDown(Button As Integer, Shift AsInteger, X As Single, Y As Single)

    imgMain1.Picture = imgDn.Picture

    End Sub

    Private Sub imgMain1_MouseUp(Button As Integer, Shift As Integer,X As Single, Y As Single)

    imgMain1.Picture = imgUp.Picture

    End Sub

    '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    'This form's SONG SEARCH button

    '///////////////////////////////

    Private Sub imgMain2_Click()

    Load frmSongSearchFL

    frmSongSearchFL.Show vbModal, ALMain

    End Sub

    Private Sub imgMain2_MouseDown(Button As Integer, Shift AsInteger, X As Single, Y As Single)

    imgMain2.Picture = imgDn.Picture

    End Sub

    Private Sub imgMain2_MouseUp(Button As Integer, Shift As Integer,X As Single, Y As Single)

    imgMain2.Picture = imgUp.Picture

    End Sub'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    'This form's REPORT button'///////////////////////////////Private Sub imgMain3_Click()

    On Error GoTo errHandler

    Load frmReportCentre

    frmReportCentre.Show

    Unload Me

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub imgMain3_MouseDown(Button As Integer, Shift AsInteger, X As Single, Y As Single)

    imgMain3.Picture = imgDn.Picture

    CNC Aasiya Amin DOEACC A-Levels Project35

  • 8/8/2019 Project Rpt Hospital

    42/106

    End Sub

    Private Sub imgMain3_MouseUp(Button As Integer, Shift As Integer,X As Single, Y As Single)

    imgMain3.Picture = imgUp.PictureEnd Sub'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    'This form's EXIT button

    '////////////////////////////////Private Sub imgMain4_Click()

    Do While Not ALMain.ActiveForm Is Nothing

    Unload ALMain.ActiveForm

    Loop

    End

    End Sub

    Private Sub imgMain4_MouseDown(Button As Integer, Shift AsInteger, X As Single, Y As Single)

    imgMain4.Picture = imgDn.Picture

    End Sub

    Private Sub imgMain4_MouseUp(Button As Integer, Shift As Integer,X As Single, Y As Single)

    imgMain4.Picture = imgUp.Picture

    End Sub

    '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Private Sub tmrAnimate_Timer()

    If blnForward Then

    Shape2.Left = Shape2.Left + 50

    lblByArshad.Left = lblByArshad.Left + 50

    Else

    Shape2.Left = Shape2.Left - 50

    lblByArshad.Left = lblByArshad.Left - 50

    End If

    If Shape2.Left > Shape1.Left + intDiff + 500 Then

    blnForward = False

    blnReverse = True

    End If

    If Shape2.Left < intLeft - intDiff - 500 Then

    blnForward = True

    blnReverse = False

    End If

    End Sub

    CNC Aasiya Amin DOEACC A-Levels Project36

  • 8/8/2019 Project Rpt Hospital

    43/106

    Album Navigation Form

    This form provides Iconic Buttons to access different Album Data Entry formsto enter data. Data gets validated before saving in the database. Data Entry toTwo-Column Tables is provided by ellipses () with respective fields.

    Album Navigation Form

    Form Properties

    Property Value

    Name frmAlbumNavigator

    Caption Album Navigator

    BorderStyle Fixed Single

    MDIChild True

    KeyPreview True

    Controls used in the form

    Control for Control Type Properties Values

    Album Entry CommandButton

    Label

    Name

    Caption

    cmdAlbumEntry

    &Album Entry

    Title Entry CommandButton

    Label

    Name

    Caption

    cmdTitleEntry

    &Title Entry

    Song Entry CommandButton

    Label

    Name

    Caption

    cmdSongEntry

    &Song Entry

    To Navigator CommandButton

    Label

    Name

    Caption

    cmdNavigator

    To &Navigator

    Code

    CNC Aasiya Amin DOEACC A-Levels Project37

  • 8/8/2019 Project Rpt Hospital

    44/106

    Private Sub cmdAlbumEntry_Click()

    On Error GoTo errHandler

    Load frmAlbum

    frmAlbum.Show

    Unload Me

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdNavigator_Click()

    On Error GoTo errHandler

    Load frmMain

    frmMain.Show

    Unload Me

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdSongEntry_Click()On Error GoTo errHandler

    Load frmSongEntry

    frmSongEntry.Show

    Unload Me

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdTitleEntry_Click()

    On Error GoTo errHandler

    Load frmTitleEntry

    frmTitleEntry.Show

    Unload Me

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    CNC Aasiya Amin DOEACC A-Levels Project38

  • 8/8/2019 Project Rpt Hospital

    45/106

    End Sub

    Private Sub Form_KeyPress(KeyAscii As Integer)

    Select Case Chr(KeyAscii)

    Case "A", "a"

    cmdAlbumEntry_Click

    Case "T", "t"

    cmdTitleEntry_Click

    Case "S", "s"

    cmdSongEntry_Click

    Case "N", "n"

    cmdNavigator_Click

    End Select

    End Sub

    Private Sub Form_Load()

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    lblTitle1.Left = (Me.ScaleWidth - lblTitle1.Width) / 2

    lblTitle2.Left = (Me.ScaleWidth - lblTitle2.Width) / 2

    End Sub

    Data Entry for Album Form (1)

    This form provides interface to enter data for Album.

    Data Entry for Album Form

    Form Properties

    CNC Aasiya Amin DOEACC A-Levels Project39

  • 8/8/2019 Project Rpt Hospital

    46/106

    Property Value

    Name frmAlbum

    Caption Data Entry for Album

    BorderStyle Fixed Single

    MDIChild True

    Controls used in the form

    Control for Control Type Properties Values

    Album Type ComboBox Name cmbAlbumType

    Album # Text Box Name txtAlbumNo

    Album Code TextBox Name txtAlbumCode

    Recording Company ComboBox

    Image

    Name

    Name

    cmbRecCompany

    imgRecCompany

    Year of Release DTPicker Name txtYear

    Signatory # TextBox Name txtSigNo

    Station Code TextBox Name txtStationCode

    Code

    Dim rsRec As adodb.Recordset

    Dim rsAlbum As adodb.Recordset

    Private Sub cmdAdd_Click()

    On Error GoTo errHandler

    cmdAdd.Enabled = False

    cmdSave.Enabled = True

    cmdCancel.Enabled = True

    cmdEdit.Enabled = False

    cmdDelete.Enabled = False

    rsAlbum.AddNew

    ClearControls

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbInformation, "Error..."

    Resume Next

    End Sub

    CNC Aasiya Amin DOEACC A-Levels Project40

  • 8/8/2019 Project Rpt Hospital

    47/106

  • 8/8/2019 Project Rpt Hospital

    48/106

    strQuery = "Delete * from AlbumContent where DetailID= " + CStr(intDetailID)

    conAudioLib.Execute strQuery

    LoopEnd If

    'Deleting all related records from AlbumDetail Table

    strQuery = "Delete * from AlbumDetail where AlbumID = " +CStr(intAlbumID)

    conAudioLib.Execute strQuery

    strQuery = "Delete from Album where AlbumID = " +CStr(intAlbumID)

    'Deleting current record from Album Table

    conAudioLib.Execute strQuery

    rsAlbum.MoveNext

    If rs_album.EOF Then

    rsAlbum.MoveLast

    Display

    Else

    Display

    End If

    End If

    If rsTemp.State = adStateOpen ThenrsTemp.Close

    End If

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbInformation, "Error..."

    End Sub

    Private Sub cmdEdit_Click()

    cmdAdd.Enabled = False

    cmdSave.Enabled = True

    cmdCancel.Enabled = True

    cmdDelete.Enabled = False

    End Sub

    Private Sub cmdExit_Click()

    Load frmAlbumNavigator

    frmAlbumNavigator.Show

    CNC Aasiya Amin DOEACC A-Levels Project42

  • 8/8/2019 Project Rpt Hospital

    49/106

    Unload Me

    End Sub

    Private Sub cmdFirst_Click()

    On Error GoTo errHandler

    rsAlbum.MoveFirst

    Display

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbInformation, "Error..."

    End Sub

    Private Sub cmdLast_Click()

    On Error GoTo errHandler

    rsAlbum.MoveLast

    Display

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbInformation, "Error..."

    End Sub

    Private Sub cmdNext_Click()

    On Error GoTo errHandler

    rsAlbum.MoveNext

    If rsAlbum.EOF Then rsAlbum.MoveLast

    Display

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbInformation, "Error..."

    End Sub

    Private Sub cmdPrevious_Click()

    On Error GoTo errHandler

    rsAlbum.MovePrevious

    If rsAlbum.BOF Then rsAlbum.MoveFirst

    Display

    Exit Sub

    errHandler:

    CNC Aasiya Amin DOEACC A-Levels Project43

  • 8/8/2019 Project Rpt Hospital

    50/106

    MsgBox Err.Description, vbInformation, "Error..."

    End Sub

    Private Sub cmdSave_Click()

    On Error GoTo errHandler

    cmdSave.Enabled = False

    cmdCancel.Enabled = False

    cmdAdd.Enabled = True

    cmdDelete.Enabled = True

    cmdEdit.Enabled = True

    SaveAlbum

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbInformation, "Error..."

    Resume Next

    End Sub

    Private Sub Form_Activate()

    cmdAdd.SetFocus

    End Sub

    Private Sub Form_Load()

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    lblTitle.Left = (Me.ScaleWidth - lblTitle.Width) / 2

    'This procedure will set the intial settings for the ALbum form

    'Get the module level function to get the connection to thedatabase

    On Error GoTo errHandler

    getConnection

    Set rsRec = New adodb.Recordset

    Set rsAlbum = New adodb.Recordset

    rsRec.Open "RecCompany", conAudioLib, adOpenKeyset,adLockPessimistic, adCmdTable

    rsAlbum.Open "Select * from Album Order by AlbumID",conAudioLib, adOpenKeyset, adLockPessimistic, adCmdText

    If rsAlbum.RecordCount > 0 Then

    rsAlbum.MoveFirst

    Display

    CNC Aasiya Amin DOEACC A-Levels Project44

  • 8/8/2019 Project Rpt Hospital

    51/106

    End If

    If rsRec.RecordCount > 0 Then

    Dim i As Integer

    rsRec.MoveFirst

    For i = 1 To rsRec.RecordCount

    cmbRecCompany.AddItem rsRec!RecCompany

    rsRec.MoveNext

    Next i

    End If

    rsRec.MoveFirst

    'Adding Values to the Combo box cmbAlbumType

    cmbAlbumType.AddItem "LP"

    cmbAlbumType.AddItem "CD"

    cmbAlbumType.AddItem "SP"

    cmbAlbumType.AddItem "78R"

    cmdCancel.Enabled = False

    cmdSave.Enabled = False

    errHandler:

    End Sub

    Private Sub Form_Unload(Cancel As Integer)If rsRec.State = adStateOpen Then

    rsRec.Close

    End If

    If rsAlbum.State = adStateOpen Then

    rsAlbum.Close

    End If

    End Sub

    Private Sub imgRecCompany_Click()

    cmbRecCompany.Text = addNewData("recCompany", "recCompID")

    End Sub

    Private Sub Display()

    cmbAlbumType.Text = rsAlbum!Type & ""

    txtAlbumNo.Text = rsAlbum!AlbumNo & ""

    txtAlbumCode.Text = rsAlbum!Code & ""

    txtYear.Value = rsAlbum!Year

    CNC Aasiya Amin DOEACC A-Levels Project45

  • 8/8/2019 Project Rpt Hospital

    52/106

    cmbRecCompany.Text = rsAlbum!RecCompany & ""

    txtStationCode.Text = rsAlbum!STNCode & ""

    txtSigNo.Text = rsAlbum!SignatoryNo & ""

    End Sub

    Private Sub SaveAlbum()

    Dim intAlbumID As Integer

    Dim rsTemp As New adodb.Recordset

    rsTemp.Open "Select AlbumID from Album Order by AlbumID", _

    conAudioLib, adOpenKeyset, adLockOptimistic, adCmdText

    If rsTemp.RecordCount > 0 Then

    rsTemp.MoveLast

    intAlbumID = rsTemp!AlbumID + 1

    Else

    intAlbumID = 1

    End If

    On Error GoTo errHandler

    rsAlbum!AlbumID = intAlbumID

    rsAlbum!Type = cmbAlbumType.Text

    rsAlbum!AlbumNo = txtAlbumNo.Text

    rsAlbum!Code = txtAlbumCode.TextrsAlbum!Year = txtYear.Value

    rsAlbum!RecCompany = cmbRecCompany.Text

    rsAlbum!STNCode = txtStationCode.Text

    rsAlbum!SignatoryNo = txtSigNo.Text

    rsAlbum.Update

    Exit Sub

    errHandler:

    Resume Next

    MsgBox Err.Description, vbInformation, "ALert"

    rsAlbum.CancelUpdate

    End Sub

    Private Sub Clear()

    txtAlbumNo.Text = ""

    cmbAlbumType.Text = ""

    cmbRecCompany.Text = ""

    txtYear.Value = Date

    CNC Aasiya Amin DOEACC A-Levels Project46

  • 8/8/2019 Project Rpt Hospital

    53/106

    txtAlbumCode.Text = ""

    txtSigNo.Text = ""

    txtStationCode.Text = ""

    cmbAlbumType.SetFocus

    End Sub

    Private Sub txtAlbumCode_Validate(Cancel As Boolean)

    If txtAlbumCode.Text = "" Then

    MsgBox "Album Code Required. You can't leave it blank!",vbInformation, "Incomplete..."

    Cancel = True

    End If

    Cancel = False

    End Sub

    Title Entry Form.(2)

    This form provides interface to enter titles.

    Title Entry Form

    Form Properties

    Property Value

    Name frmTitleEntry

    Caption Enter Titles

    BorderStyle Fixed Single

    MDIChild True

    Controls used in the form

    CNC Aasiya Amin DOEACC A-Levels Project47

  • 8/8/2019 Project Rpt Hospital

    54/106

    Control for Control Type Properties Values

    Album # ComboBox Name cmbAlbumNo

    Album Code ComboBox Name cmbAlbumCode

    Title ComboBox Name cmbTitle

    Producer ComboBox

    Image

    Name

    Name

    cmbProducer

    imgProducer

    Banner ComboBox

    Image

    Name

    Name

    cmbBanner

    imgBanner

    Director ComboBox

    Image

    Name

    Name

    cmbDirector

    imgDirector

    Year of Production DTPicker Name txtYear

    Film Based CheckBox Name

    Caption

    chkFilmBased

    Film Based

    Code

    Dim rsAlbum As adodb.Recordset

    Dim rsTemp As adodb.Recordset

    Dim rsAlbumDetail As adodb.Recordset

    Dim intAlbumID As Integer

    Dim strStationCode As String

    Private Sub cmbAlbumNo_LostFocus()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim rsTemp1 As New adodb.Recordset

    cmbAlbumCode.ListIndex = cmbAlbumNo.ListIndex

    strQuery = "Select * from Album where Code = "

    strQuery = strQuery + "'" + Trim(cmbAlbumCode.Text) + "'"

    strQuery = strQuery + " AND AlbumNo = "

    strQuery = strQuery + "'" + cmbAlbumNo.Text + "'"

    Debug.Print strQuery

    rsTemp.Open strQuery, conAudioLib, adOpenStatic,adLockReadOnly, adCmdText

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    intAlbumID = rsTemp!AlbumID

    strStationCode = rsTemp!STNCode

    CNC Aasiya Amin DOEACC A-Levels Project48

  • 8/8/2019 Project Rpt Hospital

    55/106

  • 8/8/2019 Project Rpt Hospital

    56/106

    ClearControls

    cmbTitle.SetFocus

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdCancel_Click()

    On Error GoTo errHandler

    cmdCancel.Enabled = False

    cmdSave.Enabled = False

    cmdAdd.Enabled = True

    cmdDelete.Enabled = True

    cmdEdit.Enabled = True

    rsAlbumDetail.CancelUpdate

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdDelete_Click()On Error GoTo errHandler

    Dim intAns As Integer

    Dim intDetailID As Integer

    Dim strQuery As String

    intAns = MsgBox("Deleting the Album Title will delete " _

    + vbCrLf + " all Songs under this Title" _

    + vbCrLf + "Do you want to Proceed (Y/N)", _

    vbInformation + vbYesNo, "Deleting Records...")

    If intAns = vbYes Then

    If rsAlbumDetail.EOF And rsAlbumDetail.BOF Then

    MsgBox "There are no Titles under Album No" + _

    cmbAlbumNo.Text + vbCrLf + _

    "To Add New Titles Click Add Button", _

    vbInformation, "Alert..."

    Exit Sub

    End If

    CNC Aasiya Amin DOEACC A-Levels Project50

  • 8/8/2019 Project Rpt Hospital

    57/106

  • 8/8/2019 Project Rpt Hospital

    58/106

    Private Sub cmdExit_Click()

    On Error GoTo errHandler

    Load frmAlbumNavigator

    frmAlbumNavigator.Show

    Unload Me

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdFirst_Click()

    On Error GoTo errHandler

    If Not (rsAlbumDetail.BOF And rsAlbumDetail.EOF) Then

    rsAlbumDetail.MoveFirst

    DisplayRecords

    End If

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdLast_Click()

    On Error GoTo errHandler

    If Not (rsAlbumDetail.BOF And rsAlbumDetail.EOF) Then

    rsAlbumDetail.MoveLast

    DisplayRecords

    End If

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdNext_Click()

    On Error GoTo errHandler

    If Not (rsAlbumDetail.BOF And rsAlbumDetail.EOF) Then

    rsAlbumDetail.MoveNext

    If rsAlbumDetail.EOF Then

    CNC Aasiya Amin DOEACC A-Levels Project52

  • 8/8/2019 Project Rpt Hospital

    59/106

    rsAlbumDetail.MoveLast

    Exit Sub

    End If

    DisplayRecords

    End If

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdPrevious_Click()

    On Error GoTo errHandler

    If Not (rsAlbumDetail.BOF And rsAlbumDetail.EOF) Then

    rsAlbumDetail.MovePrevious

    If rsAlbumDetail.BOF Then

    rsAlbumDetail.MoveFirst

    Exit Sub

    End If

    DisplayRecords

    End If

    Exit SuberrHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdSave_Click()

    On Error GoTo errHandler

    cmdSave.Enabled = False

    cmdCancel.Enabled = False

    cmdAdd.Enabled = True

    cmdDelete.Enabled = True

    cmdEdit.Enabled = True

    SaveTitle

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    CNC Aasiya Amin DOEACC A-Levels Project53

  • 8/8/2019 Project Rpt Hospital

    60/106

    Private Sub Form_Load()

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    lblTitleHead.Left = (Me.ScaleWidth - lblTitleHead.Width) / 2

    On Error Resume Next

    cmdCancel.Enabled = False

    cmdSave.Enabled = False

    'Connecting to DataBase

    getConnection

    Set rsAlbum = New adodb.Recordset

    Set rsTemp = New adodb.Recordset

    Set rsAlbumDetail = New adodb.Recordset

    rsAlbum.Open "Album", conAudioLib, adOpenKeyset, adLockReadOnly

    If Not (rsAlbum.EOF And rsAlbum.BOF) Then

    rsAlbum.MoveFirst

    Do While Not rsAlbum.EOF

    cmbAlbumNo.AddItem rsAlbum!AlbumNo

    cmbAlbumCode.AddItem rsAlbum!Code

    rsAlbum.MoveNext

    Loop

    rsAlbum.MoveFirst

    cmbAlbumNo.Text = rsAlbum!AlbumNo & ""

    cmbAlbumCode.Text = rsAlbum!Code & ""

    End If

    'Filling Producer combo box

    rsTemp.Open "Producer", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbProducer.AddItem rsTemp!Producer & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    CNC Aasiya Amin DOEACC A-Levels Project54

  • 8/8/2019 Project Rpt Hospital

    61/106

    rsTemp.Close

    End If

    End If

    'Filling Banner combo box

    rsTemp.Open "Banner", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbBanner.AddItem rsTemp!Banner & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    'Filling Director combo box

    rsTemp.Open "Director", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbDirector.AddItem rsTemp!Director & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    DisplayRecords

    End Sub

    Private Sub imgBanner_Click()

    On Error GoTo errHandler

    cmbBanner.Text = addNewData("Banner", "BannerID")

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    CNC Aasiya Amin DOEACC A-Levels Project55

  • 8/8/2019 Project Rpt Hospital

    62/106

    Private Sub imgDirector_Click()

    On Error GoTo errHandler

    cmbDirector.Text = addNewData("Director", "DirectorID")

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub imgProducer_Click()

    On Error GoTo errHandler

    cmbProducer.Text = addNewData("Producer", "ProducerID")

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub ClearControls()

    On Error GoTo errHandler

    cmbTitle.Text = ""

    cmbProducer.Text = ""

    cmbBanner.Text = ""

    cmbDirector.Text = ""

    txtYear.Value = Date

    chkFilmBased.Value = 0

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Public Sub SaveTitle()

    On Error GoTo errHandler

    Dim intDetailID As Integer

    Dim rsTemp As New adodb.Recordset

    rsTemp.Open "Select DetailID from AlbumDetail Order byDetailID", _

    conAudioLib, adOpenKeyset, adLockOptimistic, adCmdText

    CNC Aasiya Amin DOEACC A-Levels Project56

  • 8/8/2019 Project Rpt Hospital

    63/106

    If rsTemp.RecordCount > 0 Then

    rsTemp.MoveLast

    intDetailID = rsTemp!detailid + 1

    Else

    intDetailID = 1

    End If

    If rsTemp.State = adStateOpen Then

    rsTemp.Close

    End If

    rsAlbumDetail!detailid = intDetailID

    rsAlbumDetail!Banner = cmbBanner.Text

    rsAlbumDetail!Director = cmbDirector.Text

    rsAlbumDetail!Producer = cmbProducer.Text

    rsAlbumDetail!AlbumID = intAlbumID

    rsAlbumDetail!FilmBased = chkFilmBased.Value

    rsAlbumDetail!Name = Trim(cmbTitle.Text)

    rsAlbumDetail!ProductYear = txtYear.Value

    rsAlbumDetail.Update

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."End Sub

    Private Sub DisplayRecords()

    On Error GoTo errHandler

    cmbBanner.Text = rsAlbumDetail!Banner & ""

    cmbProducer.Text = rsAlbumDetail!Producer & ""

    cmbDirector.Text = rsAlbumDetail!Director & ""

    chkFilmBased.Value = rsAlbumDetail!FilmBased

    cmbTitle.Text = rsAlbumDetail!Name

    txtYear.Value = rsAlbumDetail!ProductYear

    Exit Sub

    errHandler:

    ClearControls

    cmbTitle.SetFocus

    End Sub

    Private Sub tmrTitle_Timer()

    CNC Aasiya Amin DOEACC A-Levels Project57

  • 8/8/2019 Project Rpt Hospital

    64/106

    On Error GoTo errHandler

    Dim strMsg As String

    strMsg = "Enter Album Titles For Album Number :" &

    cmbAlbumNo.TextALMain.stbAL.Panels(1).Text = strMsg & ", Album Code : " &

    cmbAlbumCode.Text

    Exit Sub

    errHandler:

    MsgBox Err.Description, vbOKOnly + vbInformation, "Error..."

    End Sub

    Song Entry Form.(3)

    This form provides interface to enter songs for tiles / films.

    Song Entry Form

    Form Properties

    Property Value

    Name frmSongEntry

    Caption Songs for Titles/Films

    BorderStyle Fixed Single

    MDIChild True

    Controls used in the form

    Control for Control Type Properties Values

    Album Title ComboBox Name cmbAlbumTitle

    Song ComboBox Name cmbSong

    CNC Aasiya Amin DOEACC A-Levels Project58

  • 8/8/2019 Project Rpt Hospital

    65/106

  • 8/8/2019 Project Rpt Hospital

    66/106

    strQuery = "Select * from AlbumDetail where Name = "

    strQuery = strQuery + "'" + cmbAlbumTitle.Text + "'"

    rsTemp.Open strQuery, conAudioLib, adOpenStatic,adLockReadOnly, adCmdText

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    intDetailID = rsTemp!detailid

    strQuery = "Select * from AlbumContent where DetailID = "

    strQuery = strQuery + CStr(intDetailID)

    If Not rsSong.Source = "" Then

    rsSong.Close

    End If

    rsSong.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic, adCmdText

    cmbSong.Clear

    If Not (rsSong.EOF And rsSong.BOF) Then

    Do While Not rsSong.EOF

    cmbSong.AddItem rsSong!FirstLine

    rsSong.MoveNext

    Loop

    rsSong.MoveFirst

    DisplaySong

    End If

    End If

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmbSongType_LostFocus()

    On Error GoTo errHandler

    Dim strSongType As String

    Dim i As Integer

    'Finding if the value is present in Song type table, if

    'the value is not there then insert it in recCompany table

    strSongType = Trim(cmbSongType.Text)

    For i = 0 To cmbSongType.ListCount - 1

    If strSongType = cmbSongType.List(i) Then

    Exit Sub

    CNC Aasiya Amin DOEACC A-Levels Project60

  • 8/8/2019 Project Rpt Hospital

    67/106

    End If

    Next i

    conAudioLib.Execute "Insert into SongType(SongType) values ('"

    + cmbSongType.Text + "')"Exit Sub

    errHandler:

    End Sub

    Private Sub cmdAdd_Click()

    On Error GoTo errHandler

    cmdAdd.Enabled = False

    cmdSave.Enabled = True

    cmdCancel.Enabled = True

    cmdEdit.Enabled = False

    cmdDelete.Enabled = False

    ClearControls

    rsTempSong.AddNew

    cmbSong.SetFocus

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdCancel_Click()

    On Error GoTo errHandler

    cmdCancel.Enabled = False

    cmdSave.Enabled = False

    cmdAdd.Enabled = True

    cmdDelete.Enabled = True

    cmdEdit.Enabled = True

    rsSong.CancelUpdate

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdDelete_Click()

    On Error GoTo errHandler

    If Not (rsSong.EOF And rsSong.BOF) Then

    rsSong.Delete

    CNC Aasiya Amin DOEACC A-Levels Project61

  • 8/8/2019 Project Rpt Hospital

    68/106

    rsSong.MoveNext

    If Not rsSong.EOF Then

    DisplaySong

    Exit Sub

    Else

    rsSong.MovePrevious

    DisplaySong

    Exit Sub

    End If

    Else

    ClearControls

    End If

    ClearControls

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdEdit_Click()

    cmdAdd.Enabled = False

    cmdSave.Enabled = True

    cmdCancel.Enabled = TruecmdDelete.Enabled = False

    End Sub

    Private Sub cmdExit_Click()

    On Error GoTo errHandler

    Load frmAlbumNavigator

    frmAlbumNavigator.Show

    Unload Me

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdFirst_Click()

    On Error GoTo errHandler

    If Not (rsSong.BOF And rsSong.EOF) Then

    rsSong.MoveFirst

    DisplaySong

    CNC Aasiya Amin DOEACC A-Levels Project62

  • 8/8/2019 Project Rpt Hospital

    69/106

    End If

    errHandler:

    End Sub

    Private Sub cmdLast_Click()

    On Error GoTo errHandler

    If Not (rsSong.BOF And rsSong.EOF) Then

    rsSong.MoveLast

    DisplaySong

    End If

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdNext_Click()

    On Error GoTo errHandler

    If Not (rsSong.BOF And rsSong.EOF) Then

    rsSong.MoveNext

    If rsSong.EOF Then

    rsSong.MoveLast

    Exit SubEnd If

    DisplaySong

    End If

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdPrevious_Click()

    On Error GoTo errHandler

    If Not (rsSong.BOF And rsSong.EOF) Then

    rsSong.MovePrevious

    If rsSong.BOF Then

    rsSong.MoveFirst

    Exit Sub

    End If

    DisplaySong

    End If

    CNC Aasiya Amin DOEACC A-Levels Project63

  • 8/8/2019 Project Rpt Hospital

    70/106

    Exit Sub

    errHandler:

    End Sub

    Private Sub cmdSave_Click()

    On Error GoTo errHandler

    cmdSave.Enabled = False

    cmdCancel.Enabled = False

    cmdAdd.Enabled = True

    cmdDelete.Enabled = True

    cmdEdit.Enabled = True

    SaveSong

    Exit Sub

    errHandler:

    End Sub

    Private Sub Form_Activate()

    On Error GoTo errHandler

    ClearControls

    cmbAlbumTitle.SetFocus

    Exit SuberrHandler:

    End Sub

    Private Sub Form_Load()

    Dim rsTemp As New adodb.Recordset

    Dim rsTempSongType As New adodb.Recordset

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    lblTitle.Left = (Me.ScaleWidth - lblTitle.Width) / 2

    On Error GoTo errHandler

    Set rsSong = New adodb.Recordset

    Set rsTempSong = New adodb.Recordset

    getConnection

    cmdSave.Enabled = False

    cmdCancel.Enabled = False

    CNC Aasiya Amin DOEACC A-Levels Project64

  • 8/8/2019 Project Rpt Hospital

    71/106

    rsTempSong.Open "AlbumContent", conAudioLib, adOpenKeyset,adLockPessimistic, adCmdTable

    rsTemp.Open "Select Name from AlbumDetail", conAudioLib,adOpenStatic, adLockReadOnly

    If rsTemp.EOF And rsTemp.BOF Then

    MsgBox "There are no Titles." & vbCrLf & "Go to Title EntryFirst", vbCritical, "Alert..."

    Unload Me

    Exit Sub

    End If

    DoEvents

    Do While Not rsTemp.EOF

    cmbAlbumTitle.AddItem rsTemp!Name

    rsTemp.MoveNext

    Loop

    cmbAlbumTitle.ListIndex = 0

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    'Displaying records in SongType comboBox

    rsTempSongType.Open "Select * from SongType", conAudioLib,adOpenKeyset, adLockOptimistic

    Do While Not rsTempSongType.EOF

    cmbSongType.AddItem rsTempSongType!SongType & ""

    rsTempSongType.MoveNext

    Loop

    'Displaying records in Category combo box

    rsTemp.Open "Category", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    DoEvents

    Do While Not rsTemp.EOF

    cmbCategory.AddItem rsTemp!Category & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    CNC Aasiya Amin DOEACC A-Levels Project65

  • 8/8/2019 Project Rpt Hospital

    72/106

    End If

    End If

    'Filling Music Director combo box

    rsTemp.Open "MusicDir", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    DoEvents

    Do While Not rsTemp.EOF

    cmbMusicDir.AddItem rsTemp!MusicDir & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    'Filling Raga combo box

    rsTemp.Open "Raga", conAudioLib, adOpenStatic, adLockReadOnly,adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbRaga.AddItem rsTemp!RagaDetails & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    'Filling Artist1,2,3 combo boxes

    rsTemp.Open "Artist", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbArtist1.AddItem rsTemp!ArtistName & ""

    CNC Aasiya Amin DOEACC A-Levels Project66

  • 8/8/2019 Project Rpt Hospital

    73/106

    cmbArtist2.AddItem rsTemp!ArtistName & ""

    cmbArtist3.AddItem rsTemp!ArtistName & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    'Filling Lyrics combo box

    rsTemp.Open "Lyrics", conAudioLib, adOpenStatic,adLockReadOnly, adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbLyricist.AddItem rsTemp!Lyrics & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    'Filling Language combo box

    rsTemp.Open "Lang", conAudioLib, adOpenStatic, adLockReadOnly,adCmdTable

    If Not (rsTemp.EOF And rsTemp.BOF) Then

    rsTemp.MoveFirst

    Do While Not rsTemp.EOF

    cmbLanguage.AddItem rsTemp!Language & ""

    rsTemp.MoveNext

    Loop

    If Not rsTemp.Source = "" Then

    rsTemp.Close

    End If

    End If

    Exit Sub

    errHandler:

    MsgBox "Connection Error: " & Err.Description, , "Error..."

    CNC Aasiya Amin DOEACC A-Levels Project67

  • 8/8/2019 Project Rpt Hospital

    74/106

  • 8/8/2019 Project Rpt Hospital

    75/106

  • 8/8/2019 Project Rpt Hospital

    76/106

    End If

    rsTempSong!SongID = intSongID

    rsTempSong!detailid = intDetailID

    rsTempSong!FirstLine = cmbSong.Text

    If Not txtDuration.Text = "" Then

    rsTempSong!Duration = CInt(txtDuration.Text)

    End If

    If Not txtCut.Text = "" Then

    rsTempSong!Cut = CInt(txtCut.Text)

    End If

    rsTempSong!Side = Trim(txtSide.Text)

    rsTempSong!Remarks = Trim(txtRemarks.Text)

    rsTempSong!Category = Trim(cmbCategory.Text)

    rsTempSong!Raga = Trim(cmbRaga.Text)

    rsTempSong!Language = Trim(cmbLanguage.Text)

    rsTempSong!Artist1 = Trim(cmbArtist1.Text)

    rsTempSong!Artist2 = Trim(cmbArtist2.Text)

    rsTempSong!Artist3 = Trim(cmbArtist3.Text)

    rsTempSong!Lyrics = Trim(cmbLyricist.Text)

    rsTempSong!MusicDir = Trim(cmbMusicDir.Text)rsTempSong!SongType = Trim(cmbSongType.Text)

    rsTempSong.Update

    Exit Sub

    errHandler:

    MsgBox Err.Description, , "Error..."

    End Sub

    Private Sub txtCut_Validate(Cancel As Boolean)

    On Error GoTo errHandler

    If Not IsNumeric(txtCut.Text) Then

    MsgBox "Please Enter only numeric values", vbInformation,"Alert..."

    udCut.Value = 0

    Cancel = True

    Else

    Cancel = False

    End If

    Exit Sub

    CNC Aasiya Amin DOEACC A-Levels Project70

  • 8/8/2019 Project Rpt Hospital

    77/106

    errHandler:

    End Sub

    Private Sub txtDuration_Validate(Cancel As Boolean)

    If Not IsNumeric(txtDuration.Text) Then

    MsgBox "Please Enter only numeric values", vbInformation,"Alert..."

    udDuration.Value = 0

    Cancel = True

    Else

    Cancel = False

    End If

    End Sub

    Public Sub DisplaySong()

    On Error GoTo errHandler

    If Not (rsSong.BOF And rsSong.BOF) Then

    cmbSong.Text = rsSong!FirstLine & ""

    cmbCategory.Text = rsSong!Category & ""

    cmbLanguage.Text = rsSong!Language & ""

    cmbLyricist.Text = rsSong!Lyrics & ""

    cmbRaga.Text = rsSong!Raga & ""

    cmbArtist1.Text = rsSong!Artist1 & ""

    cmbArtist2.Text = rsSong!Artist2 & ""

    cmbArtist3.Text = rsSong!Artist3 & ""

    cmbMusicDir.Text = rsSong!MusicDir & ""

    txtRemarks.Text = rsSong!Remark & ""

    txtDuration.Text = rsSong!Duration

    txtSide.Text = rsSong!Side & ""

    txtCut.Text = rsSong!Cut

    cmbSongType.Text = rsSong!SongType & ""

    Else

    ClearControls

    End If

    Exit Sub

    errHandler:

    txtDuration.Text = ""

    Resume Next

    End Sub

    CNC Aasiya Amin DOEACC A-Levels Project71

  • 8/8/2019 Project Rpt Hospital

    78/106

    Common Controls used in the form (1) to (3) above

    Control for Control Type Properties Values

    First Record CommandButton Name cmdFirst

    Previous Record CommandButton Name cmdPrevious

    Next Record CommandButton Name cmdNext

    Last Record CommandButton Name cmdLast

    Add New Record CommandButton Name cmdAdd

    Delete Current Record CommandButton Name cmdDelete

    Edit Current Record CommandButton Name cmdEdit

    Save Current Record CommandButton Name cmdSave

    Cancel Last Changes CommandButton Name cmdCancel

    To Exit CommandButton Name

    Cancel

    cmdExit

    True

    Song Search By First Line Form

    This form is displayed when Song Search option in Main Navigator Form isselected by clicking. First Line of the song to search can be typed or selectedfrom the list.

    Song Search By First Line Form

    CNC Aasiya Amin DOEACC A-Levels Project72

  • 8/8/2019 Project Rpt Hospital

    79/106

    Form Properties

    Property Value

    Name frmSongSearchFL

    Caption Song Search by First Line

    BorderStyle Fixed Single

    Controls used in the form

    Control for Control Type Properties Values

    First Line of Song ComboBox Name cmbFirstLine

    OK CommandButton Name

    Default

    cmdOK

    True

    Cancel CommandButton Name

    Cancel

    cmdCancel

    True

    Code

    Private Sub cmdCancel_Click()

    Unload Me

    End Sub

    Private Sub cmdOK_Click()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim strFirstLine As String

    strFirstLine = cmbFirstLine.Text

    If strFirstLine = "" Then

    Exit SubEnd If

    strQuery = "Select Code, Name, Firstline, Artist1, Artist2 from"

    strQuery = strQuery & " Album, AlbumDetail, AlbumContent "

    strQuery = strQuery & " where Album.AlbumID =AlbumDetail.AlbumID "

    strQuery = strQuery & " And AlbumDetail.DetailID =AlbumContent.DetailID "

    strQuery = strQuery & " And AlbumContent.Firstline in "

    strQuery = strQuery & " (Select Distinct AlbumContent.FirstLine

    CNC Aasiya Amin DOEACC A-Levels Project73

  • 8/8/2019 Project Rpt Hospital

    80/106

    from AlbumContent "

    strQuery = strQuery & " Where FirstLine Like '" & strFirstLine& "%')"

    rsSongSearch.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic

    Set rptSongSearch.DataSource = rsSongSearch

    If rsSongSearch.RecordCount

  • 8/8/2019 Project Rpt Hospital

    81/106

    Report Centre Form

    This form provides option to generate Reports for print outs in different sixways.

    Report Centre Form

    Form Properties

    Property Value

    Name frmReportCentre

    Caption Reporting Centre

    BorderStyle Fixed Single

    MDIChild True

    Controls used in the form

    Control for Control Type Properties Values

    Year-wise Report CommandButton Name cmdYearWise

    Selected Lyricist Report CommandButton Name cmdSelLyricist

    Film-wise Report CommandButton Name cmdFileWise

    Selected Composer Report CommandButton Name cmdSelComposer

    Selected Singer Report CommandButton Name cmdSelSinger

    Choice Songs Report CommandButton Name cmdChoice

    To Navigator CommandButton Name cmdNavigator

    CNC Aasiya Amin DOEACC A-Levels Project75

  • 8/8/2019 Project Rpt Hospital

    82/106

    Code

    Private Sub cmdChoice_Click()

    frmSongSearchReport.Show

    Unload Me

    End Sub

    Private Sub cmdFilmWise_Click()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim strFilmName As String

    Dim lblFilmName1 As RptLabel

    Dim lblFilmName2 As RptLabel

    strReportCaption = "Films"

    Set rsSongSearch = New adodb.Recordset

    strFilmName = showDialog("Enter Film Name", "AlbumDetail","Name")

    If strFilmName = "" Then

    Exit Sub

    Else

    strQuery = "Select Album.Code, AlbumDetail.Name,

    AlbumContent.FirstLine, "

    strQuery = strQuery & "AlbumContent.Artist1,AlbumContent.Artist2 From "

    strQuery = strQuery & "(Album INNER JOIN AlbumDetail ONAlbum.AlbumID = AlbumDetail.AlbumID) "

    strQuery = strQuery & "INNER JOIN AlbumContent OnAlbumDetail.DetailID = AlbumContent.DetailID "

    strQuery = strQuery & "Where AlbumDetail.Name = '" &strFilmName & "'"

    rsSongSearch.Open strQuery, conAudioLib, adOpenKeyset,

    adLockOptimisticSet rptFilmWise.DataSource = rsSongSearch

    Set lblFilmName1 = rptFilmWise.Sections(2).Controls(1)

    lblFilmName1.Caption = "Film Name : "

    Set lblFilmName2 = rptFilmWise.Sections(2).Controls(2)

    lblFilmName2.Caption = strFilmName

    rptFilmWise.Show

    End If

    Exit Sub

    errHandler:

    CNC Aasiya Amin DOEACC A-Levels Project76

  • 8/8/2019 Project Rpt Hospital

    83/106

    MsgBox Err.Description & vbCrLf & "No Songs Matched", vbOKOnly+ vbInformation, "Error..."

    End Sub

    Private Sub cmdNavigator_Click()

    Load frmMain

    frmMain.Show

    Unload Me

    End Sub

    Private Sub cmdSelComposer_Click()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim strComposerName As String

    Dim lblComposerName1 As RptLabel

    Dim lblComposerName2 As RptLabel

    strReportCaption = "Composers"

    Set rsSongSearch = New adodb.Recordset

    strComposerName = showDialog("Select Composer Name","MusicDir", "MusicDir")

    If strComposerName = "" Then

    Exit Sub

    Else

    strQuery = "Select Album.Code, AlbumDetail.Name,AlbumContent.MusicDir, "

    strQuery = strQuery & "AlbumContent.FirstLine,AlbumContent.Artist1, "

    strQuery = strQuery & "AlbumContent.Artist2 From "

    strQuery = strQuery & "(Album INNER JOIN AlbumDetail ONAlbum.AlbumID = AlbumDetail.AlbumID) "

    strQuery = strQuery & "INNER JOIN Albumcontent ONAlbumDetail.DetailID = AlbumContent.DetailID "

    strQuery = strQuery & "Where (((AlbumContent.MusicDir)='" &strComposerName & "'))"

    rsSongSearch.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic

    Set rptSongSearch.DataSource = rsSongSearch

    Set lblComposerName1 = rptSongSearch.Sections(2).Controls(6)

    lblComposerName1.Caption = "Composer Name : "

    Set lblComposerName2 = rptSongSearch.Sections(2).Controls(7)

    CNC Aasiya Amin DOEACC A-Levels Project77

  • 8/8/2019 Project Rpt Hospital

    84/106

    lblComposerName2.Caption = strComposerName

    rptSongSearch.Show

    End If

    Exit Sub

    errHandler:

    MsgBox "No Songs Matched", vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdSelLyricist_Click()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim strLyricName As String

    Dim lblLyricName1 As RptLabel

    Dim lblLyricName2 As RptLabel

    strReportCaption = "Lyricists"

    Set rsSongSearch = New adodb.Recordset

    strLyricName = showDialog("Select Lyrcist Name", "Lyrics","Lyrics")

    If strLyricName = "" Then

    Exit Sub

    Else

    strQuery = "Select Album.Code, AlbumDetail.Name,AlbumContent.Lyrics, "

    strQuery = strQuery & "AlbumContent.FirstLine,AlbumContent.Artist1, AlbumContent.Artist2 "

    strQuery = strQuery & "From (Album INNER JOIN AlbumDetail ONAlbum.AlbumID = AlbumDetail.AlbumID) "

    strQuery = strQuery & "INNER JOIN AlbumContent ONAlbumDetail.DetailID = AlbumContent.DetailID "

    strQuery = strQuery & "Where AlbumContent.Lyrics = '" &strLyricName & "'"

    rsSongSearch.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic

    Set rptSongSearch.DataSource = rsSongSearch

    Set lblLyricName1 = rptSongSearch.Sections(2).Controls(6)

    lblLyricName1.Caption = "Lyricist : "

    Set lblLyricName2 = rptSongSearch.Sections(2).Controls(7)

    lblLyricName2.Caption = strLyricName

    rptSongSearch.Show

    End If

    CNC Aasiya Amin DOEACC A-Levels Project78

  • 8/8/2019 Project Rpt Hospital

    85/106

    Exit Sub

    errHandler:

    MsgBox "No Songs Matched", vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdSelSinger_Click()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim strSinger As String

    Dim lblSinger1 As RptLabel

    Dim lblSinger2 As RptLabel

    strReportCaption = "Singers"

    Set rsSongSearch = New adodb.Recordset

    strSinger = showDialog("Select Singer Name", "Artist","ArtistName")

    If strSinger = "" Then

    Exit Sub

    Else

    strQuery = "Select Album.Code, AlbumDetail.Name,AlbumContent.FirstLine, "

    strQuery = strQuery & "AlbumContent.Artist1,AlbumContent.Artist2, AlbumContent.Artist3 "

    strQuery = strQuery & "From (Album INNER JOIN AlbumDetail ONAlbum.AlbumID = AlbumDetail.AlbumID) "

    strQuery = strQuery & "INNER JOIN AlbumContent ONAlbumDetail.DetailID = AlbumContent.DetailID "

    strQuery = strQuery & "Where (AlbumContent.Artist1 = '" &strSinger & "') OR "

    strQuery = strQuery & "(AlbumContent.Artist2 = '" &strSinger & "') OR "

    strQuery = strQuery & "(AlbumContent.Artist3 = '" &strSinger & "')"

    rsSongSearch.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic

    Set rptGeneral.DataSource = rsSongSearch

    Set lblSinger1 = rptGeneral.Sections(2).Controls(1)

    lblSinger1.Caption = "Singer Name : "

    Set lblSinger2 = rptGeneral.Sections(2).Controls(2)

    lblSinger2.Caption = strSinger

    rptGeneral.Show

    CNC Aasiya Amin DOEACC A-Levels Project79

  • 8/8/2019 Project Rpt Hospital

    86/106

    End If

    Exit Sub

    errHandler:

    MsgBox "No Songs Matched", vbOKOnly + vbInformation, "Error..."

    End Sub

    Private Sub cmdYearWise_Click()

    On Error GoTo errHandler

    Dim strQuery As String

    Dim strYear As String

    Dim lblYear1 As RptLabel

    Dim lblYear2 As RptLabel

    Dim strCurYear As String

    strReportCaption = "Years"

    Set rsSongSearch = New adodb.Recordset

    strCurYear = Right(Format(Date, "Long Date"), 4)

    Do While True

    strYear = InputBox(vbCrLf & "Enter the Year" _

    & vbCrLf & vbCrLf & _

    "Year should be a 4-digit integer", _"Year-Wise Report", strCurYear)

    If strYear = "" Then

    Exit Sub

    ElseIf Not IsNumeric(strYear) Then

    MsgBox "Wrong value for Year, Enter Year as 4 digitInteger", , "Wrong Year"

    ElseIf Len(strYear) 4 Then

    MsgBox "Not a valid Year" & vbCrLf & "Enter Year as 4digit Integer", , "Wrong Year"

    Else

    Exit Do

    End If

    Loop

    strQuery = "Select Album.Code, AlbumDetail.Name,AlbumDetail.ProductYear, "

    strQuery = strQuery & "AlbumContent.FirstLine,AlbumContent.Artist1, AlbumContent.Artist2 "

    strQuery = strQuery & "From (Album INNER JOIN AlbumDetail ON

    CNC Aasiya Amin DOEACC A-Levels Project80

  • 8/8/2019 Project Rpt Hospital

    87/106

    Album.AlbumID = AlbumDetail.AlbumID) "

    strQuery = strQuery & "INNER JOIN AlbumContent ONAlbumDetail.DetailID = AlbumContent.DetailID "

    strQuery = strQuery & "Where (AlbumDetail.ProductYear Between "

    If strProvider = "QRACLE" Then

    strQuery = strQuery & "'1/1/" & strYear & "' "

    strQuery = strQuery & "AND '30/12/" & strYear & "')"

    Else

    strQuery = strQuery & "#1/1/" & strYear & "# "

    strQuery = strQuery & "AND #30/12/" & strYear & "#)"

    End If

    rsSongSearch.Open strQuery, conAudioLib, adOpenKeyset,adLockOptimistic

    Set rptGeneral.DataSource = rsSongSearch

    Set lblYear1 = rptGeneral.Sections(2).Controls(1)

    lblYear1.Caption = "Song's of Year : "

    Set lblYear2 = rptGeneral.Sections(2).Controls(2)

    lblYear2.Caption = strYear

    rptGeneral.Show

    cmdYearWise.SetFocus

    Exit Sub

    errHandler:

    MsgBox "No Songs Matched", vbOKOnly + vbInformation,"Error..."

    End Sub

    Private Sub Form_KeyPress(KeyAscii As Integer)

    Select Case Chr(KeyAscii)

    Case "Y", "y"

    cmdYearWise_Click

    Case "L", "l"

    cmdSelLyricist_Click

    Case "F", "f"

    cmdFilmWise_Click

    Case "C", "c"

    cmdSelComposer_Click

    Case "S", "s"

    cmdSelSinger_Click

    CNC Aasiya Amin DOEACC A-Levels Project81

  • 8/8/2019 Project Rpt Hospital

    88/106

    Case "O", "o"

    cmdChoice_Click

    Case "N", "n"

    cmdNavigator_Click

    End Select

    End Sub

    Private Sub Form_Load()

    Me.Left = (ALMain.ScaleWidth - Me.Width) / 2

    Me.Top = (ALMain.ScaleHeight - Me.Height) / 2

    lblTitle1.Left = (Me.ScaleWidth - lblTitle1.Width) / 2

    lblTitle2.Left = (Me.ScaleWidth - lblTitle2.Width) / 2

    getConnection

    End Sub

    General Dialog Form

    This Dialog Form provides interface to enter search data for retrieving recordfrom database for further processing at form levels especially for generatingReports. The Caption and Label of the form gets changed according to context.

    General Dialog Form

    Form Properties

    Property Value

    Name frmDialog

    Caption

    BorderStyle Fixed Single

    Controls used in the form

    Control for Control Type Properties Values

    Entering Text ComboBox Name cmbGeneral

    OK CommandButton Name

    Default

    cmdOK

    True

    Cancel CommandButton Name

    Cancel

    cmdCancel

    True

    CNC Aasiya Amin DOEACC A-Levels Project82

  • 8/8/2019 Project Rpt Hospital

    89/106

    Code

    Private Sub cmdCancel_Click()

    strSearchValue = ""

    Unload Me

    End Sub

    Private Sub cmdOK_Click()

    strSearchValue = cmbGeneral.Text

    Unload Me

    End Sub

    Private Sub Form_Load()

    Me.Left = (ALMain.ActiveForm.Width - Me.Width) / 2 +ALMain.ActiveForm.Left

    Me.Top = (ALMain.ActiveForm.Top + ALMain.ActiveForm.Height)

    End Sub

    Favorite Song Search Form

    This form provides option to generate Reports of favorite Songs. It provides sixdifferent categories of songs to choose from.

    Favorite Song Search Form

    Form Properties

    Property Value

    Name frmSongSearchReport

    Caption Search for Favorite Songs

    BorderStyle Fixed Single

    MDIChil