You are on page 1of 8

BANK TRANSACTION

FORM1
DECLARATION
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
INSERT
Private Sub Command1_Click()
If ((Text1.Text = "") Or (Text2.Text = "") Or (Text3.Text = "") Or (Text4.Text = "") Or (Text5.Text = "") Or
(Text6.Text = "") Or (Text7.Text = "")) Then
MsgBox ("enter the data")
Else
db.Execute ("insert into bank values('" & Val(Text1.Text) & "','" & (Text2.Text) & "' ,'" & (Text3.Text) & "','"
& (Text4.Text) & "','" & Val(Text5.Text) & "','" & Val(Text6.Text) & "','" & (Text7.Text) & "')")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
MsgBox ("Inserted")
End If
End Sub
DELETE
Private Sub Command2_Click()
Dim i As Integer
i = InputBox("enter the cusid you want to delete")
db.Execute ("delete from bank where acno='" & Val(i) & "'")
MsgBox ("deleted")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
MODIFY
Private Sub Command3_Click()
Dim j As Integer
j = InputBox("enter the acno you want to modify")
rs.Find "acno=" & Str(j)
If (rs.EOF) Then
MsgBox ("Record not found")
Else
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
Text4.Text = rs(3)
Text5.Text = rs(4)
Text6.Text = rs(5)
Text7.Text = rs(6)
MsgBox ("modified")
End If
End Sub
UPDATE
Private Sub Command4_Click()
db.Execute ("update bank set acno='" & Val(Text1.Text) & "' where acno='" & Val(Text1.Text) & "'")
db.Execute ("update bank set name='" & (Text2.Text) & "' where acno='" & Val(Text1.Text) & "'")
db.Execute ("update bank set adres='" & Val(Text3.Text) & "' where acno='" & Val(Text1.Text) & "'")
db.Execute ("update bank set gender='" & Val(Text4.Text) & "' where acno='" & Val(Text1.Text) & "'")
db.Execute ("update bank set dob='" & Val(Text5.Text) & "' where acno='" & Val(Text1.Text) & "'")
db.Execute ("update bank set phno='" & Val(Text6.Text) & "' where acno='" & Val(Text1.Text) & "'")
db.Execute ("update bank set actype='" & Val(Text7.Text) & "' where acno='" & Val(Text1.Text) & "'")
MsgBox ("updated")
End Sub
DATA REPORT
Private Sub Command5_Click()
DataReport1.Show
End Sub
EXIT
Private Sub Command6_Click()
Unload Me
End Sub
NEXT FORM
Private Sub Command7_Click()
Form2.Show
End Sub
FORM LOAD
Private Sub Form_Load()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.Open ("Provider=MSDAORA.1;Password=manager;User ID=system;Persist Security Info=True")
rs.Open ("select*from bank"), db, adOpenDynamic, adLockOptimistic
Adodc1.Visible = False
End Sub

FORM2:
DECLARATION
Dim db1 As ADODB.Connection
Dim rs1 As ADODB.Recordset
INSERT
Private Sub Command1_Click()
If ((Text1.Text = "") Or (Text2.Text = "") Or (Text3.Text = "") Or (Text4.Text = "") Or (Text5.Text = "") Or
(Text6.Text = "") Or (Text7.Text = "")) Then
MsgBox ("enter the data")
Else
db1.Execute ("insert into bank1 values('" & Val(Text1.Text) & "','" & (Text2.Text) & "' ,'" & (Text3.Text) &
"','" & Val(Text4.Text) & "','" & Val(Text5.Text) & "','" & Val(Text6.Text) & "','" & Val(Text7.Text) & "')")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
MsgBox ("Inserted")
End If
End Sub
DELETE
Private Sub Command2_Click()
Dim ik As Integer
ik = InputBox("enter the acno you want to delete")
rs1.Find "acno=" & Str(ik)
If (rs1.EOF) Then
MsgBox ("record not found")
Else
Text1.Text = rs1(0)
Text2.Text = rs1(1)
Text3.Text = rs1(2)
Text4.Text = rs1(3)
Text5.Text = rs1(4)
Text6.Text = rs1(5)
Text7.Text = rs1(6)
db1.Execute ("delete from bank1 where acno='" & Val(i) & "'")
MsgBox ("deleted")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End If
End Sub
MODIFY
Private Sub Command3_Click()
Dim ji As Integer
ji = InputBox("enter the acno you want to modify")
rs1.Find "acno=" & Str(ji)
If (rs1.EOF) Then
MsgBox ("Record not found")
Else
Text1.Text = rs1(0)
Text2.Text = rs1(1)
Text3.Text = rs1(2)
Text4.Text = rs1(3)
Text5.Text = rs1(4)
Text6.Text = rs1(5)
Text7.Text = rs1(6)
MsgBox ("modified")
End If
End Sub
UPDATE
Private Sub Command4_Click()
db1.Execute ("update bank1 set acno='" & Val(Text1.Text) & "' where acno='" & Val(Text1.Text) & "'")
db1.Execute ("update bank1 set name='" & (Text2.Text) & "' where acno='" & Val(Text1.Text) & "'")
db1.Execute ("update bank1 set adres='" & (Text3.Text) & "' where acno='" & Val(Text1.Text) & "'")
db1.Execute ("update bank1 set income='" & Val(Text4.Text) & "' where acno='" & Val(Text1.Text) & "'")
db1.Execute ("update bank1 set loan='" & Val(Text5.Text) & "' where acno='" & Val(Text1.Text) & "'")
db1.Execute ("update bank1 set rateofint='" & Val(Text6.Text) & "' where acno='" & Val(Text1.Text) & "'")
db1.Execute ("update bank1 set interestamt='" & Val(Text7.Text) & "' where acno='" & Val(Text1.Text) & "'")
MsgBox ("updated")
End Sub
DATA REPORT
Private Sub Command5_Click()
DataReport1.Show
End Sub
EXIT
Private Sub Command6_Click()
Unload Me
End Sub
NEXT FORM
Private Sub Command7_Click()
Form3.Show
End Sub
FORM LOAD
Private Sub Form_Load()
Set db1 = New ADODB.Connection
Set rs1 = New ADODB.Recordset
db1.Open ("Provider=MSDAORA.1;Password=manager;User ID=system;Persist Security Info=True")
rs1.Open ("select*from bank1"), db1, adOpenDynamic, adLockOptimistic
End Sub

FORM3:
DECLARATION
Dim db3 As ADODB.Connection
Dim rs3 As ADODB.Recordset
INSERT
Private Sub Command1_Click()
If ((Text1.Text = " ") And (Text2.Text = " ") And (Text3.Text = " ") And (Text5.Text = " ") And (Text6.Text =
" ") And (Text7.Text = " ")) Then
MsgBox ("enter the data")
Else
db3.Execute ("insert into banks3 values('" & Val(Text1.Text) & "','" & Val(Text2.Text) & "' ,'" & (Text3.Text)
& "','" & Val(Text5.Text) & "' ,'" & Val(Text6.Text) & "','" & Val(Text7.Text) & "')")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
MsgBox ("Inserted")
End If
End Sub
DELETE
Private Sub Command2_Click()
Dim ikk As Integer
ikk = InputBox("enter the transid you want to delete")
rs3.Find "transid=" & Str(ikk)
If (rs3.EOF) Then
MsgBox ("record not found")
Else
Text1.Text = rs3(0)
Text2.Text = rs3(1)
Text3.Text = rs3(2)
Text5.Text = rs3(4)
Text6.Text = rs3(5)
Text7.Text = rs3(6)
db3.Exe cute ("delete from banks3 where transid='" & Val(ikk) & "'")
MsgBox ("deleted")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End If
End Sub
MODIFY
Private Sub Command3_Click()
Dim jii As Integer
jii = InputBox("enter the transid you want to modify")
rs3.Find "transid=" & Str(jii)
If (rs3.EOF) Then
MsgBox ("Record not found")
Else
Text1.Text = rs3(0)
Text2.Text = rs3(1)
Text3.Text = rs3(2)
Text5.Text = rs3(4)
Text6.Text = rs3(5)
Text7.Text = rs3(6)
MsgBox ("modified")
End If
End Sub
UPDATE
Private Sub Command4_Click()
db3.Execute ("update banks3 set transid='" & Val(Text1.Text) & "' where transid='" & Val(Text1.Text) & "'")
db3.Execute ("update banks3 set accno='" & Val(Text2.Text) & "' where transid='" & Val(Text1.Text) & "'")
db3.Execute ("update banks3 set name='" & (Text3.Text) & "' where transid='" & Val(Text1.Text) & "'")
db3.Execute ("update banks3 set transtype='" & (Text5.Text) & "' where transid='" & Val(Text1.Text) & "'")
db3.Execute ("update banks3 set transamt='" & Val(Text6.Text) & "' where transid='" & Val(Text1.Text) &
"'")
db3.Execute ("update banks3 set netbalnace='" & Val(Text7.Text) & "' where transid='" & Val(Text1.Text) &
"'")
MsgBox ("updated")
End Sub
DATA REPORT
Private Sub Command5_Click()
DataReport1.Show
End Sub
EXIT
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Command7_Click()
Form3.Show
End Sub
FORM LOAD
Private Sub Form_Load()
Set db3 = New ADODB.Connection
Set rs3 = New ADODB.Recordset
db3.Open ("Provider=MSDAORA.1;Password=manager;User ID=system;Persist Security Info=True")
rs3.Open ("select*from banks3"), db3, adOpenDynamic, adLockOptimistic
End Sub
FORM1

FORM2
REPORT

You might also like