You are on page 1of 75

Synopsis

Synopsis
Project Title: - Bank automation system
AIM:-To maintains information about the entire

transaction of bank.
It will also maintain the information about the
customer who makes transaction.
Bank automation system, this package is
intended to use options like opening bank
account of various types for the customer and
also maintaining their transaction details as well
as their personal details, time to time calculating
the interest of their deposit amount and after
withdrawing amount what is their balance
amount and for the fixed deposit account its
calculating the maturity date and maturity
amount according to rate of interest and number
of months.
Our objective is to develop a software using
Visual basic 6.0 as front-end and oracle as backend to manage entire operation of a bank.

Software requirements:-

Operating System :windows 98 & above


Front End
:Visual Basic 6.0
Back End
:Oracle

Hardware requirements:-

Processor
Ram
Hard Disc

:Pentium-IV
:256MB
:80GB

Contents

Contents
1.
2.
3.
4.
5.
6.
7.
8.
9.

Introduction to Project
About Visual Basic 6.0
About Oracle
Tables
ER-Diagrams
Forms
Source Code
Conclusion
Bibliography

Introduction to Project

Introduction to Project:A.T.M (Automatic Teller Machine) is government


body that engages activities related to bank.
Since A.T.M is started all activities like deposit,
withdrawing the amount, updating new
customer and accounts of banks etc. are done
manually. Due to increase of no of vehicles it
has became difficult to maintain all the
activities manually. All the details of A.T.M are
maintained using database where saving,
Deposit can be done. It is enough if the user
has the fundamental idea of using the computer
to handle this package efficiently.
And they realize that computer will reduce the
errors and improve the service to the peoples.
The various activities carried out by this
software are,
Creating a new account.
Maintaining with the previous customer.

Maintaing account detail.


Maintaing the transaction detail.
Checking the balance enquiry.
Printing the report.

Introduction To
Visual Basic 6.0

VISUAL BASIC 6.0


Visual Basic is a powerful programming system for
developing sophisticated graphical applications for
Microsoft windows environment creating a VB program
requires placing graphic object on the screen and setting
attributes for those objects that determines how the objects
are to look and behave. VB allows advanced programmers
to create powerful windows application. VB reduces the
effort and makes many aspects of programming simple as
dragging graphic objects onto the screen with your mouse.

The visual part refers to the method used to create


the graphical user interface (GUI), rather than writing
numerous lines of code to describe the appearance and
location of interface elements, we can simply drag and drop
pre-built object to place on the screen.

The basic refers to the BASIC (Beginners All purpose


symbolic Instruction code) language, a language used by
more programmers than any other language in the history
of computing. VB has evolved from the original BASIC
language and now contains several hundred statements,
Functions and key words, many of which relate directly to
the windows GUI.

Beginners can create useful applications by learning


just few of keywords, yet the power of language allows
professionals to accomplish using any other windows
programming language. Computer programs generally fall
into two very broad categories and custom.

VB is often referring as a rapid application development


(RAD) tool. The VB programming language is not unique to
visual basic programming system application edition
included in MS- Excel, MS-Access and many other windows
application user the language. The VB programming
system, scripting edition (VB script) for internet
programming is a subset of VB language.

Date access feature allow us to create database and


front- end application for most popular database formats,
including Microsoft Excel enterprise level database.

Active technologies allow us to use the functionality


provided by other applications such as MS- Word processor,
MS- Excel spread sheet and other windows applications.ss

Internet capabilities make it easy to provide access to


documents and applications across the internet from within
tour application. Our furnished applications are true. EXE
file that sees a run time dynamic link library that can freely
distributed. Ability to create and use self contained
components or objects.

Visual Basic Concepts:


In order to understand the application development it is
helpful to understand some of key concept upon which VB is
built. Because VB is a windows development language
some familiarity with the windows environment is
necessary. If we are new to windows programming we need
to be aware of some fundamental differences between
programming for windows programming versus other
environments.

The following are main areas in the design and


programming environment.

MAIN BAR:

Shows and displays specific commands needed to build


applications.
TOOL BAR:

An area providing quick access to commands found in


the menu bar.
FORM:
The windows that produce the user interface with
applications.

TOOL BOX:

The sets of tools used at design or programming time


to place control on form such as text or toolboxes.

PROPERTIES WINDOW:
Lists the property settings for particular form.

PROJECT WINDOW:

Lists the control files basis code modules forms the


other files that make up the entire application.

FORM DESIGNER:
Serves as a window that we customize to design the
interface of the application. We add controls, graphics and
pictures to a create the look we want. Each form in the
applications has own form designer windows.

CODE EDITOR WINDOW:

Serves as an editor for entering application code a


separate code editor window is created for each or code
module in the application.

FORM LAYOUT WINDOW:

The form layout window allows us to position the form


in the applications using a small graphical representation
screen immediate, locals and watch windows. These are
additional windows are provided for use in designing the
application they are only available when we are running the
application within IDE.

VB OBJECTS:
An object is combination of code and data that can be
treated as a unit. An object can be piece of application like
a control or a form. The objects used in our project are:
Text box, Label, Command button. Frames, picture box,
combo box, Data Grid etc.

For every application three processes must be done,


i.e. create the interface, set the properties and write the
code. This must be saved as a project.

Introduction to Oracle

ORACLE
Oracle 8 is an Object Relational Database System
(ORDBMS).It offers capabilities of both relational and
object-oriented database systems .in general, objects
can be defined as reusable software codes which are
location independent and perform a specific task on
any application environment with little or no change
to the code.
Oracle products are based on a concept known as
client-server technology. This concept involves
segregating the processing of an application between
two systems. One performs all activities related to
the database (server) and the other performs
activities that help the user interact with the
application (client).
A client or front end database application also
interacts with the database by requesting and
receiving information from the database server. It
acts as an interface between the user and the
database. Further it also checks for the validation
against the data entered by the user.
The database server or back end is used to manage
the database tables optimally among the multiple
clients who concurrently request for the server for
the same data. It also enforces data integrity across

all client application and controls database access


and other security requirements.
ORACLE SQL * PLUS
SQL * plus is made up of 2 distinct parts .These are
Interactive SQL
PL/SQL
Interactive SQL is designed to create access and
maintain all data structures like tables, indices, etc. It
can also be used for interactive data manipulation.
Programmers can use PL/SQL to create programs for
validation and manipulation of data. PL/SQL adds to
the power of interactive SQL and provides the
programmer with all the facilities of a standard,
modern day (4GL) programming environment.

ORACLE REPORTS

The process of data extraction and its display is


called reports creation. For this purpose, oracle
provides ague based report writer tool called ORACLE
Reports. Its is a tool for developing, displaying, and
printing producing quality reports.
Oracle reports enables us to create a wide verity of
reports, such as master/detail reports, nested matrix
reports, from letters and mailing labels.
Data model editor in which the data for the
reports is defined
Layout editor, in which the reports layout is
created.

Parameter from editor, which is used to


customize the appearance of the runtime
parameter.
Oracle reports provide input of data at runtime
through user parameter.

Tools of Oracle

The tools provides by Oracle are so user friendly that


a person with minimum skills in the field of
computers can access them with ease. The main
tools are:
SQL * PLUS
PL/SQL
Forms
Reports

Introduction to SQL
SQL was invented and developed by IBM in early
1970s. SQL stands for Structured Query Language.
The SQL implemented by ORACLE CORPORATION is
100% compliant with the ANSI/ISO standard SQL data
language. Oracles database language is SQL, which
is used for storing and retrieving information in
Oracle. A table is a database object of SQL that is
used to store data. A table holds data in the form of
rows & columns.

TABLES:

CREATE TABLE BANK( BNAME VARCHAR2(50),


BCODE VARCHAR2(10),
BANKADDR VARCHAR2(50),
PRIMARY KEY (BCODE));

INSERT INTO BANK VALUES('STATE BANK OF INDIA','S\B\I', 'M.G ROAD BANGALORE');

CREATE TABLE BRANCH ( BNO

NUMBER(10),

BNA

VARCHAR2(50),

BADDR

VARCHAR2(50),

PH_NO

VARCHAR2(15),

E_MAIL

VARCHAR2(20),

BCODE

VARCHAR2(10),

PRIMARY KEY (BNO,BCODE),


FOREIGN KEY(BCODE) REFERENCES BANK(BCODE));

INSERT INTO BRANCH VALUES(1,'STATE BANK OF INDIA-1','JAINAGAR 3RD CROSS


BLORE','3446799(080)','SBI@ATM.COM','S\B\I');
INSERT INTO BRANCH VALUES(2,'STATE BANK OF INDIA-2','PRAKASH NAGAR 5th CROSS
BLORE','3204140(080)','SBI@ATM.COM','S\B\I');
INSERT INTO BRANCH VALUES(3,'STATE BANK OF INDIA-3','SRINAGAR 1st PHASE 2nd CROSS
BLORE','2345661(080)','SBI@ATM.COM','S\B\I');
INSERT INTO BRANCH VALUES(4,'STATE BANK OF INDIA-4','RT NAGAR 7th CROSS
BLORE','2390879(080)','SBI@ATM.COM','S\B\I');

INSERT INTO BRANCH VALUES(5,'STATE BANK OF INDIA-5','BTM LAYOUT 8th CROSS


BLORE','3063431(080)','SBI@ATM.COM','S\B\I');

CREATE TABLE CUSTOMER( CDNO

CNA

NUMBER(5),

VARCHAR2(20) not null,

CADDR

VARCHAR2(50) not null,

PIN

VARCHAR2(4) not null,

BNO

NUMBER(10),

BCODE

VARCHAR2(10),

CITY

VARCHAR2(15)

PH_NO

VARCHAR2(15) not null,

E_MAIL

VARCHAR2(20)

not null,

not null,

PRIMARY KEY(CDNO),
FOREIGN KEY(BNO,BCODE) references BRANCH(BNO,BCODE));

INSERT INTO CUSTOMER VALUES(1000,'RAMESH','chickpet tumkur572101','a123',1,'S\B\I','Tumkur','2277892','ram@yahoo.com');

CREATE TABLE ACCOUNT (ACC_NO

NUMBER(5),

BAL

NUMBER(15,2),

ACC_TYPE

VARCHAR2(25),

WITH_DRAWL

NUMBER(15,2),

CDNO

NUMBER(5),

DEP_DATE

DATE,

DEPOSIT_AMT

NUMBER(15,2),

FAST_AMT

NUMBER(15,2),

BNO

NUMBER(10),

BCODE

VARCHAR2(10),

PRIMARY KEY(ACC_NO),
FOREIGN KEY(CDNO) REFERENCES CUSTOMER(CDNO),
FOREIGN KEY(BNO,BCODE) REFERENCES BRANCH(BNO,BCODE));

INSERT INTO ACCOUNT VALUES(1,5000,'SAVINGS ACCOUNT',3000,1000,'01-FEB04',5000,2000,1,'S\B\I');

CREATE TABLE TRANS(CDNO NUMBER(5),


ACC_NO NUMBER(5),

TRANS_DATE DATE,
TIME

varchar2(15),

PRIMARY KEY(CDNO,ACC_NO),
FOREIGN KEY(CDNO) REFERENCES CUSTOMER(CDNO),
FOREIGN KEY(ACC_NO) REFERENCES ACCOUNT(ACC_NO));

INSERT INTO TRANS VALUES(1000,1,'02-MAR-04','9:17:02 AM');

ER DIAGRAM:

Bad
dr

Bco
de

Phone
No
CIT
Y

Bname
BANK

Dep_a
mt

Fast_amt

1
ha
s

Bal

Acc_n
o
Conta
ins

BRANCHES

ACCOUNTS

Transa
cts

Ph_no

Bno
Bcode

cdn
o

E_mai
l

Bna

Dep_d
ate

With_dr
awn

Trans_dat
e

Tim
e
by

CUSTOMER

Cdno

Pin
E_mail

Cna

Ph_no
Caddr

City

FORMS:

SOURCE CODE
NEW CUSTOMER FORM:
Private cn As New ADODB.Connection
Private rs As New ADODB.Recordset
Private rs1 As New ADODB.Recordset
Private rs2 As New ADODB.Recordset
Private rs3 As New ADODB.Recordset
Dim c As Integer
Private Sub cmdadd_Click()
Command1.Visible = True
cmdadd.Visible = False
Call enable
Call lockfree
assign
rs.Update
cn.Execute ("UPDATE ACCOUNT SET Bno=" & Val(Text5) & ",bcode='" & "S\B\I" & "'" & "where cdno="
& c)
MsgBox "One customer record has been updated", , "message"
End Sub

Private Sub cmddel_Click()


Dim a As String
a = MsgBox("Do U want to delete current record", vbYesNo, "Warning")

If a = vbYes Then
rs.Delete
MsgBox "Ur customer record has removed", , "Message"
rs.MoveFirst
rs3.MoveFirst
showrec

Else
MsgBox "U have resumed ", , "Message"
Exit Sub
End If
End Sub

Private Sub cmdexit_Click()


MDIForm1.Show
Unload Me
Set rs = Nothing
Set rs3 = Nothing
Set rs1 = Nothing
Set rs2 = Nothing
cn.Close
End Sub

Private Sub cmdfind_Click()


Dim i As Integer
i = InputBox("Enter the cdno number")
rs.MoveFirst
rs.Find "cdno=" & i
showrec
End Sub

Private Sub cmdsave_Click()


End Sub
Private Sub Command1_Click()
Command1.Visible = False
Command6.Visible = True
Call locking

Text2.SetFocus
End Sub

Private Sub Command2_Click()


Set rs = New ADODB.Recordset
rs.Open "select * from customer", cn, adOpenKeyset, adLockOptimistic
rs.MoveFirst
rs3.MoveFirst
showrec
End Sub

Private Sub Command3_Click()


Set rs = New ADODB.Recordset
rs.Open "select * from customer", cn, adOpenKeyset, adLockOptimistic
rs.MoveLast
rs3.MoveLast
showrec
End Sub

Private Sub Command4_Click()


rs.MoveNext
rs3.MoveNext
If rs.EOF = True Then

rs.MoveLast
rs3.MoveLast
MsgBox "THIS IS THE LAST RECORD", , "ATM"
End If
showrec
End Sub

Private Sub Command5_Click()


rs.MovePrevious
rs3.MovePrevious
If rs.BOF = True Then
rs.MoveFirst
rs3.MoveFirst
MsgBox "THIS IS THE FIRST RECORD", , "ATM"
End If
showrec
End Sub

Private Sub Command6_Click()


If Text2 = "" Then
MsgBox "Please Enter The Customer Name", vbInformation
Text2.SetFocus
ElseIf Text3 = "" Then
MsgBox "Please Enter The Address ", vbInformation
Text3.SetFocus
ElseIf Text4 = "" Then
MsgBox "Please Enter The pin", vbInformation
Text4.SetFocus
ElseIf Text7 = "" Then
MsgBox "Please Enter The phone number", vbInformation

Text7.SetFocus
ElseIf Text8 = "" Then
MsgBox "Please Enter your E-mail ID", vbInformation
Text8.SetFocus
ElseIf Combo1.Text = "" Then
MsgBox "Please Select The Branch Name", vbInformation

Else
Command6.Visible = False
cmdadd.Visible = True
Call disable
End If
End Sub

Private Sub Form_Load()


Dim str As String
Command1.Visible = True
cmdadd.Visible = False
Command6.Visible = False
cn.Open "dsn=atm", "atm", "atm"
rs.Open "select * from customer order by cdno", cn, adOpenDynamic, adLockOptimistic
rs2.Open "select * from branch ", cn, adOpenDynamic, adLockOptimistic
rs3.Open "select acc_no from account order by cdno", cn, adOpenDynamic, adLockOptimistic
showrec
Call lockfree
End Sub

Public Sub clear()


Text2.Text = ""
Text3.Text = ""

Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""

End Sub
Private Sub showrec()
If rs.RecordCount = Null Then
MsgBox "Enter some values and try", vbExclamation
Else
If rs.EOF = True Then
MsgBox "NO records found", , "ATM"
Else
If rs.BOF = True Then
rs.MoveFirst
MsgBox "THIS IS THE FIRST RECORD", , "ATM"
Else
Text1.Text = rs(0)
Text9.Text = rs3(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text7.Text = rs(7)
Text8.Text = rs(8)
If Val(Text5.Text) = 1 Then
Combo1.Text = "sbi-1"
Text6.Text = "3446799(080)"

ElseIf Val(Text5.Text) = 2 Then


Text6.Text = "3204140(080)"
Combo1.Text = "sbi-2"
ElseIf Val(Text5.Text) = 3 Then
Text6.Text = "2345661(080)"
Combo1.Text = "sbi-3"

ElseIf Val(Text5.Text) = 4 Then


Text6.Text = "2390879(080)"
Combo1.Text = "sbi-4"
ElseIf Val(Text5.Text) = 5 Then
Text6.Text = "3063431(080)"
Combo1.Text = "sbi-5"
End If
End If
End If
End If
End Sub

Public Sub assign()


rs(0) = Val(Text1)
rs(1) = Trim(Text2)
rs(2) = Trim(Text3)
rs(3) = Trim(Text4)
rs(4) = Val(Text5)
rs(5) = "S\B\I"
rs(7) = Val(Text7)
rs(8) = Trim(Text8)
c = Val(Text1)
End Sub

Public Sub disable()


Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Combo1.Enabled = False

Text6.Enabled = False
Text7.Enabled = False
Text8.Enabled = False
Text5.Enabled = False
Text9.Enabled = False
End Sub
Public Sub enable()
Text5.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Combo1.Enabled = True
Text1.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
Text6.Enabled = True
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)


If Not ((KeyAscii <= 90 And KeyAscii >= 65) Or (KeyAscii <= 122 And KeyAscii >= 97) Or (KeyAscii =
8)) Then
KeyAscii = 0

End If
End Sub
Private Sub combo1_Click()
Set rs1 = Nothing
rs1.Open "select * from branch where bna like'" & Combo1.Text & "' ", cn, adOpenDynamic,
adLockOptimistic
If rs1.EOF <> True Then

Text5.Text = rs1(0)
Text6.Text = rs1(3)
End If
rs1.Close
End Sub

Private Sub combo1_DropDown()


Set rs1 = Nothing
Combo1.clear
rs1.Open "select bna from branch", cn, adOpenDynamic, adLockOptimistic
While rs1.EOF <> True
Combo1.AddItem rs1(0)
rs1.MoveNext
Wend
rs1.Close
End Sub

Public Sub locking()


Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Combo1.Locked = False

Text7.Locked = False
Text8.Locked = False
End Sub

Public Sub lockfree()


Text1.Locked = True
Text2.Locked = True

Text3.Locked = True
Text4.Locked = True
Combo1.Locked = True
Text5.Locked = True
Text7.Locked = True
Text8.Locked = True
Text9.Locked = True
Text6.Locked = True
End Sub

ATM LOGIN FORM:


Option Explicit
Public flag1 As Integer
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdok_Click()
If txtUserName = "manager" Or txtUserName = "MANAGER" Then
If txtPassword = "tiger" Or txtPassword = "TIGER" Then
flag1 = 1
End If
End If

If txtUserName = "MANJU" Or txtUserName = "manju" Then


If txtPassword = "ATM" Or txtPassword = "atm" Then
ProgressBar1.Visible = True
timer1.Enabled = True
txtUserName.Visible = False
txtPassword.Visible = False
cmdOK.Visible = False

cmdCancel.Visible = False
lblLabels(0).Visible = False
lblLabels(1).Visible = False
Label1.Visible = True
Label2.Visible = True
flag1 = 0
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
txtPassword = ""
End If
Else
MsgBox "Invalid user, try again!", , "Login"
txtUserName.SetFocus
txtUserName = ""
End If
End Sub

Private Sub Form_Load()


End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value < 100 Then

ProgressBar1.Value = ProgressBar1.Value + 1
Label2.Caption = ProgressBar1.Value & " % completed"
Else
Unload Me
MDIForm1.Show
Exit Sub
End If

End Sub

AMOUNT DEPOSIT FORM:


Option Explicit
Public flag1 As Integer
Private Sub cmdCancel_Click()
End
End Sub

Private Sub cmdok_Click()


If txtUserName = "manager" Or txtUserName = "MANAGER" Then
If txtPassword = "tiger" Or txtPassword = "TIGER" Then
flag1 = 1
End If
End If
If txtUserName = "MANJU" Or txtUserName = "manju" Then
If txtPassword = "ATM" Or txtPassword = "atm" Then
ProgressBar1.Visible = True
timer1.Enabled = True
txtUserName.Visible = False
txtPassword.Visible = False
cmdOK.Visible = False

cmdCancel.Visible = False
lblLabels(0).Visible = False
lblLabels(1).Visible = False
Label1.Visible = True
Label2.Visible = True
flag1 = 0
Else

MsgBox "Invalid Password, try again!", , "Login"


txtPassword.SetFocus
txtPassword = ""
End If
Else
MsgBox "Invalid user, try again!", , "Login"
txtUserName.SetFocus
txtUserName = ""
End If
End Sub
Private Sub Form_Load()
End Sub

Private Sub Timer1_Timer()


If ProgressBar1.Value < 100 Then
ProgressBar1.Value = ProgressBar1.Value + 1
Label2.Caption = ProgressBar1.Value & " % completed"
Else
Unload Me
MDIForm1.Show
Exit Sub
End If

End Sub

FAST CASH FORM:


Private cn As New ADODB.Connection
Private rs As New ADODB.Recordset
Private rs1 As New ADODB.Recordset
Private rs2 As New ADODB.Recordset

Private Sub cmdexit_Click()


form8.Show
Unload Me
End Sub

Private Sub cmdok_Click()


Dim str As String
cn.Open "dsn=ATM;uid=ATM;pwd=ATM"
rs.Open "select bal,with_drawl,fast_amt,acc_type from ACCOUNT where cdno=" & cno, cn,
adOpenDynamic, adLockOptimistic
rs1.Open "select nvl(max(fast_amt),0) from ACCOUNT where cdno=" & cno, cn, adOpenDynamic,
adLockOptimistic
rs2.Open "SELECT TRANS_DATE TIME FROM TRANS WHERE CDNO=" & cno, cn, adOpenDynamic,
adLockOptimistic
If rs(3) = "SAVINGS ACCOUNT" Then
Dim days As Date
Dim i As Double
days = DateDiff("d", rs2(0), Date)

If days = 0 Then
If ((rs(1) + rs(2)) - form8.d) >= 10000 Then
MsgBox "your can't withdraw more than 10,000 on same day " & rs(0), , "MESSAGE"
Unload Me

form8.Show
Else
If opt1000.Value = True And rs(0) >= 1500 Then
cn.Execute ("update ACCOUNT set bal=bal-1000,FAST_AMT=" & 1000 + rs1(0) & "where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 1000, , "MESSAGE"

Else If opt2000.Value = True And rs(0) >= 2500 Then


cn.Execute ("update ACCOUNT set bal=bal-2000,FAST_AMT=" & 2000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 2000, , "MESSAGE"
Else If Opt3000.Value = True And rs(0) >= 3500 Then
cn.Execute ("update ACCOUNT set bal=bal-3000,FAST_AMT=" & 3000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 3000, , "MESSAGE"

ElseIf Option1.Value = True And rs(0) >= 4500 Then


cn.Execute ("update ACCOUNT set bal=bal-4000,FAST_AMT=" & 4000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 4000, , "MESSAGE"

ElseIf Opt5000.Value = True And rs(0) >= 5500 Then


cn.Execute ("update ACCOUNT set bal=bal-5000,FAST_AMT=" & 5000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 5000, , "MESSAGE"
Else

MsgBox "U can't make transaction becouse ur balance is " & rs(0), , "MESSAGE"
End If
End If
End If
Else
If opt1000.Value = True And rs(0) >= 1000 Then

cn.Execute ("update ACCOUNT set bal=bal-1000,FAST_AMT=" & 1000 + rs1(0) & "where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 1000, , "MESSAGE"

ElseIf opt2000.Value = True And rs(0) >= 2000 Then


cn.Execute ("update ACCOUNT set bal=bal-2000,FAST_AMT=" & 2000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 2000, , "MESSAGE"

ElseIf Opt3000.Value = True And rs(0) >= 3000 Then


cn.Execute ("update ACCOUNT set bal=bal-3000,FAST_AMT=" & 3000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 3000, , "MESSAGE"

ElseIf Option1.Value = True And rs(0) >= 4000 Then


cn.Execute ("update ACCOUNT set bal=bal-4000,FAST_AMT=" & 4000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 4000, , "MESSAGE"

ElseIf Opt5000.Value = True And rs(0) >= 5000 Then

cn.Execute ("update ACCOUNT set bal=bal-5000,FAST_AMT=" & 5000 + rs1(0) & " where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "Now UR balance is " & rs(0) - 5000, , "MESSAGE"
Else
MsgBox "U can't make transaction becouse ur balance is " & rs(0), , "MESSAGE"

Unload Me
form8.Show
End If
End If
Unload Me
form8.Show
cn.Close
Set rs = Nothing
Set rs2 = Nothing
End Sub

Private Sub Form_Load()


Label2.Caption = FormatDateTime(Date, 1)
Label3.Caption = Time
End Sub

CASH WITHDRAW FORM:


Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset

Dim cn2 As New ADODB.Connection


Dim t As Date
Private Sub cmdCancel_Click()
Text1.Text = ""
form8.Show
Unload Me

End Sub
Private Sub cmdok_Click()
If Text1.Text = "" Then
MsgBox "PLEASE ENTER THE AMOUNT TO WITH DRAW", vbInformation, "ATM"
Text1.SetFocus
End If
cn.Open "dsn=ATM", "ATM", "ATM"
Set rs1 = Nothing
rs.Open "SELECT BAL,ACC_TYPE,DEP_DATE,with_drawl,fast_amt FROM ACCOUNT WHERE
CDNO=" & cno, cn, adOpenDynamic, adLockOptimistic
rs1.Open "select nvl(with_drawl,0) from ACCOUNT where cdno=" & cno, cn, adOpenDynamic,
adLockOptimistic
rs2.Open "SELECT trans_date FROM trans WHERE CDNO=" & cno, cn, adOpenDynamic,
adLockOptimistic
If rs(1) = "SAVINGS ACCOUNT" Then
If Val(Text1.Text) >= 100 And Val(Text1.Text) <= 5000 Then
If Val(rs(0) - Val(Text1.Text)) >= 500 Then

Dim days As Date


Dim i As Double
days = DateDiff("d", rs2(0), Date)
If days = 0 Then
If ((rs(3) + rs(4)) - form8.d) >= 10000 Then
MsgBox "your can't withdraw more than 10,000 on same day " & rs(0), , "MESSAGE"

Text1.Text = ""
Unload Me
form8.Show
Else
If Val(Text1.Text) >= 100 And Val(Text1.Text) <= 5000 Then
If Val(rs(0) - Val(Text1.Text)) >= 500 Then

cn.Execute ("update ACCOUNT set bal=" & rs(0) - Val(Text1) & ",with_drawl=" & rs1(0) + Val(Text1) &
"where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME=
'" & Label3.Caption & "'where cdno=" & cno)
MsgBox "NOW UR BALANCE IS " & rs(0) - Val(Text1), , "ATM"
Text1.Text = ""
Unload Me
form8.Show
Else
MsgBox "U can't make transaction becouse ur balance is " & rs(0), , "MESSAGE"
Text1.Text = ""
Unload Me
form8.Show
End If
Else
MsgBox "Ur limit only between 100 to 5000", vbOKOnly, "CRITICAL"
Text1.Text = ""
Unload Me
form8.Show
End If
End If
Else

cn.Execute ("update ACCOUNT set bal=" & rs(0) - Val(Text1) & ",with_drawl=" & rs1(0) +
Val(Text1) & "where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME=
'" & Label3.Caption & "'where cdno=" & cno)
MsgBox "NOW UR BALANCE IS " & rs(0) - Val(Text1)
Text1.Text = ""
Unload Me

form8.Show
End If
Else
MsgBox "U can't make transaction becouse ur balance is " & rs(0), , "MESSAGE"
Text1.Text = ""
Unload Me
form8.Show
End If
Else
MsgBox "Ur limit only between 100 to 5000", vbOKOnly, "CRITICAL"
Text1.Text = ""
Text1.SetFocus
End If
Else

If Val(rs(0) - Val(Text1.Text)) >= 0 Then


cn.Execute ("update ACCOUNT set bal=" & rs(0) - Val(Text1) & ",with_drawl=" & rs1(0) + Val(Text1) &
"where cdno=" & cno)
cn.Execute ("UPDATE TRANS SET trans_date='" & Format(Date, "DD-MMM-YYYY") & "',TIME= '" &
Label3.Caption & "'where cdno=" & cno)
MsgBox "NOW UR BALANCE IS " & rs(0) - Val(Text1), , "ATM"
Text1.Text = ""
Unload Me

form8.Show
Else
MsgBox "U can't make transaction becouse ur balance is " & rs(0), , "MESSAGE"
Unload Me
form8.Show
End If

End If
cn.Close
End Sub
Private Sub Form_Load()
cn2.Open "dsn=ATM", "ATM", "ATM"
Label1.Caption = FormatDateTime(Date, 1)
Label3.Caption = Time
rs3.Open "SELECT BAL,ACC_TYPE,DEP_DATE FROM ACCOUNT WHERE CDNO=" & cno, cn2,
adOpenDynamic, adLockOptimistic
Label5.Caption = rs3(1)
Set rs3 = Nothing
cn2.Close
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)


If (((KeyAscii < 48) Or (KeyAscii > 57)) And Not (KeyAscii = 8)) Then
KeyAscii = 0
End If
End Sub

PIN CHANGE FORM:


Private cn As New ADODB.Connection

Private rs As New ADODB.Recordset


Private Sub cmdCancel_Click()
form8.Show
Unload Me
End Sub

Private Sub cmdok_Click()


If txtpinent.Text = "" Then
MsgBox "PLEASE ENTER THE PIN TO BE CHANGED", vbInformation, "ATM"
txtpinent.SetFocus
Else
If Len(txtpinent) < 4 Then
MsgBox "pin number should be equal to 4 characters"
txtpinent.SetFocus
txtpinent = ""
Exit Sub
End If
Dim str As String
str = "dsn=ATM;uid=ATM;password=ATM"
cn.ConnectionString = str
cn.Open
cn.Execute ("update customer set pin='" & txtpinent & "' where cdno=" & cno)
cn.Close
MsgBox "Ur pin number has been changed ur pin number is " & Trim(txtpinent)
Unload Me
form8.Show
End If
End Sub

Private Sub Form_Load()


Label1.Caption = FormatDateTime(Date, 1)
Label2.Caption = Time
End Sub
Private Sub txtpinent_KeyPress(KeyAscii As Integer)
If KeyAscii = 32 Then

KeyAscii = 0
End If
End Sub

BALANCE REPORT FORM:


Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub cmdexit_Click()
form8.Show
Unload Me
rs.Close
cn.Close
End Sub
Private Sub cmdprint_Click()
MsgBox "Printer is not connected", vbCritical, "ATM"
End Sub
Private Sub Form_Load()
datetxt.Text = FormatDateTime(Date, 1)
timetxt.Text = Time
cn.Open "dsn=ATM", "ATM", "ATM"
rs.Open "select acc_type,bal,deposit_amt,with_drawl,fast_amt from ACCOUNT where cdno=" & cno, cn,
adOpenDynamic, adLockOptimistic

rs2.Open "SELECT TRANS_DATE,TIME FROM TRANS WHERE CDNO=" & cno, cn, adOpenDynamic,
adLockOptimistic
cnotxt.Text = "S\B\I" & cno
txtacc.Text = rs(0)
txtava.Text = rs(1)
txtres.Text = rs(2) - form8.a
Text3.Text = (rs(3) + rs(4)) - form8.d

b = Val(Text3)
Text1.Text = rs2(0)
Text2.Text = rs2(1)
End Sub
Private Sub Timer1_Timer()
End Sub

AMOUNT TRANSFER FORM:


Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub cmdexit_Click()
form8.Show
Unload Me
rs.Close
cn.Close
End Sub

Private Sub cmdprint_Click()


MsgBox "Printer is not connected", vbCritical, "ATM"
End Sub
Private Sub Form_Load()

datetxt.Text = FormatDateTime(Date, 1)
timetxt.Text = Time
cn.Open "dsn=ATM", "ATM", "ATM"
rs.Open "select acc_type,bal,deposit_amt,with_drawl,fast_amt from ACCOUNT where cdno=" & cno, cn,
adOpenDynamic, adLockOptimistic
rs2.Open "SELECT TRANS_DATE,TIME FROM TRANS WHERE CDNO=" & cno, cn, adOpenDynamic,
adLockOptimistic
cnotxt.Text = "S\B\I" & cno

txtacc.Text = rs(0)
txtava.Text = rs(1)
txtres.Text = rs(2) - form8.a
Text3.Text = (rs(3) + rs(4)) - form8.d
b = Val(Text3)
Text1.Text = rs2(0)
Text2.Text = rs2(1)
End Sub
Private Sub Timer1_Timer()
End Sub

Private Sub cmdprint_Click()


MsgBox "Printer is not connected", vbCritical, "ATM"
End Sub
Private Sub Form_Load()
datetxt.Text = FormatDateTime(Date, 1)
timetxt.Text = Time

cn.Open "dsn=ATM", "ATM", "ATM"


rs.Open "select acc_type,bal,deposit_amt,with_drawl,fast_amt from ACCOUNT where cdno=" & cno, cn,
adOpenDynamic, adLockOptimistic
rs2.Open "SELECT TRANS_DATE,TIME FROM TRANS WHERE CDNO=" & cno, cn, adOpenDynamic,
adLockOptimistic

cnotxt.Text = "S\B\I" & cno


txtacc.Text = rs(0)
txtava.Text = rs(1)
txtres.Text = rs(2) - form8.a
Text3.Text = (rs(3) + rs(4)) - form8.d
b = Val(Text3)
Text1.Text = rs2(0)

Text2.Text = rs2(1)
End Sub

Private Sub Timer1_Timer()


End Sub

CUSTOMER ENQUIRY FORM:


Private cn As New ADODB.Connection
Private rs As New ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "PLEASE ENTER YOUR CARD NUMBER", vbInformation, "ATM"
Text1.SetFocus
Else
Dim flag As Integer
flag = 0
Dim a As Integer
a = Val(Text1.Text)
cn.Open "dsn=ATM;uid=ATM;pwd=ATM"
Set rs = Nothing
rs.Open "select cdno,cna from customer", cn, adOpenDynamic, adLockBatchOptimistic
rs.MoveFirst

While rs.EOF <> True


If Val(Text1) = rs(0) Then
flag = 1
End If
rs.MoveNext
Wend
If flag = 1 Then

Unload Me
DataEnvironment1.Connection1.Open
DataEnvironment1.Command5 a
DataReport4.Refresh
DataReport4.Show
DataEnvironment1.Connection1.Close
Else
MsgBox "PLEASE TYPE CORRECT CARD NUMBER", vbExclamation, "ATM"
Text1 = ""
Text1.SetFocus
End If
cn.Close
End If
End Sub

Private Sub Command2_Click()


Text1.Text = ""
MDIForm1.Show
Unload Me
End Sub

Private Sub Form_Load()

Label3.Caption = FormatDateTime(Date, 1)
Label4.Caption = Time
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If ((KeyAscii <= 90 And KeyAscii >= 65) Or (KeyAscii <= 122 And KeyAscii >= 97) Or (KeyAscii < 48)
And Not (KeyAscii = 8)) Then
KeyAscii = 0

End If
End Sub

ATM BANKING FORM:


Private Sub Text1_Change()
End Sub
Private Sub Command1_Click()
Unload Me
MDIForm1.Show
End Sub

Private Sub Form_Load()


End Sub

NEW ACCOUNT FORM:


Private Sub Text1_Change()
End Sub
Private Sub Command1_Click()
Unload Me
MDIForm1.Show
End Sub

Private Sub Form_Load()


End Sub

TOUCH SCREEN TRANSACTION FORM:


Private cn As New ADODB.Connection
Private rs As New ADODB.Recordset

Public a As Integer
Public b As String
Private Sub cmdok_Click()
If txtentcdno.Text = "" Then
MsgBox "PLEASE ENTER YOUR CARD NUMBER", vbInformation, "ATM"
txtentcdno.SetFocus
Else
Dim flag As Integer
cn.Open "dsn=ATM;uid=ATM;pwd=ATM"
Set rs = Nothing
rs.Open "select cdno,cna from customer", cn, adOpenDynamic, adLockBatchOptimistic
rs.MoveFirst
While rs.EOF <> True
If Val(Right(txtentcdno, 4)) = rs(0) Then
flag = 1
a = rs(0)
b = rs(1)
cno = rs(0)
End If
rs.MoveNext
Wend
If flag = 1 Then

Unload Me
form7.Show
Else
MsgBox "PLEASE TYPE CORRECT CARD NUMBER.", vbExclamation, "ATM"
txtentcdno = ""
txtentcdno.SetFocus
End If

cn.Close
End If
End Sub
Private Sub Comcancel_Click()
MDIForm1.Show
Unload Me
End Sub

Private Sub Form_Load()


End Sub
Private Sub txtentcdno_KeyPress(KeyAscii As Integer)
If ((KeyAscii <= 90 And KeyAscii >= 65) Or (KeyAscii <= 122 And KeyAscii >= 97) Or (KeyAscii < 48)
And Not (KeyAscii = 8)) Then
KeyAscii = 0
End If
End Sub

PASSWORD SCREEN FORM:


Private cn As New ADODB.Connection
Private rs1 As New ADODB.Recordset
Private rs2 As New ADODB.Recordset
Dim flag As Integer

Public i As Integer
Private Sub cmdCancel_Click()
On Error Resume Next
MDIForm1.Show
cn.Close
rs1.Close
Unload Me

Unload form6
End Sub
Private Sub cmdok_Click()
If txtpinent.Text = "" Then
MsgBox "PLEASE ENTER YOUR PIN NUMBER", vbInformation, "ATM"
txtpinent.SetFocus
Else
cn.Open "dsn=ATM;uid=ATM;pwd=ATM"
rs1.Open "select pin from customer where cdno=" & form6.a, cn, adOpenDynamic, adLockOptimistic
If rs1(0) = txtpinent.Text Then
form8.Show
Unload Me
Unload form6
Else
MsgBox "INVALID PIN", vbExclamation, "ATM"
txtpinent.Text = ""
txtpinent.SetFocus
End If
cn.Close
End If
End Sub

Private Sub Form_Load()


lblname = form6.b
End Sub

Private Sub timer5_Timer()


End Sub

TRANSACTION FORM:
Public a As Double
Public b As Double
Public c As Double
Public d As Double
Dim cn1 As New ADODB.Connection
Dim r As New ADODB.Recordset

Private Sub cmddep_Click()


form10.Show
form8.Hide
End Sub

Private Sub CMDREP_Click()


DataEnvironment1.Connection1.Open
DataEnvironment1.Command1 cno
DataReport1.Refresh
DataReport1.Show
DataEnvironment1.Connection1.Close
End Sub

Private Sub Combal_Click()


form15.Show
form8.Hide
End Sub

Private Sub Comcashwi_Click()


Me.Hide

form13.Show
End Sub

Private Sub Comfast_Click()


form11.Show
form8.Hide
End Sub

Private Sub Comoth_Click()


Comoth.Enabled = False
End Sub

Private Sub Command1_Click()


form6.txtentcdno = ""
Unload Me
Unload form6
Unload form7
MDIForm1.Show
End Sub

Private Sub Compinch_Click()


form14.Show

form8.Hide
End Sub

Private Sub Comtran_Click()


Form17.Show
form8.Hide
End Sub

Private Sub Form_Load()


cn1.Open "dsn=ATM", "ATM", "ATM"
r.Open "select acc_type,bal,deposit_amt,with_drawl,fast_amt from ACCOUNT where cdno=" & cno, cn1,
adOpenDynamic, adLockOptimistic
a = r(2)
b = r(3)
c = r(4)
d=b+c
Label1.Caption = FormatDateTime(Date, 1)
Label2.Caption = Time
cn1.Close
Set r = Nothing
End Sub

HELLO CUSTOMER SCREEN FORM:


Private Sub Command1_Click()
Unload Me
MDIForm1.Show
End Sub

Private Sub Label2_Click()


End Sub

Private Sub Text2_Change()


End Sub

ATM MAIN SCREEN FORM:


Private Sub b_Click()
form5.Show

End Sub

Private Sub c_Click()


Me.Hide
Form9.Show
End Sub
Private Sub e_Click()
Dim s As String
s = MsgBox("Do u want to close the application", vbYesNo, "Close....")
If s = vbYes Then
MsgBox "Thank U,Good Bye", , "ATM"
End
Else
Exit Sub
End If
End Sub

Private Sub g_Click()


Unload Me
form6.Show
End Sub
Private Sub h_Click()

Form3.Show
End Sub

Private Sub j_Click()


Dim i As String
Dim j As Integer
Do

i = InputBox("ENTER THE PASSWORD", "LOGIN")


j=j+1
Loop Until i = "TIGER" Or i = "tiger" Or j = 3
If j < 3 Then
customer.Show
Else
j=0
End If
End Sub

Private Sub k_Click()


End Sub
Private Sub m_Click()
Dim i As String
Dim j As Integer
Do
i = InputBox("ENTER THE PASSWORD", "LOGIN")
j=j+1
Loop Until i = "TIGER" Or i = "tiger" Or j = 3
If j < 3 Then
DataEnvironment1.Connection1.Open
DataEnvironment1.Command3

DataReport3.Refresh
DataReport3.Show
DataEnvironment1.Connection1.Close
Else
j=0
End If
End Sub

Private Sub MDIForm_Load()


End Sub
Private Sub n_Click()
Dim i As String
Dim j As Integer
Do
i = InputBox("ENTER THE PASSWORD", "LOGIN")
j=j+1
Loop Until i = "TIGER" Or i = "tiger" Or j = 3
If j < 3 Then
DataEnvironment1.Connection1.Open
DataEnvironment1.Command2
DataReport2.Refresh
DataReport2.Show
DataEnvironment1.Connection1.Close
Else
j=0
End If
End Sub
Private Sub p_Click()
Unload Me
Form4.Show

End Sub

Private Sub q_Click()


form2.Show
End Sub

Conclusion

ATM system will maintain the information about


the customer who makes transaction. Bank
automation system, this package is intended to
use options like opening bank account of
various types for the customer and also
maintaining their transaction details as well as
their personal details, time to time calculating
the interest of their deposit amount and after
withdrawing amount what is their balance
amount and for the fixed deposit account its
calculating the maturity date and maturity
amount according to rate of interest and
number of months.
Since A.T.M is started all activities like deposit,
withdrawing the amount, updating new
customer and accounts of banks etc. are done
manually. Due to increase of no of vehicles it
has became difficult to maintain all the
activities manually. All the details of A.T.M are

maintained using database where saving,


Deposit can be done. It is enough if the user
has the fundamental idea of using the computer
to handle this package efficiently.
And they realize that computer will reduce the
errors and improve the service to the peoples.
The various activities carried out by this
software are,
Creating a new account.
Maintaining with the previous customer.
Maintaining account detail.
Maintaining the transaction detail.
Checking the balance enquiry.
Printing the report.

Bibliography

1.Programming Microsoft Visual Basic 6.0


Author: Francesco balena
Publisher: Microsoft press

2.Visual basic from the ground up


Author: Gary Cornell
Publisher: Osborne McGraw hill

3.Visual Basic programmers guide


Author: Dan Apple man
Publisher: Sams

4.Database access with Visual Basic 6.0


Author: Jeffrey P.Mcmanus
Publisher: Sams

5.Using Oracle 8/8i


Author: William G.Page
Publisher: QUE

You might also like