Professional Documents
Culture Documents
ON
SUBMITTED TO
Department of Computer Science
SUBMITTED TO
SUBMITTED BY
SHRI PAL
SUNDER SINGH
SUBMITTED AT
I would like to take this opportunity to express my gratitude towards all the people who have
in various ways, helped in the successful completion of my project.
I must convey my gratitude to Mr. PRAMOD SHARMA for giving us the constant source
of inspiration and help in preparing the project, personally correcting my work and providing
encouragement throughout the project.
I also thank all my faculty members for steering me through the tough as well as easy phases
of the project in a result oriented manner with concern attention.
DATE: 11-09-2008
SHRI PAL
SUNDER SINGH
We are the student of BCA 6TH SEM SHRI RAM COLLEGE MUZAFFARNAGAR
(AFFILATED TO C.C.S UNIVERSITY MEERUT). Here by declare that the project report on
GAS AGENCY MANAGEMENT SYSTEM is our original work.
We also declare that have done our work self accurately even then if over mistake or error
had kept in. We request to our faculties to points out these error and guide our to remove these error
for our future. We are also thankful for our faculties.
SHRI PAL
SUNDER SINGH
This is to certify that the Project Report titled Gas Agency Management System is the
bona fide project work carried out by Mr. students of BCA, SHRI RAM COLLEGE,
Muzaffarnagar during the year 2009, in partial fulfillment of the requirements for the award of the
Degree of Bachelor of Computer Application and that the project report has not formed the basic for
the award previously of any degree, diploma or any other similar title.
Place: MUZAFFARNAGAR
Date:
07/05/2009
BIBLOGRAPHY
GAS
AGENCY
MANAGEMENT
SYSTEM
All these and other transactions and features have been described in detail in the following section.
1.1
1.2
1.2.1
Minimize repetitive work done by the system administrator and booking clerks.
1.2.2
Maintain consistency among different access modes, e.g. by phone, at the information desk
and across different physical locations. The users should be basically taken through the same
steps by the system as they go through in conventional desk-reservation systems.
1.2.3
Maintain customer information in case of mistake, e.g. gas booking due to inclement weather.
The profile can also be used by the gas agency to track user preferences
1.2.4
1.2.4.1 Increase awareness among many gas agency about various special offers by which they can
save more much time.
1.2.4.2 Minimize the number of gas booking and maximize gas delivery utilization.
1.2.4.3 Maintain the capability to adopt a flexible pricing policy. The price of the gas should be
dynamically determined based on how early, before the date of departure, the customer buys
the gas.
1.3
A survey conducted by gas companies shows that users of an existing delivery system would
respond favorably to an TGS that satisfied or helped them satisfy the following objectives:
1.3.1
Reduce effort and frustration for deliveries in scheduling cylinders, especially by reducing the
search effort for the cylinders they need to take.
1.3.2
Show all possible combinations and itineraries available for a pair of origin-destination cities.
1.3.3
Reduce redundancy in the information required from the customers in order for them to take
cylinder, create user accounts etc.
1.3.4
Check the validity of input data and give a feedback to the user in case of errors or
inconsistency.
1.3.5
1.3.6
1.3.7
Make it easy for delivery to check the cylinder status or make changes to their delivery.
The definition of our problem lies in manual system and a fully automated system.
Manual system:
The system is very time consuming and lazy. This system is more prone to errors and sometimes the
approach to various problems is unstructured.
Technical system:
With the advent of latest technology if we do not update our system then our business result in losses
gradually with time. The technical systems contains the tools of latest trend i.e. computers printers,
fax, Internet etc. The systems with this technology are very fast, accurate, user-friendly and reliable..
Need of gas management system
A few factors that direct us to develop a new system are given below -:
1) Faster System
2) Accuracy
3) Reliability
4) Informative
5) Delivery and updating of the employee and customer.
Delivery
Updation
a) Economical
b) Technical
c) Duration
Economical:This study about the software basically give the suggestion like if we develop software for our
organization than how much it will forfeitable, workable as well as economical. If we developing a
software which very economical but not profitable there it is also wrong decision. Still we have
economical study about the system table following of the point.
How much costing of the software?
What is the output of the customization?
What are the advantages in compression manual we check
Whether it is time or not?
Whether it is use friendly or not?
It is mountable for long term.
Understanding about the software
Corrective of software.
BOOKING DEPARTMENT
Booking
customer list
CUSTOMER
Data Storage
Passenger List,
Delivery
GAS
AGENCY
MANAGEME
NT SYSTEM
Data Access
Fleet info
Updating, Request
For enquiry
Fare details
REPORTS
gas
In developing cost estimates for a system, we need to consider servable cost elements. Among them
hardware, personnel, facility, operating, & supply costs.
Hardware Cost:Hardware cost relate to the actual purchase or lease of the computer & peripherals Ex. Printer, disk,
floppy drive, the best way to control for this cost is to treat it as an operating cost.
Personnel Cost:This includes staff salaries & benefits (health insurance, vocation time, sick pay etc.) as well as pay
for those involved in developing system. Costs incurred during the development of a system are one
time costs & are labeled developmental costs. Once the system is installed the costs of operating
&maintaining the system become recurring costs.
Facility Costs:Facility costs are expenses incurred in the preparation of the physical site where the application or the
computer will be i operation. This includes wiring, flooring, acoustics, lighting & air conditioning.
These costs are treated as one time costs.
Operating Cost:Operating costs include all costs associated with the day to day operating system. The amount
depends on the number of sifts the nature of the application & the caliber of the operating staff. There
are various ways of covering operating costs to overhead. Another approach is to change each
authorized user for the amount of processing they request from the system. The amount charged is
based on the computer time, staff time & the volume of output produced.
Supply Cost:These costs are variable costs that increase with increased use of paper, ribbon, disks & the like they
should be estimated & include in the overall cost of the system.
Equipment Cost:Equipment costs include rental & annual deprecation of any equipment such as typewriter, copies,
computer terminals & microcomputers used in connection with the system. Other costs associated
with the equipment, such as insurance & maintenance should also be included.
SYSTEM:A system can be defined as A set of arrangement of elements that are organized to
accomplish some method, procedure or control by processing information.
System Analysis stages down the broad frame work of strategy stage into its minute details.
This is the stage where intensive user interaction assumes a lot of importance.
SYSTEM DEVELOPMENT:Development Phase, translates a set of requirements into an operational system that we call
Software. At early stages of hardware development a hardware engineer does not reach for a
soldering iron, similarly the Software engineer should not reach the compiler. Design is accomplished
first.
The first phase of development concentrates on design. The design phase for software with a
description of architecture and data design. That is a modular structure is developed first, interfaces
are defined and data structure is established. Design criteria are used for the assessment of quality.
This preliminary design step is reviewed for completeness and tractability to software requirements.
Procedural aspects of each modular component of the software design are considered next,
and is following by the CODING the generation of program using an appropriate programming
language or CASE tool occurs after the design is complete. Software engineering methodology
views coding as a consequence of good design. Code is then reviewed for style and clarity, but should
otherwise be directly traceable to a detailed design description.
DETAILED ENTITY RELATIONSHIP DIAGRAM :Identification of all the Entities of importance for which data need to be stored and defined
their relationship with each other was a major task at this level. All the identified entities were
mapped on a E-R-diagram. It is of utmost importance to cover all the necessary entities and defined
their relationship with each other correctly because any errors at this stage would result in the
reworking in the further stages.
Unique Identification, UID:A unique identification is required to be identified and associated with each other at this stage.
Function Hierarchy:Function hierarchy is used for grouping related functions under a parent function. The
hierarchy is balanced so that all elementary functions come in the same level of hierarchy. A good
hierarchy drawn at this stage helped in menu generation at a later stage.
The Basic Objective:The basic objective of the system design was the system being developed should be able to fit
into the existing system, that is it become a part of the system and it should not lead to any changes
which can adversely affect the existing system. The airways having many activities which affect one
another so the approach of airways reservation is generated for the simplification of data handling.
The approach would bring in the following benefits:
Completely menu drive interface with the provision of initiating even the batch jobs by the user
himself.
On Line help
Strong documentation
Designing is the most important part of the software development. It requires a careful
planning and logical thinking on the system designer. Designing a software means to plan how the
various parts of the software are going to achieve the desired goal. It should done with the utmost
care because if this phase contains any errors then that will be going to affect the performance of the
system, as a result it may take more processing time, more coding, extra work load etc.
As the software is to be designed in ORACLE RDBMS, the concept of the database is must
for quality designing. It will be designing of the database, designing of forms, designing of reports.
Separate tables have been created for each entity of the system. In order to make the response
time negligible, all the tables have been created in the Memory File System. Moreover indexes have
been created on the tables in the number of records have been made random.
The design stages takes the final specification of the system from the analysis stages and finds
the best way of fulfilling them, given the technical environment and previous decision on required
level of automation
The system design is carried out in two phases: Architectural Design
Detailed Design
ARCHITECTURAL DESIGN:The high level design maps the business system described in the program requirement
specification to logical data structure, it involves:
Identification of the entities that constitutes the system:All the entities related to the module were identified, checked and consolidated
Identifying the Relationships:The relationships between the entities, within and outside the system were identified.
Attribute definition:The pertaining of the entities was identified and their field characteristics were specified.
Normalization:-
The entities were normalization, after first and the second normalization was achieved for all the
entities.
Interface:Interface with the other systems were done and attributes related to external entities identified.
DETAILED DESIGN:The low level design maps the logical model of the system to a physical database design.
Table Mapping:The Table was created for the system using the design view, which is the part of the ORACLE.
This has provision to create the entities and attributes into the Tables. The name of the entity is
taken as the table name.
Default Database Design:In ORACLE we can create tables through the queries and some command. The tables divide into
two parts. These names are as follow: ROWS
COLUMNS
The steps involved here were:-
1. Generation of table
2. Check Validation Rule
3. Check Validation Text
4. Primary Keys
5. Unique Keys
6. Foreign Keys
Relationship:ORACLE allows many types of relationship between the tables. These relationship names are as
follow: One to One Relationship
Program specifications:The program specifications were written for the master, transactions, reports and queries. The
logic for each field, block and form were written so that anyone who does not know the system will
be able to code the logic. Field validations and user-friendly error messages were written as part of
the program specification.
Withend with
If.then.else
Visual Basic helps of creation Menus, Master-Details Form.
During system testing, the system is used experimentally to ensure that the software does not
fall, i.e. it will run according to specification and in the way users expect. Special test data input for
processing and the result examination. A limited number of users may be allowed to use the system
so that analysis can see whether they use it in unforeseen ways. It is preferable to discover any
surprises the organization implements the system and encounters them later on. This type of testing
which allows only a few, selected users to work on the system is known as BETA TESTING. On the
other hand the testing done by the developer (s), themselves is known as ALPHA TESTING.
Testing is generally performed by persons other than those who the original programs to
ensure complete and unbiased testing and more reliable software.
The norms followed during the testing phase were thoroughly tested by me, the developer; I
was required to release the programs source code. The source code was copied into the area. If some
changes were desired in the program, I was suitably informed and was required to make the necessary
modifications.
Following testing procedures were used
UNIT TESTING
Unit testing is the testing of a single program module in an isolated environment. The
testing of the processing procedure is the main focus. In this regard, all the modules were separately
tested first as isolated and complete entities. This helped a lot in discovering problems related to a
single module and rectifying them in the contest of the module itself, rather than considering modulerelated problem in a global context.
INTEGRATION TESTING
Integration testing is the process of testing the interfaces among system modules. Some
testing ensures that data moves between systems as intended. In the regard of a particular module was
obtained in correct format, so that the next module could accept it appropriately. This could be done
either after the entire system was developed, or in stages than one module was developed.
SYSTEM TESTING
System testing is the testing of the system against its initial objectives. Such testing is
done either in a simulated environment or in a live environment.
In the case of the system which I developed, the testing was done in a pseudo-real
environment. The organization has an area called the Development , where all development work
is carried out, whereas the Client is the area where all on-line work is undertaken. Since the kind of
work which I was involved dealt with insertion, updating and in tables, all the work was developed in
the Development area. I call the environment pseudo-real since all data which is being used for online transaction can be copied into the tables of the Development and live data can be worked on.
Thus whatever would be the output on the Client is reflected exactly on the Development also?
Thus, discovery of error became simpler in that the errors which would occur in the real-time
environment were exactly duplicated in the Development environment.
All the above types of testing were carried out and various extreme cases were also introduced
to check for whether the system responded as expected. The various Forms, database packages,
procedures, function; visual basic programs and functions were tested to discover they behaved in the
manner expected of them and gave accurate results. However, the factor, which helped most in the
modification and rectification of the system, was the user response. The user after using the system
would invariably come up with some idea to improve the system. Such ideas, if feasible, were
incorporated into the system, thus leading to an improvement in the overall efficiency of the system.
Implementation, literally, means to put into effect or to carry out. The system implementation
phase of software engineering deals with all activities that take place to convert from the old system
to the new. Proper implementation is essential to provide system to meet organizations requirements.
During the implementation phase debugging, documentation of the system was created out,
module in the project for
Accuracy of Results,
Various types of errors were discovered while debugging the modules. These ranged from
errors to failure to account for various processing cases. Proper documentation of each module was
done by embedding comments in the executable portion of the code. To enhance the readability,
comments, indentation, parenthesis, black spaces, blank lines and borders were around the blocks of
comments. Care was taken to use descriptive names for table, field, modules, forms etc., The proper
use of indentation, parenthesis and blank lines was also ensured during coding.
Testing of the Report Generation module was carried out to find out the response time of the
system for the generating reports. To make the response time negligible
Maintenance is a fact of life in the development of information systems. However the making
of changes & adjustments dont necessarily signal correction of error or the occurrence of problems.
Among the most frequent changes requested by end users is the addition of information to a
report format. Information requirements may be revised as the result of system usage or changing
operational needs. Perhaps oversights that occurred during the development process need to be
corrected.
Often, the need arises to capture additional data for storage in a database or perhaps when it is
necessary to add error detection features to prevent system users from inadvertently taking an
unwanted action.
These are the realities of application maintenance, when they occur, however they are an
indication that the system is being used & that it is serving a useful function rather than being
shelved by the intended, such as :
INTERNAL DOCUMENTATION
2.
EXTERNAL DOCUMENTATION
INTERNAL DOCUMENTATION
Internal documentation in the code can be extremely useful in enhancing the understandability
of programs. Internal documentation of programs is done by the use of comments. All the languages
provide means of writing comments in the programs. Comments are textual statements that are meant
for the reader and are not executed. Comments, if properly written, and if kept consistent with the
code, can be invaluable during maintenance.
The purpose of comments is not to explain the internal logic of the program the program
itself is the best documentation for the details of logic. The comments should explain what the code is
done is doing, and not how it is done it.
Comments should be provided for the block of code, particularly those parts of code which
are hard to follow.
Providing comments for module is most useful as module form the unit testing, compiling,
verification and modification. Comments for a module are often called prologue for the module. It is
best to standardize the structure of the prologue of the module. It is desirable that prologue contains
the following information:
a)
b)
c)
d)
As explanation of parameters (whether they are input only, output only or both input and output , why
they are needed by the module and how the parameters are modified ) can be quite useful during
maintenance.
In addition to that given above, often information can be included, depending on the local
coding standards. Example includes:
-
Date of compilation
Note that if the module is modified, then the prologue should also be modified, if necessary. A
prologue that is inconsistent with the internal logic of the module is prologue worse than having no
prologue at all.
While coding programs for the Station Coding System special attention has been paid to the
internal documentation of the system, in addition to the external documentation. Each
program/module has:
Program/module name on top
Date of creation of the program
Last modification date
The S/W tool used to developed the program
Description of input to the program/module
Description of the output produced
How the module is related to other modules
Purpose of variables/constants used
Apart from this comment lines have been inserted wherever it was felt that they were
necessary. Moreover meaningful variable names/constants have been assigned to different
variable/constants used in the programs.
LOGIN
Login table used to store users information and type of user
FIELD
CONSTRA
INT
DATATYP
E
SIZE
DESCRIPT
ION
USERNAM
E
VARCHAR2
20
Username
PASSWOR
D
VARCHAR2
20
Password
USERTYPE
VARCHAR2
Type of
user
whether
Administra
tor or
Employees
CUSTOMER TABLE
FIELD
CONSTRAINT
DATA
TYPE
SIZE
DESCRIPTION
ID
PRIMARY KEY
VARCHA
R2
20
Unique ID of
customer
NAME
NOT NULL
VARCHA
R2
25
Name of
customer
FNAME
VARCHA
R2
25
Father name of
customer
ADDRE
SS
VARCHA
R2
50
Address of
customer
CONTA
CT
NUMBER
15
Contact no. of
customer
PINCOD
E
NUMBER
10
Pincode
CONTY
PE
NUMBER
Type of
connection
NOOFC
YL
NUMBER
Total cylinders
DOC
DATE
N/A
Date of
connection
STATUS
VARCHA
R2
20
Status whether
confirmed or in
consideration
EMPLOYEE TABLE
FIELD
CONSTRAINT
DATATYPE
SIZE
DESCRIPT
ION
ID
PRIMARY KEY
VARCHAR2
20
Unique ID
of
Employee
NAME
NOT NULL
VARCHAR2
25
Name of
the
Employee
FNAME
VARCHAR2
25
Father
name of
the
Employee
ADDRES
S
VARCHAR2
50
Address of
Employee
DOB
DATE
N/A
Date of
birth
CONTAC
T
NUMBER
15
Contact
no.
DESIG
VARCHAR2
20
Designatio
n
DOJ
DATE
N/A
Date of
Joining
BOOKING TABLE
FIELD
CONSTR
ANT
DATATYP
E
SIZE
DESCRIPT
ION
CUSTID
FOREIGN
KEY
VARCHAR
2
20
Customer
ID mapped
to the ID
field in
Customer
table
DOB
NOT NULL
DATE
N/A
Date Of
Booking
DFLAG
NOT NULL
NUMBER
Delivered
or not
DOD
NOT NULL
DATE
N/A
Date of
Delivery
STOCK
FIELD
CONSTRA
INT
DATATYP
E
SIZE
DESCRIPT
ION
COMSTOCK
NUMBER
Commerci
al Stock
DOMSTOCK
NUMBER
Domestick
Stock
DAMCOMSTO
CK
NUMBER
Damaged
commercia
l stock
DAMDOMSTO
CK
NUMBER
Damaged
Domestic
stock
CONFIGURATION
Store configuration of system like maximum cylinder maximum number of users
etc.
FIELD
CONSTRA
INT
DATATYP
E
SIZE
DESCRIPT
ION
MAXCYL
NUMBER
Maximum
Cylinders
can be
allocated
to a
customer
DEFBOOK
NUMBER
Days
difference
b/w two
consecutiv
e bookings
DEFDEL
NUMBER
Days
difference
b/w
booking
and
delivery
MAXUSER
NUMBER
Maximum no
of user can
exist for this
system
Customer
Single booking
Booking date
Updation
COUNTER
Stock
detail
ASSISTANT
Stock detail
Customer
detail
Booking
detail
UPDATAION
.
CUSTOMER ID
CUSTOMER
DETAIL
CONNECTION STATUS
This form is used to add new customer data into the database.
This form is used to add new employee data into the database.
Add user
This is a form which allow administrator to add new User. Provide another major
feature to select user type such as Administrator or User.
Change permission
This is a form which allow administrator to change accessibility among the various
Users.
Delete customer
This is form which provides much functionality to manage customers data such as
delete an customer, search customer, even it help to see others customer information
through next, previous, last, first buttons.
Delete employee
This is form which provides much functionality to manage employee data such as
delete an employee, search employee, even it help to see others employee information
through next, previous, last, first buttons.
Delete user
Book gas
This is a gas booking form which contains all information about the gas booking. And
provide another feature to check that how many cylinders have been issued for this
customer so far.
Gas delivery
This is a gas delivery form which allows to user for gas delivery. Provide a major
feature to check the current status of the customer before the cylinder delivery.
Login form
This is login form. In this form we login to enter the new form. It has two attributes i.e.
user name and password and two option button OK and CANCLE through which we
confirm or cancel the login form.
MDI form
This is the MDI (Multiple document interfaces) form. In this form we can open
multiple forms and can switch one to another. In this form we have menu editor
and the contents of menu editor are counter assistant, customer detail, change
password, help, about us and exit.
Modify customer
This is a form which allows to user to update customers information and also provide
another function to search customers from their ID or name.
Modify Employee
This is a form which allows to user to update employee information and also provide
another function to search employee from their ID or name.
Search customer
This is a form which will show all information about a searched customers.
Search Employee
This is a form which will show all information about a searched employees.
Add customer
Option Explicit
Private Sub cmdAddCust_Click()
On Error Resume Next
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open strCon
rs.Open "select * from customer", con, adOpenDynamic, adLockOptimistic
rs.AddNew
rs.Fields("id") = txtIdCust.Text
rs.Fields("name") = txtNameCust.Text
rs.Fields("fname") = txtFnameCust.Text
rs.Fields("address") = txtAddrCust.Text
rs.Fields("contact") = txtContCust.Text
rs.Fields("pincode") = Val(txtPinCust.Text)
rs.Fields("contype") = IIf(txtContCust.Text = "Domestic", 0, 1)
rs.Fields("noofcyl") = CInt(txtCyilCust.Text)
rs.Fields("doc") = CDate(Format(txtDocCust.Text, "mm/dd/yyyy"))
rs.Fields("status") = txtStatusCust.Text
rs.Update
MsgBox "Successfully added", vbOKOnly + vbInformation, "Added"
txtIdCust.Text = "Auto Generated"
End Sub
End Sub
Private Sub txtStatusCust_GotFocus()
txtIdCust.Text = Left(txtNameCust.Text, 3) & Left(txtFnameCust.Text, 3) &
Right(txtContCust.Text, 3) & Left(txtDocCust, 2)
End Sub
Add Employee
Option Explicit
Private Sub cmdAddEmp_Click()
On Error Resume Next
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open strCon
rs.Open "select * from employee", con, adOpenDynamic, adLockOptimistic
rs.AddNew
rs.Fields("id") = txtIdEmp
rs.Fields("name") = txtNameEmp.Text
rs.Fields("fname") = txtFnameEmp.Text
rs.Fields("address") = txtAddrEmp.Text
rs.Fields("dob") = CDate(txtDobEmp.Text)
rs.Fields("contact") = Val(txtContEmp.Text)
rs.Fields("desig") = txtDesigEmp.Text
rs.Fields("doj") = CDate(txtDojEmp.Text)
rs.Update
MsgBox "Successfully added", vbOKOnly + vbInformation, "Added"
rs.Close
con.Close
txtIdEmp.Text = ""
txtNameEmp.SetFocus
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub txtAddrEmp_GotFocus()
SelectText txtAddrEmp
End Sub
Left(txtNameEmp.Text,
Right(txtContEmp.Text, 3)
End Sub
Private Sub txtFnameEmp_GotFocus()
SelectText txtFnameEmp
End Sub
Private Sub txtIdEmp_GotFocus()
SelectText txtIdEmp
End Sub
Private Sub txtNameEmp_GotFocus()
SelectText txtNameEmp
End Sub
3)
&
Left(txtFnameEmp.Text,
3)
&
Add Stock
Option Explicit
Private Sub cmdAdd_Click()
On Error GoTo errlabel
Dim conStock As New ADODB.Connection
Dim rsStock As New ADODB.Recordset
conStock.Open strCon
rsStock.Open "select * from stock", conStock, adOpenDynamic, adLockOptimistic
rsStock.MoveFirst
rsStock.Fields("comstock") = rsStock.Fields("comstock") + CInt(txtComStock.Text)
rsStock.Fields("domstock") = rsStock.Fields("domstock") + CInt(txtDomStock.Text)
rsStock.Update
MsgBox "Stock Updated", vbOKOnly + vbInformation, "Updated"
rsStock.Close
conStock.Close
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Add User
Option Explicit
Private Sub cmdAdd_Click()
On Error GoTo errlabel
Dim conUser As New ADODB.Connection
Dim rsUser As New ADODB.Recordset
conUser.Open strCon
rsUser.Open "select * from login", conUser, adOpenDynamic, adLockOptimistic
rsUser.AddNew
If txtPassword.Text <> txtPassword2.Text Then
MsgBox "Passwords do not match, Please try again", vbOKOnly + vbExclamation, "Invalid
Password"
Else
rsUser.Fields("username") = txtUsername.Text
rsUser.Fields("password") = txtPassword.Text
rsUser.Fields("usertype") = IIf(cmbUserType.Text = "Administrator", "a", "e")
rsUser.Update
MsgBox "User has been successfully add", vbOKOnly + vbInformation, "Added"
End If
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub txtPassword_GotFocus()
SelectText txtPassword
End Sub
Change Password
Option Explicit
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo errlabel
Dim conUser As New ADODB.Connection
Dim rsUser As New ADODB.Recordset
Dim intRes As Integer
conUser.Open strCon
rsUser.Open "select * from login where username='" & txtUsername.Text & "' and password='" &
txtPassword.Text & "'", conUser, adOpenDynamic, adLockOptimistic
If rsUser.EOF Then
intRes = MsgBox("Invalid Username or Password", vbRetryCancel + vbExclamation, "Error")
If intRes = vbRetry Then
txtUsername.SetFocus
Else
Unload Me
End If
Else
rsUser.Fields("password") = txtNewPass.Text
rsUser.Update
MsgBox "Password Successfully Changed", vbOKOnly + vbInformation, "Passsword Changed"
End If
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Configuration
Dim conConfig As New ADODB.Connection
Dim rsConfig As New ADODB.Recordset
Private Sub cmdEdit_Click()
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is TextBox Then ctrl.Locked = True
Next
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo errlabel
rsConfig.Fields("maxcyl") = CInt(txtMaxCyl.Text)
rsConfig.Fields("maxuser") = CInt(txtMaxUser.Text)
rsConfig.Fields("defbook") = CInt(txtDefBook.Text)
rsConfig.Fields("defdel") = CInt(txtDefDel.Text)
rsConfig.Update
MsgBox "Successfully changed", vbOKOnly + vbInformation, "Changed"
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
Dim ctrl As Control
conConfig.Open strCon
rsConfig.Open "select * from config", conConfig, adOpenDynamic, adLockOptimistic
Customer Report
Option Explicit
Private Sub cmdOK_Click()
On Error Resume Next
Dim strPar As String
strPar = Combo1.Text
deGas.comBooking (strPar)
rptCustomer.Show
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
Dim conCust As New ADODB.Connection
Dim rsCust As New ADODB.Recordset
conCust.Open strCon
rsCust.Open "select * from booking", conCust, adOpenDynamic, adLockOptimistic
Combo1.Text = rsCust.Fields("custid")
While Not rsCust.EOF
Combo1.AddItem rsCust.Fields("custid")
rsCust.MoveNext
Wend
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Damage Cylinder
Option Explicit
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo errlabel
Dim conStock As New ADODB.Connection
Dim rsStock As New ADODB.Recordset
conStock.Open strCon
rsStock.Open "select * from stock", conStock, adOpenDynamic, adLockOptimistic
If cmbConType.Text = "Domestic" Then
rsStock.Fields("domstock") = rsStock.Fields("domstock") - CInt(txtCyl.Text)
rsStock.Fields("damdomstock") = rsStock.Fields("damdomstock") + CInt(txtCyl.Text)
rsStock.Update
MsgBox "Stock Updated", vbOKOnly + vbInformation, "Updated"
End If
If cmbConType.Text = "Commercial" Then
rsStock.Fields("comstock") = rsStock.Fields("comstock") - CInt(txtCyl.Text)
rsStock.Fields("damcomstock") = rsStock.Fields("damcomstock") + CInt(txtCyl.Text)
rsStock.Update
MsgBox "Stock Updated", vbOKOnly + vbInformation, "Updated"
End If
rsStock.Close
conStock.Close
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
cmbConType.AddItem "Domestic"
cmbConType.AddItem "Commercial"
cmbConType.Text = "Domestic"
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Delete Customer
Option Explicit
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Private Sub cmdDelCust_Click()
On Error Resume Next
Dim isOk As Integer
Dim txtToEmpty As Control
If rs.EOF Or rs.BOF Then
MsgBox "There are no records to delete", vbOKOnly + vbInformation, "Error"
Else
isOk = MsgBox("Are you sure to delete this record", vbYesNo + vbInformation, "Alert")
If isOk = vbYes Then
rs.Delete
MsgBox "Record successfully deleted", vbOKOnly + vbInformation, "Deleted"
If rs.EOF Or rs.BOF Then
For Each txtToEmpty In Me.Controls
If TypeOf txtToEmpty Is TextBox Then txtToEmpty.Text = Nothing
Next
Exit Sub
Else
rs.MoveNext
If rs.EOF Then rs.MoveLast
fillData
End If
End If
End If
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
fillData
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
fillData
End Sub
Private Sub cmdNext_Click()
rs.MoveNext
If rs.EOF Then rs.MoveLast
fillData
End Sub
Private Sub cmdPrev_Click()
rs.MovePrevious
If rs.BOF Then rs.MoveFirst
fillData
End Sub
Private Sub cmdSearch_Click()
On Error GoTo errlabel
rs.MoveFirst
Dim strToSearch As String
If optID.Value Then
strToSearch = InputBox("Enter the customer ID", "Search Customer", rs.Fields("id"))
rs.Find "id='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
MsgBox "Cannot find the specified record", vbOKOnly + vbExclamation, "Error"
Else
fillData
End If
End If
If optName.Value Then
strToSearch = InputBox("Enter the customer name", "Search Customer", rs.Fields("name"))
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub fillData()
On Error Resume Next
txtIdCust.Text = rs.Fields("id")
txtNameCust.Text = rs.Fields("name")
txtFnameCust.Text = rs.Fields("fname")
txtAddrCust.Text = rs.Fields("address")
txtContCust.Text = rs.Fields("contact")
txtPinCust.Text = rs.Fields("pincode")
txtConnCust = rs.Fields("contype")
txtCyilCust.Text = rs.Fields("noofcyl")
txtDocCust.Text = rs.Fields("doc")
txtStatusCust.Text = rs.Fields("status")
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Delete Employee
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Private Sub fillData()
On Error Resume Next
txtIdEmp.Text = rs.Fields("id")
txtNameEmp.Text = rs.Fields("name")
txtFnameEmp.Text = rs.Fields("fname")
txtAddrEmp.Text = rs.Fields("address")
txtDobEmp.Text = rs.Fields("dob")
txtContEmp.Text = rs.Fields("contact")
txtDesigEmp.Text = rs.Fields("desig")
txtDojEmp.Text = rs.Fields("doj")
End Sub
Else
rs.MoveNext
If rs.EOF Then rs.MoveLast
fillData
End If
End If
End If
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
End If
rs.Requery
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
fillData
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
fillData
End Sub
Private Sub cmdNext_Click()
rs.MoveNext
If rs.EOF Then rs.MoveLast
fillData
End Sub
Private Sub cmdPrev_Click()
rs.MovePrevious
If rs.BOF Then rs.MoveFirst
fillData
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Delete User
Option Explicit
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDel_Click()
On Error GoTo errlabel
Dim rsUser As New ADODB.Recordset
Dim conUser As New ADODB.Connection
Dim intRes As Integer
'User should not be default user (Administrator)
If isSystemUser Then
MsgBox "Cannot delete system user! contact your administrator", vbOKOnly + vbCritical,
"Unauthorized Attempt"
Exit Sub
End If
'open the connection
conUser.Open strCon
rsUser.Open "select * from login where username='" & txtUsername.Text & "' and password='" &
txtPassword.Text & "'", conUser, adOpenDynamic, adLockOptimistic
If rsUser.EOF Then
intRes = MsgBox("Invalid Username or password", vbRetryCancel + vbInformation, "Error")
If intRes = vbCancel Then
Unload Me
Else
txtUsername.SetFocus
End If
Else
rsUser.Delete
MsgBox "Successfully Deleted", vbOKOnly + vbInformation, "Deleted"
End If
rsUser.Close
conUser.Close
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
'This function is for make sure that it is not
'a default user (Administrator)
Private Function isSystemUser() As Boolean
If txtUsername.Text = "brajmohan" Then
isSystemUser = True
Else
isSystemUser = False
End If
End Function
Private Sub txtPassword_GotFocus()
SelectText txtPassword
End Sub
Private Sub txtUsername_GotFocus()
SelectText txtUsername
End Sub
Gas Book
Option Explicit
Dim con As ADODB.Connection
Dim rsCus As ADODB.Recordset
Dim rsBook As ADODB.Recordset
Private Sub cmbCustId_Click()
On Error GoTo errlabel
rsCus.Requery
rsCus.Find ("id='" & cmbCustId.Text & "'")
cmbCustName.Text = rsCus.Fields("name")
fillData
rsCus.Requery
cmdBook.Enabled = False
frmInfo.Visible = False
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdBook_Click()
On Error GoTo errlabel
Dim dtToday As Date, dtDel As Date
rsBook.Open "select * from booking", con, adOpenDynamic, adLockOptimistic
dtToday = CDate(Format(Now, "mm/dd/yyyy"))
dtDel = DateAdd("d", intDefDel, dtToday)
rsBook.AddNew
rsBook.Fields("custid") = cmbCustId.Text
rsBook.Fields("dob") = dtToday
rsBook.Fields("dod") = dtDel
rsBook.Fields("dflag") = 0
rsBook.Update
cmdBook.Enabled = False
MsgBox "Successfully Booked", vbOKCancel + vbInformation, "booked"
rsBook.Close
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdCheck_Click()
On Error GoTo errlabel
Dim rsDel As New ADODB.Recordset
Dim rsTemp As New ADODB.Recordset
Dim dtBook As Date, dtToday As Date, dtDelivered As Date
Dim i As Integer, intDef As Integer
i=1
lblTotal.Caption = "Total Cylenders : " & rsCus.Fields("noofcyl")
frmInfo.Visible = True
End If
dtToday = Format(Now, "mm/dd/yyyy")
rsBook.MoveLast
dtBook = rsBook.Fields("dob")
intDef = DateDiff("d", dtBook, dtToday)
If intDef > intDefBook Then
cmdBook.Enabled = True
Else
MsgBox "Gas can be book after " & (intDefBook - (dtToday - dtBook)) & " Days", vbOKOnly +
vbInformation, "Info"
cmdBook.Enabled = False
End If
rsBook.Close
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo errlabel:
Set con = New ADODB.Connection
con.Open strCon
Set rsCus = New ADODB.Recordset
Set rsBook = New ADODB.Recordset
rsCus.Open "select * from customer", con, adOpenDynamic, adLockOptimistic
cmbCustId.Text = rsCus.Fields("id")
cmbCustName.Text = rsCus.Fields("name")
fillData
rsCus.MoveFirst
Gas Delivery
Option Explicit
Dim con As ADODB.Connection
Dim rsCus As ADODB.Recordset
Dim rsBook As ADODB.Recordset
Private Sub cmbCustId_Click()
On Error GoTo errlabel
rsCus.Requery
rsCus.Find ("id='" & cmbCustId.Text & "'")
cmbCustName.Text = rsCus.Fields("id")
fillData
rsCus.Requery
cmdDeliver.Enabled = False
frmInfo.Visible = False
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
frmInfo.Visible = False
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdDeliver_click()
On Error GoTo errlabel
Dim rsStock As ADODB.Recordset
Dim dtToday As Date, dtDel As Date
rsBook.Open "select * from booking where custid='" & cmbCustId.Text & "' AND dflag=0 order by
dod", con, adOpenDynamic, adLockOptimistic
dtToday = Format(Now, "mm/dd/yyyy")
rsBook.Fields("dod") = dtToday
rsBook.Fields("dflag") = 1
rsBook.Update
cmdDeliver.Enabled = False
MsgBox "Successfully Delivered", vbOKCancel + vbInformation, "Booked"
rsBook.Close
rsBook.Open "select * from stock", con, adOpenDynamic, adLockOptimistic
If rsCus.Fields("contype") = "Domestic" Then
If intDomStock = 0 Then
MsgBox "Out of Stock", vbOKOnly + vbInformation, "Stock finished"
Exit Sub
End If
intDomStock = intDomStock - 1
rsBook.Fields("domstock") = intDomStock
Else
If intComStock = 0 Then
MsgBox "Out of Stock", vbOKOnly + vbInformation, "Stock finished"
Exit Sub
End If
intComStock = intComStock - 1
rsBook.Fields("comstock") = intComStock
End If
rsBook.Update
rsBook.Close
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdCheck_Click()
'On Error GoTo errlabel
Dim rsDel As New ADODB.Recordset
Dim rsTemp As New ADODB.Recordset
Dim dtBook As Date, dtToday As Date, dtDelivered As Date
Dim i As Integer, intDef As Integer
i=1
lblTotal.Caption = "Total Cylenders : " & rsCus.Fields("noofcyl")
frmInfo.Visible = True
If rsCus.Fields("status") = "In Consideration" Then
MsgBox "Sorry! Connection not confirmed yet", vbOKOnly + vbInformation, "Info"
cmdDeliver.Enabled = False
Exit Sub
End If
dtToday = Format(Now, "dd / mm / yyyy")
Fg1.Clear
Fg1.Rows = 1
Fg1.TextMatrix(0, 0) = "Number"
Fg1.TextMatrix(0, 1) = "Date Of Booking"
Fg1.TextMatrix(0, 2) = "Date of Delivery"
rsBook.Open "select * from booking where custid='" & cmbCustId.Text & "' order by dob", con,
adOpenDynamic, adLockOptimistic
If rsBook.EOF Then
cmdDeliver.Enabled = False
rsBook.Close
Exit Sub
End If
While Not rsBook.EOF
Fg1.Rows = Fg1.Rows + 1
Fg1.TextMatrix(i, 0) = i
Fg1.TextMatrix(i, 1) = Format(rsBook.Fields("dob"), "dd/mm/yyyy")
Fg1.TextMatrix(i, 2) = Format(rsBook.Fields("dod"), "dd/mm/yyyy")
i=i+1
rsBook.MoveNext
Wend
rsTemp.Open "select * from booking where custid='" & cmbCustId.Text & "' AND dflag=0 order by
dob", con, adOpenDynamic, adLockOptimistic
If rsTemp.EOF Then
MsgBox "First book the gas", vbOKOnly + vbInformation, "Error"
Exit Sub
End If
dtToday = Format(Now, "mm/dd/yyyy")
rsBook.MoveFirst
dtBook = rsBook.Fields("dod")
intDef = DateDiff("d", dtBook, dtToday)
If intDef > 0 Then
cmdDeliver.Enabled = True
Else
MsgBox "Gas can be delivered after " & intDef * -1, vbOKOnly + vbExclamation, "Info"
cmdDeliver.Enabled = False
End If
rsBook.Close
Exit Sub
'errlabel:
'MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
Set con = New ADODB.Connection
con.Open strCon
Set rsCus = New ADODB.Recordset
Set rsBook = New ADODB.Recordset
rsCus.Open "select * from customer", con, adOpenDynamic, adLockOptimistic
fillData
rsCus.MoveFirst
While Not rsCus.EOF
cmbCustId.AddItem rsCus.Fields("id")
cmbCustName.AddItem rsCus.Fields("name")
rsCus.MoveNext
Wend
rsCus.MoveFirst
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub fillData()
On Error Resume Next
txtFnameCust.Text = rsCus.Fields("fname")
txtAddrCust.Text = rsCus.Fields("address")
txtContCust.Text = rsCus.Fields("contact")
txtPinCust.Text = rsCus.Fields("pincode")
txtConnCust = rsCus.Fields("contype")
txtCyilCust.Text = rsCus.Fields("noofcyl")
txtDocCust.Text = Format(rsCus.Fields("doc"), "dd/mm/yyyy")
txtStatusCust.Text = rsCus.Fields("status")
End Sub
Login Form
Option Explicit
Private Sub cmdOK_Click()
On Error GoTo errlabel
Dim strUsertype As String
If cmbUserType.Text = "Administrator" Then
strUsertype = "a"
Else
strUsertype = "e"
End If
rsGas.MoveFirst
While Not rsGas.EOF
If txtUsername.Text = rsGas.Fields("username") And txtPassword.Text =
rsGas.Fields("password") And rsGas.Fields("usertype") = strUsertype Then
MsgBox "Login succeed", vbOKOnly + vbInformation, "Success"
rsGas.Close
conGas.Close
If strUsertype <> "a" Then frmMain.mnuTools.Enabled = False
Unload Me
frmMain.Show
Exit Sub
Else
rsGas.MoveNext
End If
Wend
If rsGas.EOF Then
MsgBox "Invalid username or password", vbOKOnly + vbExclamation, "Login Error"
txtUsername.SelStart = 0
txtUsername.SelLength = Len(txtUsername.Text)
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
txtUsername.SetFocus
End If
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
strCon = "DSN=Gasdsn;User ID=scott;Password=tiger"
conGas.Open strCon
rsGas.Open "select * from login", conGas, adOpenForwardOnly, adLockOptimistic
MsgBox "Connection Established", vbOKOnly + vbInformation, "Succeed"
cmbUserType.AddItem "Administrator"
cmbUserType.AddItem "Employee"
cmbUserType.Text = "Administrator"
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Mdi Form
Private Sub aboutProject_Click()
frmAbout.Show
End Sub
Private Sub cmdChangePass_Click()
frmChangepass.Show
End Sub
Private Sub MDIForm_Load()
Call Startup
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
i = MsgBox("do u want to Exit......", vbYesNo + vbInformation, "Alert")
If i = vbNo Then
Cancel = True
End If
End Sub
Private Sub mnuAddCust_Click()
frmAddCust.Show
End Sub
Private Sub mnuAddEmp_Click()
frmAddEmp.Show
End Sub
Private Sub mnuAddStock_Click()
frmAddStock.Show
End Sub
Private Sub mnuAddUser_Click()
frmAdduser.Show
End Sub
Private Sub mnuBooking_Click()
frmGasBook.Show
End Sub
Private Sub mnuChangePer_Click()
frmChangeper.Show
End Sub
Private Sub mnuComStock_Click()
rptStock.Show
End Sub
Private Sub mnuConfigMgmt_Click()
frmConfig.Show
End Sub
Private Sub mnuCustReport_Click()
frmCustReport.Show
End Sub
Private Sub mnuDam_Click()
frmDam.Show
End Sub
Private Sub mnuDel_Click()
frmGassDele.Show
End Sub
Private Sub mnuDelCust_Click()
frmDelCust.Show
End Sub
Private Sub mnuDelEmp_Click()
frmDelEmp.Show
End Sub
Private Sub mnuDelUser_Click()
frmDelUser.Show
End Sub
Private Sub mnuExit_Click()
Unload Me
End Sub
Private Sub mnuModCust_Click()
FrmModCust.Show
End Sub
Private Sub mnuModEmp_Click()
frmModEmp.Show
End Sub
Private Sub mnuSearchCust_Click()
frmSearchCust.Show
End Sub
Private Sub mnuSearchEmp_Click()
frmSearchemp.Show
End Sub
Private Sub mnuStockReport_Click()
rptStock.Show
End Sub
Modify Customer
Option Explicit
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Private Sub cmdDelCust_Click()
On Error GoTo errlabel
Dim isOk As Integer
Dim txtToEmpty As Control
If rs.EOF Or rs.BOF Then
MsgBox "There are no records to delete", vbOKOnly + vbExclamation, "Alert"
Else
isOk = MsgBox("Are you sure to delete this record", vbYesNo + vbInformation, "Alert")
If isOk = vbYes Then
rs.Delete
MsgBox "Record successfully deleted", vbOKOnly + vbInformation, "Deleted"
If rs.RecordCount = 0 Then
For Each txtToEmpty In Me.Controls
If TypeOf txtToEmpty Is TextBox Then Set txtToEmpty.Text = Nothing
Next
Exit Sub
End If
Else
rs.MoveNext
If rs.EOF Then rs.MoveLast
fillData
End If
End If
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
fillData
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
fillData
End Sub
Private Sub cmdModCust_Click()
On Error Resume Next
rs.Fields("id") = txtIdCust.Text
rs.Fields("name") = txtNameCust.Text
rs.Fields("fname") = txtFnameCust.Text
rs.Fields("address") = txtAddrCust.Text
rs.Fields("contact") = txtContCust.Text
rs.Fields("pincode") = txtPinCust.Text
rs.Fields("contype") = txtConnCust
rs.Fields("noofcyl") = txtCyilCust.Text
rs.Fields("doc") = txtDocCust.Text
rs.Fields("status") = txtStatusCust.Text
rs.Update
MsgBox "Record successfully updated", vbOKOnly + vbInformation, "Updated"
End Sub
Private Sub cmdModify_Click()
Dim txtToLock As Control
For Each txtToLock In Me.Controls
If TypeOf txtToLock Is TextBox Then
txtToLock.Locked = False
End If
Next
End Sub
Private Sub cmdNext_Click()
rs.MoveNext
If rs.EOF Then rs.MoveLast
fillData
End Sub
Private Sub cmdPrev_Click()
rs.MovePrevious
If rs.BOF Then rs.MoveFirst
fillData
End Sub
Private Sub cmdSearch_Click()
On Error GoTo errlabel
Dim strToSearch As String
If optID.Value Then
strToSearch = InputBox("Enter the customer ID", "Search Customer", rs.Fields("id"))
rs.Find "id='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
MsgBox "Cannot find the specified record", vbOKOnly + vbExclamation, "Error"
Else
fillData
End If
End If
If optName.Value Then
strToSearch = InputBox("Enter the customer name", "Search Customer", rs.Fields("name"))
rs.Find "name='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
MsgBox "Cannot find the specified record", vbOKOnly + vbExclamation, "Error"
Else
fillData
End If
End If
rs.Requery
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
Dim txtToLock As Control
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open strCon
rs.Open "select * from customer", con, adOpenDynamic, adLockOptimistic
If Not (rs.EOF Or rs.BOF) Then
rs.MoveFirst
fillData
End If
For Each txtToLock In Me.Controls
If TypeOf txtToLock Is TextBox Then
txtToLock.Locked = True
End If
Next
txtIdCust.Locked = True
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub fillData()
End Sub
Private Sub txtIdCust_GotFocus()
SelectText txtIdCust
End Sub
Private Sub txtNameCust_GotFocus()
SelectText txtNameCust
End Sub
Private Sub txtPinCust_GotFocus()
SelectText txtPinCust
End Sub
Private Sub txtStatusCust_GotFocus()
' SelectText txtStatusCust
txtIdCust.Text = Left(txtNameCust.Text, 3) & Left(txtFnameCust.Text, 3) &
Right(txtContCust.Text, 3) & Left(txtDocCust, 2)
End Sub
Modify Employee
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Private Sub fillData()
On Error Resume Next
txtIdEmp.Text = rs.Fields("id")
txtNameEmp.Text = rs.Fields("name")
txtFnameEmp.Text = rs.Fields("fname")
txtAddrEmp.Text = rs.Fields("address")
txtDobEmp.Text = rs.Fields("dob")
txtContEmp.Text = rs.Fields("contact")
txtDesigEmp.Text = rs.Fields("desig")
txtDojEmp.Text = rs.Fields("doj")
End Sub
rs.Fields("desig") = txtDesigEmp.Text
rs.Fields("doj") = txtDojEmp.Text
rs.Update
MsgBox "Record successfully updated", vbOKOnly + vbInformation, "Updated"
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Cannot Modify"
End Sub
Private Sub cmdModify_Click()
Dim txtToLock As Control
For Each txtToLock In Me.Controls
If TypeOf txtToLock Is TextBox Then
txtToLock.Locked = False
End If
Next
End Sub
Private Sub cmdSearch_Click()
On Error GoTo errlabel
Dim strToSearch As String
If optID.Value Then
strToSearch = InputBox("Enter the customer ID", "Search Customer", rs.Fields("id"))
rs.Find "id='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
MsgBox "Cannot find the specified record", vbOKOnly + vbExclamation, "Error"
Else
fillData
End If
End If
If optName.Value Then
strToSearch = InputBox("Enter the customer name", "Search Customer", rs.Fields("name"))
rs.Find "name='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
Search Customer
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub cmdSearch_Click()
On Error GoTo errlabel
Dim strToSearch As String
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open strCon
rs.Open "select * from customer", con, adOpenDynamic, adLockOptimistic
If optID.Value Then
strToSearch = InputBox("Enter the customer ID", "Search Customer", rs.Fields("id"))
rs.Find "id='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
MsgBox "Cannot find the specified record", vbOKOnly + vbExclamation, "Error"
Else
fillData
End If
End If
If optName.Value Then
strToSearch = InputBox("Enter the customer name", "Search Customer", rs.Fields("name"))
rs.Find "name='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
MsgBox "Cannot find the specified record", vbOKOnly + vbExclamation, "Error"
Else
fillData
End If
End If
rs.Requery
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo errlabel
Dim txtToLock As Control
Set con = New ADODB.Connection
Set rs = New ADODB.Recordset
con.Open strCon
rs.Open "select * from customer", con, adOpenDynamic, adLockOptimistic
For Each txtToLock In Me.Controls
If TypeOf txtToLock Is TextBox Then
txtToLock.Locked = True
End If
Next
Exit Sub
errlabel:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error"
End Sub
Private Sub fillData()
On Error Resume Next
txtIdCust.Text = rs.Fields("id")
txtNameCust.Text = rs.Fields("name")
txtFnameCust.Text = rs.Fields("fname")
txtAddrCust.Text = rs.Fields("address")
txtContCust.Text = rs.Fields("contact")
txtPinCust.Text = rs.Fields("pincode")
txtConnCust = rs.Fields("contype")
txtCyilCust.Text = rs.Fields("noofcyl")
txtDocCust.Text = rs.Fields("doc")
txtStatusCust.Text = rs.Fields("status")
End Sub
Search Employee
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Private Sub fillData()
On Error Resume Next
txtIdEmp.Text = rs.Fields("id")
txtNameEmp.Text = rs.Fields("name")
txtFnameEmp.Text = rs.Fields("fname")
txtAddrEmp.Text = rs.Fields("address")
txtDobEmp.Text = rs.Fields("dob")
txtContEmp.Text = rs.Fields("contact")
txtDesigEmp.Text = rs.Fields("desig")
txtDojEmp.Text = rs.Fields("doj")
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSearch_Click()
On Error GoTo errlabel
Dim strToSearch As String
If optID.Value Then
strToSearch = InputBox("Enter the customer ID", "Search Customer", rs.Fields("id"))
rs.Find "id='" & strToSearch & "'", , adSearchForward, 0
If rs.EOF Then
The project made me realize the significance of developing software for client, where all the
eventualities have to be taken care of, unlike at educational institution, where the sole aim is to learn.
What may be seen to the developed to be software complete in all respects, I was required to meet the
stringent demands of the in-house client in the materials department. Through this seemed tough at
first, I realized that pressure goaded us on to develop better and better applications.
During the project, the real importance for following all the principle of System Analysis and
Design drawled on me. I felt the necessity of going through the several stages, because only such a
process could make one understand the problems at hand, more so due to the enormous size of data
stores involved and their manipulation
In retrospect, I would like to say that the institute provided us with sample opportunities to
learn Oracle 8 and its tools. I specifically was able to learn ORACLE and its Tools. I specially was
able to learn VISUAL BASIC 6.0. I also succeeded in understanding a number of tricky concept in
database, which were earlier only hazy blobs in the realm of our comprehension. However
my
project library management is an asset to the organization, even then FURTHER ENHANCEMENT
is possible in this project such as new forms & reports can be included as and when required.
Unfortunately due to lack of time we can developed any report in this system but this is not
the end of this system software, it is beginning. We can change and modify this software due to
more requirements of needs and also removed some errors which is finding in this system software.
We also developed some complex reports which is required and makes this software more
powerful and friendly for user by which user can handle library data more easily and can calculate
all the calculation without any other software i.e., users all the requirements will be fulfill by this
software and user can manage all the numeric data calculations.
S.No.
1
Terms
BACK UP
Description
A copy of something preserved to insure against
the damage of primary copy.
DATA BASE
DBMS
DD
FLOW CHART
FLOW
CHART
which
depicts relation between different entities in the
system.
HARDWARE
ITD
MENU
MODULE
10
ON-LINE
11
PI
Preliminary Investigation
12
PROGRAM
13
PROTOTYPE
14
RDBMS
15
RSD
16
SCALABILITY
17
SOFTWARE
BOOK NAME
AUTHOR
1.
Techmedia
2.
C. J. Date
3.
E M. Awad
4.
Tulec
5.
Programming in VB
Black Book
6.
7.
Mastering in VB
Steve
8.
VB with MS-Access
Rita Sahoo
9.
Smith
Gary Cornell