Professional Documents
Culture Documents
PROJECT REPORT
ON
Submitted By:--
Acknowledgement
I am thankful to Mr. .. (Final student of MCA from SMU) who helps me to develop this project. My hard work and sincerity help me to overcome the problem that came on the way. Finally I am very grateful to Mr. .. who gives knowledge about the data flow of the project. It is my pleasant duty to thank all the staff member of the computer center who never hesitated me from time during the project. Finally, I gratefully acknowledge the support, encouragement & patience of my family, And as always, nothing in my life would be possible without God, Thank You!
..
CERTIFICATE
This is to certify that the project titled ___________ ________________ _______________ ___________ is a bonafied work carried out by Mr./ Ms. _____________ _________________ ________________ in partial execution of the from requirement for the award of the degree of ____________ ____________ __________ _______________ ______________ University under the guidance and direction.
Acknowledgement Certificate Introduction Objective Project Category Tool/ Environment Analysis and Design Program Structure Coding Documentation Future Application References
2 3 5 6 7 15 16 17 21 53 54 55
INTRODUCTION
4
During the past several decades personnel function has been transformed from a relatively obscure record keeping staff to central and top level management function. There are many factors that have influenced this transformation like technological advances, professionalism, and general recognition of human beings as most important resources. A computer based management system is designed to handle all the primary information required to calculate monthly statements of customer account which include monthly statement of any month. Separate database is maintained to handle all the details required for the correct statement calculation and generation. This project intends to introduce more user friendliness in the various activities such as record updation, maintenance, and searching. The searching of record has been made quite simple as all the details of the customer can be obtained by simply keying in the identification or account number of that customer. Similarly, record maintenance and updation can also be accomplished by using the account number with all the details being automatically generated. These details are also being promptly automatically updated in the master file thus keeping the record absolutely up-to-date. The entire information has maintained in the database or Files and whoever wants to retrieve cant retrieve, only authorization user can retrieve the necessary information which can be easily be accessible from the file.
A computer based management system is designed to handle all the primary information required to calculate monthly statements of customer account which include monthly statement of any month. Separate database is maintained to handle all the details required for the correct statement calculation and generation. This project intends to introduce more user friendliness in the various activities such as record updation, maintenance, and searching. The searching of record has been made quite simple as all the details of the customer can be obtained by simply keying in the identification or account number of that customer. Similarly, record maintenance and updation can also be accomplished by using the account number with all the details being automatically generated. These details are also being promptly automatically updated in the master file thus keeping the record absolutely up-to-date. The main objective of our project is providing the different typed of customers facility, the main objective of this system is to find out the actual customer service. Etc. It should fulfill almost all the process requirements of any Bank. It should be user friendly. It should increase the productivity of bank by utilizing the working hours more and more, with minimum manpower. This project includes the entire upgraded feature required for the computerization banking system. This system is very easy to use, so that any user can use without getting pre-knowledge about this. Its very much user friendly and meet almost all daily working process requirements. This system is completely GUI based and can be use by mouse and as well as keyboard. This system is melded in such a way that has got all features to upgrade without making much change in existing components. The entire information has maintained in the database or Files and whoever wants to retrieve cant retrieve, only authorization user can retrieve the necessary information which can be easily be accessible from the file.
PROJECT CATEGORY
Inconsistent as it is, try to mimic Visual Basic's own error handling scheme as much as possible. When you call a Visual Basic routine that can fail, what is the standard way that the routine signals the failure to you? It probably won't be via a return value. If it were, procedures, for one, would have trouble signaling failure. Most (but not all) routines raise an error (an exception) when they want to signal failure. (This applies to procedures, functions, and methods.) For example, Create Object raises an exception if it cannot create an objectfor whatever reason; Open does the same if it cannot open a file for you. (Not all routines raise such exceptions. For example, the Choose function returns Null [thus, it requires a Variant to hold its return value just in case it ever fails] if you index into it incorrectly.) In other words, if a routine works correctly, this fact is signaled to the caller by the absence of any error condition. Routines such as Open work like this primarily so that they can be used more flexibly. For example, by not handling the error internally, perhaps by prompting the user in some way, the caller is free to handle errors in the most suitable way.
Mainframe databases such as IMS and DB2 Server databases such as Oracle and SQL Server Desktop databases such as Access, Paradox, and FoxPro 7
Information stored in file systems for Windows NT or UNIX Indexed-sequential files E-mail systems such as Exchange Spreadsheets, project management tools, and many other sources
Components of OLE DB
Data Consumers
Data consumers are applications that use the data exposed by data providers. ADO is the programmatic interface for using OLE DB data. Examples of consumers include high-level data access models such as ADO, business applications written in development tools such as Visual Basic, C++, or Java, and development tools themselves. Any application that uses ADO is an OLE DB data consumer.
Service Components
Service components are elements that process and transport data and extend the functionality of data providers. For example, a cursor engine is a service component that can consume data from a sequential, forward-only data source to produce scrollable data. Service components are designed to integrate efficiently to help OLE DB component vendors develop high-quality OLE DB components.
Data Providers
Data providers are applications, such as Microsoft SQL Server or Exchange. This includes operating system components, such as a file system, indexed-sequential files, spreadsheets, document stores, and mail files that have data that other applications may need to access. These data providers expose OLE DB interfaces that service components or data consumers can access directly. There is also an OLE DB provider for ODBC. This provider makes any ODBC data available to OLE DB data consumers. However, OLE DB is not dependent on ODBC.
the spreadsheet; the spreadsheet only needs to know how to expose its services for other software components to connect.
10
application and component objects to communicate with each other regardless of the language or development tool in which they were created.
Reusability Once you create a COM component, other developers can use it. This enables easy access to your component's features in other applications without requiring developers to write extensive code.
Reduced complexity You can create a COM component to hide programming complexity from other programmers. Other programmers need only know what information to provide to your component, and what information to retrieve.
Easier updating Components make it easier for you to revise and update your applications. For example, you can create a COM component that encapsulates business rules. If the business rules change, you update just the component, not all the applications that use the component. When you use COM components in a Visual Basic project, you do not have to
understand all of the mechanics involved in making these components work together. It is more important to know how to use the component that adds the functionality you
11
need to your application. You can find detailed information about COM at http://www.microsoft.com/com/default.asp.
Class Modules
Class modules (.cls files) are the foundation of object-oriented programming in Visual Basic. They are analogous to a blueprint for a house. Just as a house is built from a blueprint, new objects are created from class modules. These new objects include your own customized properties and methods. A class module is similar to a standard code module (.bas file) because both contain functionality that can be used by other modules within the application. The difference is that a class module provides functionality in the form of an object:
Data in a standard module has program scope, which means that it exists for the life of your program. Class module data exists for each object that is created from the class. Each object's data exists only for the lifetime of the object; it is created when the object is created, and destroyed when the object is destroyed.
Variables declared as public in a standard module are visible from anywhere in your project. Variables declared as public in a class module can only be accessed by referencing a particular instance of a class or object. Most commonly, class modules exist in code components. A code component
can be thought of as a container for multiple classes. For example, you could create a "vehicles" code component that contains multiple classes; these classes can be used to create objects such as cars, trucks, and vans. A client application uses a code component by creating an object from one of the classes the component provides, and invoking the object's properties, methods, and events.
12
objects. These are created from class modules in Visual Basic. A COM component exposes objects that can be used by other applications. Visual Basic handles much of the complexity of creating COM .exe and .dll files. You can create three types of COM components with Visual Basic:
ActiveX Controls ActiveX controls (formerly known as OLE controls) are standard user-interface elements that allow you to rapidly assemble reusable forms and dialog boxes.
Active Documents Active documents are COM components that must be hosted and activated within a document container. Active document technology is an extension to OLE documents. It enables generic shell applications, such as Microsoft Internet Explorer, to host different types of documents.
ActiveX Code components AcitveX Code components (COM executable programs and DLLs) are groups, called libraries, of classes. Client applications use COM objects by creating instances of classes provided by the COM .exe or .dll file. Client applications call the properties, methods, and events provided by each COM object. In Visual Basic, the project templates you use to create a COM components are referred to as ActiveX EXEs and ActiveX DLLs.
13
MS-Access:-I have used MS.ACCESS for database. It is a RDBMS Package developed by Microsoft. It is a relational database management system That efficiently stores, retrieves and manages large amounts of data.
14
Hardware Specifications
15
Hardware is a set of physical components, which performs the functions of applying appropriate, predefined instructions. In other words, one can say that electronic and mechanical parts of computer constitute hardware. This package is designed on a powerful programming language Visual Basic. It is a powerful Graphical User Interface. The backend is ACCESS, which is used to maintain database. It can run on almost all the popular microcomputers. The following are the minimum hardware specifications to run this package: -
Hardware requirement:
Personal Computer: It minimum contains P-III processor with 128 MB RAM.
Software Requirements:
The software is a set of procedures of coded information or a program which when fed into the computer hardware, enables the computer to perform the various tasks. Software is like a current inside the wire, which cannot be seen but its effect can be felt. 1. Operating System:- Windows NT / 2000 / XP 2. Application Software:- Application software uses front end visual basic and database access etc. Editor:- Visual basic.
16
To develop software which maintains all the record of day to day -Open Account, Close or Edit Account, Monthly Statement, Bank summary and Transaction detail etc. All the record and information is going to be store in Microsoft Access Database Draw the following conclusion:The project consists of four parts mainly
1. Open Account: It consists of new bank account form. A consist new enquiry information who come to the bank for enquiry about new account (saving, current). Then he or she fill up the new account form according to their account number generated automatically and also generate cheui no automatically.
2. Close or Edit Account:It consists or provides editing and closing account form and also such particular account information.
3. Monthly Statement: It consists of two sided form monthly statement of bank employee and monthly statement of saving and current account employee.
4. Bank Summary: It consists of all information detail of bank employee account transaction detail summary, recode of all branches and also record of draft and chewy.
17
Program Structure
The detail structure and description of table are as follows: Table Structure and Description:
1.
Account: Account Fieldname Actno Name Address Phone Act type City Date Chequebook Field Type Number Text Text Number Text Text Date/time Yes/no Field size Long int 50 50 Double 20 50 Medium date Constraint Primary
18
This table is used to maintain open account details. Where employee come from new account. Which keep all information about employee. Here act no define primary key.
19
ii. Account Type: Account type Field type Text Text Number
Constraint
This table is used for which type of account opens a employee, type of account saving or current account and also give a account type code. iii. Balance table: -
Constraint
This table the balance of all type of account, saving or current account.
20
iv. Cheque Table: Cheque table Field type Number Number Number
Constraint
This table content all account detail and if you open new account and chose cheque option so give cheque no of your account. v. Pass table: -
Field size 50 50
Constraint
Constraint
This table show the tamp let of all account information and transaction of per day of bank.
21
Vii. Transaction.1 table: Transaction table Field name Actno Tran type Amount act Type Chequeno Date Time Field type Number Text Number Text Number Date/time Date/time Field size Long int 50 Long int 50 Long int Default Default Constraint Primary
This table contains all per day transaction of bank and also summarized all money transaction updating and editing.
22
Data structure
Diagram (Design) :- Designing if system demonstrates the exact flow of I-P-O cycle of the system. I-P-O cycle is Input-Process-Output cycle of the system, where we need to define what are input we need to take to produced the output, which is our requirements. According to this input and output we design the processing phase. There are lot of category define to design the system few of them are begin discus here.
23
New customer
Control Management
24
Proces s
Account Details
CODING
25
_____________________________________________________________________
26
Private Sub Form_Click() Unload Me LoginForm.Show 1 'Form6.Show End Sub Private Sub Form_Load() Timer1.Interval = 3000 End Sub Private Sub Timer1_Timer() Unload Me LoginForm.Show 1 'Form6.Show End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
Login Form:--
27
____________________________________________________________________________________
Dim rs As New ADODB.Recordset Private Sub CancelButton_Click() Unload Me End Sub Private Sub Form_Load() rs.ActiveConnection = cn If rs.State = 1 Then rs.Close 28
rs.CursorLocation = adUseClient rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Open "select * from Pass" rs.MoveFirst While Not rs.EOF = True Combo1.AddItem rs(0) rs.MoveNext Wend Combo1.ListIndex = 0 End Sub Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) End Sub
Private Sub OkButton_Click() If rs.State = 1 Then rs.Close rs.Open "select pswd from pass where name = '" & Combo1.Text & "'" If rs!pswd = Text1.Text Then Me.Caption = "Password Success" GoTo 1 Else Me.Caption = "Invalid Password" Text1.Text = " " Text1.SetFocus Exit Sub End If 1: Call ShowForm End Sub
29
Private Sub ShowForm() If Combo1.Text = "Employee" Then Unload Me Form1.Show Form1.BnkButton.Enabled = False ElseIf Combo1.Text = "Guest" Then Unload Me
Form1.Show Form1.AcButton.Enabled = False Form1.BnkButton.Enabled = False Form1.TrButton.Enabled = False Form1.AcClButton.Enabled = False ElseIf Combo1.Text = "Manager" Then Unload Me Permission = 1 'For Account Permission Clos account Form1.Show End If End Sub
30
Main Form:--
___________________________________________________________________________________ _
Private Sub AcButton_Click() 'Unload Me Form2.Top = 3000 Form2.Left = 4000 Form2.Show End Sub Private Sub AcClButton_Click() 'Unload Me Form3.Top = 3000 Form3.Left = 4000 Form3.Show End Sub Private Sub BackButton_Click() 'Unload Me LoginForm.Top = 3000 LoginForm.Left = 4000 LoginForm.Show End Sub Private Sub BnkButton_Click() 'Unload Me Form5.Top = 3000 Form5.Left = 4000 Form5.Show End Sub Private Sub ExButton_Click()
32
Unload Me End Sub Private Sub Picture1_Click() End Sub Private Sub StmtButton_Click() 'Unload Me Form6.Top = 3000 Form6.Left = 4000 Form6.Show End Sub Private Sub TrButton_Click() 'Unload Me Form4.Top = 3000 Form4.Left = 4000 Form4.Show End Sub ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
33
___________________________________________________________________________________ ___
34
Dim a As Integer Private Sub Check1_Click() End Sub Private Sub Command1_Click() Dim sstr, s As String Dim rst As New ADODB.Recordset rst.Open "Select max(actno) from Account", cn, adOpenKeyset, adLockOptimistic, cmdtext a = rst(0) + 1 If CheckField = True Then s = Text1.Text If Check1.Value = 1 Then sstr = "insert into account " sstr = sstr + "values(" & a & ",'" & Text1.Text & "', '" & Text3.Text & "', " sstr = sstr + " " & Text2.Text & " ,'" & Combo1.Text & "' ,'" & Text6.Text & "','" & Date & "',YES)" cn.Execute sstr MsgBox "Account Created " & "Account Number = " & a, vbInformation, a Call UpdateCheque MsgBox "Ur Cheque No is from " & MaxNo & " To " & MaxNo + 10, vbInformation StatusBar1.Panels(2).Text = "Cheque No " & MaxNo & " - " & MaxNo + 10 ElseIf Check1.Value = 0 Then sstr = "insert into account " sstr = sstr + "values(" & a & ",'" & Text1.Text & "', '" & Text3.Text & "', " sstr = sstr + " " & Text2.Text & " ,'" & Combo1.Text & "' ,'" & Text6.Text & "','" & Date & "',NO)" cn.Execute sstr MsgBox "Account Created " & "Account Number = " & a, vbInformation, a StatusBar1.Panels(2).Text = "Cheque Book Not Issued" 35
End If Call AddDeposite StatusBar1.Panels(1).Text = "Hello " & s & " " & a Call ClearField End If rst.Close End Sub Private Sub AddDeposite() Dim s As String s = "insert into BalanceTable values " s = s + "(" & a & "," & Text5.Text & ")" cn.Execute s End Sub Private Function CheckField() As Boolean If Text1.Text = "" Then MsgBox " Enter Name Please " Text1.SetFocus CheckField = False ElseIf Text3.Text = "" Then MsgBox " Enter Address please " Text3.SetFocus CheckField = False ElseIf Text5.Text = "" Then MsgBox "Balance Should deposite" Text5.SetFocus CheckField = False ElseIf Check1.Value = 1 Then If Not Val(Text5.Text) >= 1500 Then MsgBox "Minimum Balance Should be 1500" CheckField = False Else 36
CheckField = True End If ElseIf Check1.Value = 0 Then If Not Val(Text5.Text) >= 500 Then MsgBox "Minimum Balance Should be 500" CheckField = False Else CheckField = True End If Else CheckField = True End If End Function Private Sub Command2_Click() Call ClearField End Sub Sub ClearField() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text5.Text = "" Me.Text6.Text = "" Check1.Value = 0 End Sub Private Sub Command3_Click() Unload Me 'Form1.Show 1 End Sub Private Sub Command4_Click() Unload Me End Sub 37
Private Sub UpdateCheque() Dim rst As New ADODB.Recordset rst.CursorLocation = adUseClient rst.Open "select max(NoTo) from cheque", cn, adOpenKeyset, adLockOptimistic If rst.RecordCount > 0 Then If Not rst.EOF Then MaxNo = Val(rst.Fields(0)) + 1 Else MaxNo = 1234 End If Else MaxNo = 1234 End If cn.Execute "insert into cheque(Actno,NoForm,NoTo)values(" & a & "," & MaxNo & "," & MaxNo + 10 & ")" rst.Close End Sub Private Sub Form_Load() Text4.Caption = Date$ Label6.Caption = Time() If rs.State = 1 Then rs.Close rs.Open "select * from AccountType", cn, adOpenKeyset, adLockOptimistic, cmdtext rs.MoveFirst While Not rs.EOF Combo1.AddItem rs(1) rs.MoveNext Wend Combo1.ListIndex = 0 End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Chr(KeyAscii) Like "[0-9]" Or KeyAscii = 8 Then 38
Else KeyAscii = 0 End If End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Chr(KeyAscii) Like "[0-9]" Or KeyAscii = 8 Then Else KeyAscii = 0 End If End Sub Private Sub Timer1_Timer() Label6.Caption = Time() End Sub ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
39
___________________________________________________________________________________ __
Component : Edit and close Account Form Form Name : frmEditAct Coding :___________________________________________________________________________________ ___
'Permission variable is to check the permission to delete the 'Record that manager can delete the record '---------------------------------------Private Sub CmdCloseAct_Click() Dim rst As New ADODB.Recordset rst.ActiveConnection = cn If Permission = 1 Then Dim stmt, ms As String Dim s As Long ms = MsgBox("Do U really want to Close Account", vbYesNo, "Delete Record ") If ms = vbYes Then If rst.State = 1 Then rst.Close s = Combo1.Text rst.Open "select ChequeBook from account where actno = " & s & "" If rst!ChequeBook = True Then stmt = "delete from cheque where actno = " & s & "" cn.Execute stmt End If rst.Close stmt = "delete from account where actno = " stmt = stmt + " " & s & "" cn.Execute stmt 'Get the balance back before close account If rst.State = 1 Then rs.Close rst.Open "select balance from BalanceTable where actno = " & s & " " StatusBar1.Panels(1).Text = "Ur balance was " & rst(0) & " Get the money" MsgBox "Ur balance was " & rst(0) & " Get the money" rst.Close stmt = "delete from BalanceTable where actno = " & s & " " cn.Execute stmt stmt = "delete from Transaction1 where actno = " & s & " " cn.Execute stmt 41
MsgBox "Account Close " rs.Requery End If Else MsgBox "U dont have Permission to Close Account ", vbInformation, "Close Account" End If End Sub Private Sub CmdFirst_Click() If rs.RecordCount > 0 Then rs.MoveFirst End If If rs.BOF Then MsgBox "You Are Onto The First Record" Else Call FillRecord(rs) End If End Sub Private Sub CmdLast_Click() If rs.RecordCount > 0 Then rs.MoveLast End If If rs.EOF = True Then MsgBox "You Are Onto The Last Record" Else rs.MoveLast Call FillRecord(rs) Exit Sub End If End Sub
42
Private Sub CmdMain_Click() Unload Me Form1.Show End Sub Private Sub CmdNext_Click() If rs.RecordCount > 0 Then rs.MoveNext End If If rs.EOF Then MsgBox "You Are Onto The Last Record" If rs.RecordCount > 0 Then rs.MoveLast End If Else Call FillRecord(rs) End If End Sub Private Sub CmdPrev_Click() If rs.RecordCount > 0 Then rs.MovePrevious End If If rs.BOF Then MsgBox "You Are Onto The First Record" If rs.RecordCount > 0 Then rs.MoveFirst End If Else Call FillRecord(rs) End If End Sub
43
Private Sub CmdUpdate_Click() Dim stmt As String stmt = "update Account set nam = '" & Text1.Text & "' , " stmt = stmt + " address = '" & Text4.Text & "' ," stmt = stmt + " phone = " & Text2.Text & " , " stmt = stmt + " Actype = '" & Text3.Text & "' where " stmt = stmt + "actno = " & Combo1.Text & " " cn.Execute stmt MsgBox "Update Succeed ", vbInformation, "Saving Record" rs.Requery End Sub Private Sub Combo1_Click() ' This is for navigate through combo box Dim rs1 As New ADODB.Recordset If rs1.State = 1 Then rs.Close rs1.Open "select * from Account where actno= " & Combo1.Text & " ", cn, adOpenKeyset, adLockOptimistic, adCmdText If rs1.RecordCount > 0 Then Call FillRecord(rs1) End If rs1.Close End Sub Private Sub Command1_Click() 'Issue Cheque book Dim stmt As String Dim rst As New ADODB.Recordset If Check1.Value = 0 Then If rst.State = 1 Then rst.Close rst.Open "select max(noto) from Cheque", cn, adOpenKeyset, adLockOptimistic, cmdtext Dim MaxNo As Long If rst.RecordCount > 0 Then 44
MaxNo = rst(0) MaxNo = MaxNo + 1 stmt = "insert into Cheque values (" stmt = stmt + "" & Combo1.Text & ", " & MaxNo & "," & MaxNo + 10 & ")" cn.Execute stmt ' This is to update in the account master table stmt = "update account set ChequeBook = YES where " stmt = stmt + "actno = " & Combo1.Text & "" cn.Execute stmt MsgBox "Cheque book created form " & MaxNo & " To " & MaxNo + 10 StatusBar1.Panels(1).Text = "Cheque book created form " & MaxNo & " To " & MaxNo + 10 rs.Requery 'This is to move record to the first position If rs.RecordCount > 0 Then rs.MoveFirst End If If rs.BOF Then MsgBox "You Are Onto The First Record" Else Call FillRecord(rs) End If End If Else Dim ch As String ch = MsgBox("Cheque Already Issued if cheque last then click yes", vbYesNo) If ch = vbYes Then stmt = "delete from Cheque where actno = " & Combo1.Text & "" cn.Execute stmt If rst.State = 1 Then rst.Close rst.Open "select max(NoTo) from Cheque", cn, adOpenKeyset, adLockOptimistic, cmdtext If rst.RecordCount > 0 Then 45
'Dim MaxNo As Long MaxNo = rst(0) MaxNo = MaxNo + 1 stmt = "insert into Cheque values (" stmt = stmt + "" & Combo1.Text & ", " & MaxNo & "," & MaxNo + 10 & ")" cn.Execute stmt 'This is to update in the acccount master table stmt = "update account set ChequeBook = YES where " stmt = stmt + "actno = " & Combo1.Text & "" cn.Execute stmt MsgBox "Cheque book created form " & MaxNo & " To " & MaxNo + 10 StatusBar1.Panels(1).Text = "Cheque book created form " & MaxNo & " To " & MaxNo + 10 rs.Requery 'This is to move record to the first position If rs.RecordCount > 0 Then rs.MoveFirst End If If rs.BOF Then MsgBox "You Are Onto The First Record" Else Call FillRecord(rs) End If End If End If End If End Sub Private Sub Form_Load() rs.ActiveConnection = cn If rs.State = 1 Then rs.Close rs.CursorLocation = adUseClient 46
rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Open "select * from Account order by actno" If Not rs.BOF Then rs.MoveFirst While Not rs.EOF Combo1.AddItem rs!actno rs.MoveNext Wend If Not rs.BOF Then rs.MoveFirst If rs.RecordCount > 0 Then Call FillRecord(rs) End If End Sub '************************************************ 'Fill Record in the Form Controls Private Sub FillRecord(rs As ADODB.Recordset) Dim i As Integer Dim a Dim rsB As New ADODB.Recordset If rs.RecordCount > 0 Then For i = 0 To Combo1.ListCount - 1 If Combo1.List(i) = Trim(rs!actno) Then Combo1.ListIndex = i Exit For End If Next End If a = rs!actno Text1.Text = rs!Nam Text2.Text = rs!phone Text3.Text = rs!actype Text4.Text = rs!address 47
Text6.Text = rs!Date 'Fill in the check box If rs!ChequeBook = True Then Check1.Value = 1 Else Check1.Value = 0 End If 'To get the balance from Balance Table If rsB.State = 1 Then rsB.Close rsB.Open "select * from BalanceTable where actno = " & a & "", cn, adOpenKeyset, adLockOptimistic, cmdtext Text5.Text = rsB!balance End Sub Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) End Sub
48
49
Dim rs As New ADODB.Recordset Dim a As Boolean 'To check the balance is greater or less Private Sub Combo2_Click() If Combo2.ListIndex = 0 Then 'withdraw Combo3.Clear Combo3.AddItem "Cheque" Combo3.AddItem "Withdrawl" Combo3.ListIndex = 0 ElseIf Combo2.ListIndex = 1 Then 'Deposit Combo3.Clear Combo3.AddItem "Draft" Combo3.AddItem "Cash" Combo3.AddItem "Cheque" Combo3.ListIndex = 0 End If End Sub Private Sub Combo3_Click() If Combo3.Text = "Cheque" Or Combo3.Text = "Draft" Then Text2.Enabled = True
50
Else Text2.Enabled = False End If End Sub 'This procedure is to check that the cheque number 'Which is entered is correct or not Private Function CheqTest() As Boolean If Not Combo2.Text = "Deposite" Then Dim rst As New ADODB.Recordset rst.ActiveConnection = cn If rst.State = 1 Then rst.Close rst.CursorLocation = adUseClient rst.CursorType = adOpenKeyset rst.LockType = adLockOptimistic rst.Open "select * from account where actno = " & Combo1.Text & "" If rst!ChequeBook = True Then If Not Text2.Text = "" Then If rst.State = 1 Then rst.Close rst.Open "select * from Cheque where actno = " & Combo1.Text & " " If rst.RecordCount > 0 Then If Text2.Text >= rst(1) And Text2.Text <= rst(2) Then MsgBox "SS" CheqTest = True Else MsgBox "Please enter the valid cheque no", vbInformation CheqTest = False Exit Function End If End If Else MsgBox "U will have to select Cheque and enter cheque number ", vbInformation 51
CheqTest = False Exit Function End If Else CheqTest = True End If Else CheqTest = True End If End Function 'This is the submit button command button that is 'To submit the transaction in the transaction table 'After checking the appropriate field Private Sub Command1_Click() Dim sstr As String If Not Text1.Text = "" Or Val(Text1.Text) < 100 Then If Text2.Text = "" Then Text2.Text = 0 End If sstr = "Insert into Transaction1 values(" sstr = sstr + " " & Combo1.Text & ",'" & Combo2.Text & "'," sstr = sstr + "" & Text1.Text & ",'" & Combo3.Text & "'" sstr = sstr + "," & Text2.Text & ",'" & Date & "','" & Time & "')" If CheqTest = True Then Call UpdateMoney If a = True Then cn.Execute sstr StatusBar1.Panels(1).Text = "Money " & Combo2.Text & " Success" MsgBox "Money " & Combo2.Text & " Success" End If a = False End If 52
Call ClearField Else MsgBox "please Enter Lease 100 Transaction Amount ", vbInformation End If End Sub 'This is to Update the balance in database Private Sub UpdateMoney() Dim rst As New ADODB.Recordset Dim stmt As String Dim d As Long If rst.State = 1 Then rst.Close rst.Open "select * from BalanceTable where actno = " & Combo1.Text & "", cn, adOpenKeyset, adLockOptimistic, cmdtext If Combo2.Text = "Deposite" Then d = rst!balance + Val(Text1.Text) stmt = "update BalanceTable set balance = " & d & "" stmt = stmt + " where actno = " & Combo1.Text & "" cn.Execute stmt a = True ElseIf Combo2.Text = "Withdraw" Then If rst!balance > Val(Text1.Text) Then d = rst!balance - Val(Text1.Text) stmt = "update BalanceTable set balance = " & d & "" stmt = stmt + " where actno = " & Combo1.Text & "" cn.Execute stmt a = True Else MsgBox "U dont have money to Transact U have only " & rst!balance a = False End If End If End Sub 53
Private Sub Command2_Click() Unload Me 'Form1.Show 1 End Sub Private Sub ClearField() Text1.Text = "" Text2.Text = "" Combo1.ListIndex = 0 Combo2.ListIndex = 0 Combo3.ListIndex = 0 End Sub Private Sub Command3_Click() Call ClearField End Sub Private Sub Command4_Click() Unload Me End Sub Private Sub Form_Load() Timer1.Interval = 1000 Label3.Caption = Time Label2.Caption = Date rs.ActiveConnection = cn If rs.State = 1 Then rs.Close rs.CursorLocation = adUseClient rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Open "select * from Account order by actno" rs.MoveFirst 'This is to fill the account number combo While Not rs.EOF = True Combo1.AddItem rs!actno 54
rs.MoveNext Wend rs.Close Combo2.AddItem "Withdraw" Combo2.AddItem "Deposite" Combo2.ListIndex = 0 Combo1.ListIndex = 0 Combo3.Clear Combo3.AddItem "Cheque" Combo3.AddItem "Withdrawl" 'rs.Close End Sub Private Sub Timer1_Timer() Label3.Caption = Time End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
55
___________________________________________________________________________________ ___
56
Unload Me Form1.Show 1 End Sub Private Sub Command3_Click() SummaryRept.Refresh DataEnvironment1.rsCommand2.Requery SummaryRept.Show End Sub Private Sub DataGrid1_Click() End Sub Private Sub Form_Load() Adodc1.Refresh End Sub
57
____________________________________________________________________________________ _
'rs.Open "select Balance from BalanceTable where actno = " & txtActno & "", cn, adOpenKeyset, adLockOptimistic, cmdtext 'Text1 = rs(0) 'rs.Close End Sub Private Sub DataReport_Error(ByVal JobType As MSDataReportLib.AsyncTypeConstants, ByVal Cookie As Long, ByVal ErrObj As MSDataReportLib.RptError, ShowError As Boolean) On Error Resume Next End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
59
___________________________________________________________________________________ __
Dim stmt As String Dim rs As New ADODB.Recordset Private Sub Combo1_Click() Call DeleteRecord Call FillDBgrid Call FillBalance
60
Adodc1.Refresh DataGrid1.Refresh End Sub Private Sub Command1_Click() Unload Me 'Form1.Show 1 End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Command3_Click() If DataEnvironment1.rsCommand1.State = 1 Then DataEnvironment1.rsCommand1.Close DataEnvironment1.rsCommand1.Open "select * from Temptable", cn, adOpenKeyset, adLockOptimistic, cmdtext DataEnvironment1.rsCommand1.Requery StatmentRept.Refresh StatmentRept.Show End Sub Private Sub DataGrid1_Click() End Sub Private Sub Form_Load() rs.ActiveConnection = cn If rs.State = 1 Then rs.Close rs.CursorLocation = adUseClient rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Open "select actno from account order by actno" If rs.RecordCount > 0 Then rs.MoveFirst 61
While Not rs.EOF = True Combo1.AddItem rs(0) rs.MoveNext Wend End If Combo1.ListIndex = 0 Call DeleteRecord Call FillDBgrid Call FillBalance Adodc1.Refresh DataGrid1.Refresh End Sub Private Sub DeleteRecord() stmt = "delete from TempTable " cn.Execute stmt End Sub Private Sub FillDBgrid() Dim rst As New ADODB.Recordset If rst.State = 1 Then rst.Close If Not Combo1.Text = "" Then rst.Open "select ActNo,TranType,amount,Cheqno,date1 from transaction1 where actno = " & Combo1.Text & "", cn, adOpenKeyset, adLockOptimistic, cmdtext If rst.RecordCount > 0 Then If Not rst.BOF Then rst.MoveFirst While Not rst.EOF = True stmt = "insert into TempTable values ( " & rst(0) & ",'" & rst(1) & "'," & rst(2) & "," & rst(3) & "," & rst(4) & ")" cn.Execute stmt Adodc1.Refresh DoEvents DataGrid1.Refresh rst.MoveNext 62
Wend End If Else StatusBar1.Panels(0).Text = "Not Any Transaction Made" End If Call FillBalance End Sub Private Sub FillBalance() Dim rsq As New ADODB.Recordset If rsq.State = 1 Then rsq.Close rsq.Open "select Balance from BalanceTable where actno = " & Combo1.Text & " ", cn, adOpenKeyset, adLockOptimistic, cmdtext Text1.Text = rsq(0) End Sub ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
63
64
Private Sub DataReport_Error(ByVal JobType As MSDataReportLib.AsyncTypeConstants, ByVal Cookie As Long, ByVal ErrObj As MSDataReportLib.RptError, ShowError As Boolean) On Error Resume Next If DataEnvironment1.rsCommand1.State = 1 Then DataEnvironment1.rsCommand1.Close 'DataEnvironment1.rsCommand1.Open "select * from Temptable", cn, adOpenKeyset, adLockOptimistic, cmdtext DataEnvironment1.rsCommand1.Requery StatmentRept.Refresh End Sub Private Sub DataReport_Initialize() On Error Resume Next If DataEnvironment1.rsCommand1.State = 1 Then DataEnvironment1.rsCommand1.Close DataEnvironment1.rsCommand1.Open "select * from Temptable", cn, adOpenKeyset, adLockOptimistic, cmdtext DataEnvironment1.rsCommand1.Requery StatmentRept.Refresh End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
______________________________________________________________________ __
65
Module Code:______________________________________________________________________ __
Dim stmt As String Dim rs As New ADODB.Recordset Private Sub Combo1_Click() Call DeleteRecord Call FillDBgrid Call FillBalance Adodc1.Refresh DataGrid1.Refresh End Sub Private Sub Command1_Click() Unload Me 'Form1.Show 1 End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Command3_Click() If DataEnvironment1.rsCommand1.State = 1 Then DataEnvironment1.rsCommand1.Close DataEnvironment1.rsCommand1.Open "select * from Temptable", cn, adOpenKeyset, adLockOptimistic, cmdtext DataEnvironment1.rsCommand1.Requery StatmentRept.Refresh
66
Private Sub DataGrid1_Click() End Sub Private Sub Form_Load() rs.ActiveConnection = cn If rs.State = 1 Then rs.Close rs.CursorLocation = adUseClient rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Open "select actno from account order by actno" If rs.RecordCount > 0 Then rs.MoveFirst While Not rs.EOF = True Combo1.AddItem rs(0) rs.MoveNext Wend End If Combo1.ListIndex = 0 Call DeleteRecord Call FillDBgrid Call FillBalance Adodc1.Refresh DataGrid1.Refresh End Sub Private Sub DeleteRecord() stmt = "delete from TempTable " cn.Execute stmt End Sub 67
Private Sub FillDBgrid() Dim rst As New ADODB.Recordset If rst.State = 1 Then rst.Close If Not Combo1.Text = "" Then rst.Open "select ActNo,TranType,amount,Cheqno,date1 from transaction1 where actno = " & Combo1.Text & "", cn, adOpenKeyset, adLockOptimistic, cmdtext If rst.RecordCount > 0 Then If Not rst.BOF Then rst.MoveFirst While Not rst.EOF = True stmt = "insert into TempTable values ( " & rst(0) & ",'" & rst(1) & "'," & rst(2) & "," & rst(3) & "," & rst(4) & ")" cn.Execute stmt Adodc1.Refresh DoEvents DataGrid1.Refresh rst.MoveNext Wend End If Else StatusBar1.Panels(0).Text = "Not Any Transaction Made" End If Call FillBalance End Sub
Private Sub FillBalance() Dim rsq As New ADODB.Recordset If rsq.State = 1 Then rsq.Close rsq.Open "select Balance from BalanceTable where actno = " & Combo1.Text & " ", cn, adOpenKeyset, adLockOptimistic, cmdtext Text1.Text = rsq(0)
68
End Sub
69
Documentation
This website project www.indiaonline.com is developed by .. This is a application software like any application working on bank, hospital project, etc. where staff can store database in computer and easily analyse the data and get information. To install this application software in your system do the following:1). Save exefiles and database files and folder under "banksys" folder in ..C: drive.. 2). Double click the application software. 3). For exit click on exit..
User Manual
Account Statement: User can take the account statement by displaying all the customers records. List of all account holders: User can view the consolidated list of all the account holders. Transactions: User can deposit or withdraw amount in customers account by selecting transaction form of the project. Opening new account: User can open new customer account by adding new record from customer form.
70
Conclusion
This project is designed to meet the requirements of a Banking System. It has been developed in Visual Basic, keeping in mind the specifications of the system. For designing the system we have used simple data flow diagrams. Overall the project teaches us the essential skills like: Using system analysis and design techniques like data flow diagram in designing the system.
71
Reference: ---1. Visual Basic (BT -12, Manipal) 2. Advance Microsoft Visual Basic -6.0 2nd Editions 3. Programming Microsoft Visual Basic -6 4. Mastering Visual Basic-6
72