Documente Academic
Documente Profesional
Documente Cultură
CONTENTS
SYNOPSIS 2
INTRODUCTION 4
DATAFLOW DIAGRAM 6
ER DIAGRAM 7
DETAILED DESIGN 8
CODE
NORMALIZATION
INTRODUCTION TO DBMS 19
INTRODUCTION TO MYSQL
INTRODUCTION TO VB
RESULT
CONCLUSION
BIBLIOGRAPHY
SYNOPSIS 2
INTRODUCTION 4
DATAFLOW DIAGRAM 6
ER DIAGRAM 7
DETAILED DESIGN 8
CODE 11
NORMALIZATION 56
INTRODUCTION TO DBMS 19
INTRODUCTION TO MYSQL 26
INTRODUCTION TO VB 32
RESULT 39
CONCLUSION 43
BIBLIOGRAPHY 44
SYNOPSIS
A food world supermarket is a place that has all household
items in the same building. A supermarket that has a large number of
ABSTRACT
INTRODUCTION
Dept
Customer
Product
CustomerBilling
If less
Yes
If
Vendor confirm Update product
transaction Availability
No
Vendor bill
Payment mode
No transaction
Update product
Availability Complete customer
transaction
Complete
vendor
transaction
DEPT_ID
DNAME AM B_N
VB_ID
VENID VENN O
E
D_BILL
CID CNAME
CON DELI
CADD VERS
TRO
LS
PRODUCT PCOS
CUSTOMER BUYS
T
PID
CTYPE PNAME PDES
PAYS
CBILLI
D
CHEC BANK
CUST_BILL K BNAME
Detailed Design
such that the update operations etc work on a set of tuples than a
single one ,which also is possible.
No subversion rule:
If the RDBMS supports a low level language then it should not
bypass any integrity constraints defined in the higher level.In our
project we have taken care to see that this problem is avoided and
there is no change or manipulation of data in the lowest level.
CODE
Form name:frmabout
End Sub
Form name:frmbankdat
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Dim cs As String
Dim cmd As String
Dim flag As Integer
Private Sub cmdnext_Click()
rs.MoveNext
If rs.EOF = True Then
rs.MoveLast
Else: display
End If
End Sub
Private Sub cmdcancel_Click()
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
frmequery.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
cmdview.Enabled = True
cmdcancel.Visible = False
cmdsave.Visible = False
display
End Sub
rs.MovePrevious
If rs.BOF = True Then
rs.MoveFirst
End If
End If
display
Else:
rs!bank_id = txtbid.Text
rs!bank_name = txtbname.Text
rs!badd_no = txtbaddress.Text
rs!badd_street = txtstreet.Text
rs!badd_city = txtcity.Text
rs!bank_ph = txtbankph.Text
rs.Update
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
End If
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
Cmdyes.Visible = False
cmdno.Visible = False
lblrusure.Visible = False
End Sub
Private Sub cmdno_Click()
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
frmequery.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
cmdview.Enabled = True
Cmdyes.Visible = False
cmdno.Visible = False
lblrusure.Visible = False
End Sub
txtbid.Enabled = True
txtbname.Enabled = True
txtbaddress.Enabled = True
txtstreet.Enabled = True
txtcity.Enabled = True
txtbankph.Enabled = True
txtbid.SetFocus
cmdinsert.Visible = False
cmdmod.Visible = False
cmddel.Visible = False
cmdmmenu.Visible = False
frmequery.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
cmdcancel.Visible = True
cmdsave.Visible = True
End Sub
Private Sub Cmdmod_Click()
flag = 1
txtbname.Enabled = True
txtbaddress.Enabled = True
txtstreet.Enabled = True
txtcity.Enabled = True
txtbankph.Enabled = True
txtbname.SetFocus
cmdinsert.Visible = False
cmdmod.Visible = False
cmddel.Visible = False
cmdmmenu.Visible = False
frmequery.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
Cmdyes.Visible = True
cmdno.Visible = True
lblrusure.Visible = True
End Sub
Private Sub Cmddel_Click()
flag = 0
cmdinsert.Visible = False
cmdmod.Visible = False
cmddel.Visible = False
cmdmmenu.Visible = False
frmequery.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
Cmdyes.Visible = True
cmdno.Visible = True
lblrusure.Visible = True
End Sub
Private Sub Cmdmmenu_Click()
Unload Me
frmdesktop.Show
End Sub
Private Sub cmdsave_Click()
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
frmequery.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
cmdview.Enabled = True
cmdcancel.Visible = False
cmdsave.Visible = False
display
End Sub
Private Sub cmdfirst_Click()
rs.MoveFirst
display
End Sub
Private Sub cmdlast_Click()
rs.MoveLast
display
End Sub
Private Sub cmdprev_Click()
rs.MovePrevious
If rs.BOF = True Then
rs.MoveFirst
Else: display
End If
End Sub
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
End Sub
Public Sub display()
If rs.EOF = True Then
MsgBox "No records in the table ", vbInformation, "No records"
txtbid.Text = ""
txtbname.Text = ""
txtbaddress.Text = ""
txtstreet.Text = ""
txtcity.Text = ""
txtbankph.Text = ""
cmdmod.Enabled = False
cmddel.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
frmebankinfo.Enabled = False
Else:
cmdmod.Enabled = True
cmddel.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
frmebankinfo.Enabled = True
txtbid.Text = rs!bank_id
txtbname.Text = rs!bank_name
txtbaddress.Text = rs!badd_no
txtstreet.Text = rs!badd_street
txtcity.Text = rs!badd_city
txtbankph.Text = rs!badd_ph
End If
End Sub
KeyAscii = 0
End If
End Sub
Private Sub txtbaddress_KeyPress(KeyAscii As Integer)
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) And
(KeyAscii <> 35) And (KeyAscii <> 32) And (KeyAscii <> 47) Then
KeyAscii = 0
End If
End Sub
Private Sub txtstreet_KeyPress(KeyAscii As Integer)
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) And
(KeyAscii <> 32) And (KeyAscii <> 44) Then
KeyAscii = 0
End If
End Sub
Private Sub txtcity_KeyPress(KeyAscii As Integer)
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) And
(KeyAscii <> 32) And (KeyAscii <> 45) Then
KeyAscii = 0
End If
End Sub
Dim rs As ADODB.Recordset
Dim con As ADODB.Connection
Dim cs As String
Dim cmd As String
Dim flag As Integer
Private Sub cmdnext_Click()
rs.MoveNext
If rs.EOF = True Then
rs.MoveLast
Else: display
End If
End Sub
Private Sub cmdcancel_Click()
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
frmequery.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
cmdview.Enabled = True
cmdcancel.Visible = False
cmdsave.Visible = False
display
End Sub
rs.Update
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
End If
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
Cmdyes.Visible = False
cmdno.Visible = False
lblrusure.Visible = False
End Sub
Private Sub cmdno_Click()
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
frmequery.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
cmdview.Enabled = True
Cmdyes.Visible = False
cmdno.Visible = False
lblrusure.Visible = False
End Sub
txtbid.Enabled = True
txtbname.Enabled = True
txtbaddress.Enabled = True
txtstreet.Enabled = True
txtcity.Enabled = True
txtbankph.Enabled = True
txtbid.SetFocus
cmdinsert.Visible = False
cmdmod.Visible = False
cmddel.Visible = False
cmdmmenu.Visible = False
frmequery.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
cmdcancel.Visible = True
cmdsave.Visible = True
End Sub
Private Sub Cmdmod_Click()
flag = 1
txtbname.Enabled = True
txtbaddress.Enabled = True
txtstreet.Enabled = True
txtcity.Enabled = True
txtbankph.Enabled = True
txtbname.SetFocus
cmdinsert.Visible = False
cmdmod.Visible = False
cmddel.Visible = False
cmdmmenu.Visible = False
frmequery.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
Cmdyes.Visible = True
cmdno.Visible = True
lblrusure.Visible = True
End Sub
Private Sub Cmddel_Click()
flag = 0
cmdinsert.Visible = False
cmdmod.Visible = False
cmddel.Visible = False
cmdmmenu.Visible = False
frmequery.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
Cmdyes.Visible = True
cmdno.Visible = True
lblrusure.Visible = True
End Sub
Private Sub Cmdmmenu_Click()
Unload Me
frmdesktop.Show
End Sub
Private Sub cmdsave_Click()
If txtbid.Text <> "" And txtbname.Text <> "" And txtbaddress.Text
<> "" And txtstreet.Text <> "" And txtcity.Text <> "" And
txtbankph.Text <> "" Then
rs.MoveLast
rs.AddNew
rs!bank_id = txtbid.Text
rs!bank_name = txtbname.Text
rs!badd_no = txtbaddress.Text
rs!badd_street = txtstreet.Text
rs!badd_city = txtcity.Text
rs!bank_ph = txtbankph.Text
rs.UpdateBatch adAffectAllChapters
Else:
MsgBox "First 3 letters BID followed by number (NOT NULL) ",
vbCritical, "ERROR INSERTING..."
'rs.MovePrevious
txtbid.Text = ""
txtbname.Text = ""
txtbaddress.Text = ""
txtstreet.Text = ""
txtcity.Text = ""
txtbankph.Text = ""
End If
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
cmdinsert.Visible = True
cmdmod.Visible = True
cmddel.Visible = True
cmdmmenu.Visible = True
frmequery.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
cmdview.Enabled = True
cmdcancel.Visible = False
cmdsave.Visible = False
display
End Sub
Private Sub cmdfirst_Click()
rs.MoveFirst
display
End Sub
Private Sub cmdlast_Click()
rs.MoveLast
display
End Sub
Private Sub cmdprev_Click()
rs.MovePrevious
If rs.BOF = True Then
rs.MoveFirst
Else: display
End If
End Sub
txtbid.Enabled = False
txtbname.Enabled = False
txtbaddress.Enabled = False
txtstreet.Enabled = False
txtcity.Enabled = False
txtbankph.Enabled = False
End Sub
Public Sub display()
If rs.EOF = True Then
MsgBox "No records in the table ", vbInformation, "No records"
txtbid.Text = ""
txtbname.Text = ""
txtbaddress.Text = ""
txtstreet.Text = ""
txtcity.Text = ""
txtbankph.Text = ""
cmdmod.Enabled = False
cmddel.Enabled = False
cmdfirst.Enabled = False
cmdlast.Enabled = False
cmdprev.Enabled = False
cmdnext.Enabled = False
cmdview.Enabled = False
frmebankinfo.Enabled = False
Else:
cmdmod.Enabled = True
cmddel.Enabled = True
cmdfirst.Enabled = True
cmdlast.Enabled = True
cmdprev.Enabled = True
cmdnext.Enabled = True
frmebankinfo.Enabled = True
txtbid.Text = rs!bank_id
txtbname.Text = rs!bank_name
txtbaddress.Text = rs!badd_no
txtstreet.Text = rs!badd_street
txtcity.Text = rs!badd_city
txtbankph.Text = rs!badd_ph
End If
End Sub
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) And
(KeyAscii <> 32) And (KeyAscii <> 45) Then
KeyAscii = 0
End If
End Sub
rs.Close
End If
rs.Close
'rs!pmode = finalno
rs.UpdateBatch adAffectAllChapters
End If
txtbillno.Text = ""
txtcid.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
Text31.Text = ""
Text32.Text = ""
Text33.Text = ""
Text34.Text = ""
Text35.Text = ""
Text36.Text = ""
Text37.Text = ""
Text38.Text = ""
Text39.Text = ""
Text40.Text = ""
Text41.Text = ""
Text42.Text = ""
Text43.Text = ""
Text44.Text = ""
Text45.Text = ""
Text46.Text = ""
Text47.Text = ""
Text48.Text = ""
Text49.Text = ""
Text50.Text = ""
Text51.Text = ""
Text52.Text = ""
Text53.Text = ""
Text54.Text = ""
Text55.Text = ""
Text56.Text = ""
Text57.Text = ""
Text58.Text = ""
txtdate.Text = ""
Text73.Text = ""
Text74.Text = ""
Text75.Text = ""
Text76.Text = ""
Text77.Text = ""
Text78.Text = ""
Text79.Text = ""
Text80.Text = ""
Text81.Text = ""
txtfname.Text = ""
txtlname.Text = ""
txtcusttype.Text = ""
txtcustph.Text = ""
Unload frmcustbill
frmpaymode.Show
End Sub
Private Sub cmdcancel_Click()
End
frmmainmenu.Show
End Sub
End Sub
Private Sub Text13_KeyPress(KeyAscii As Integer)
If (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub Text13_LostFocus()
Else
MsgBox "ILLEGAL VALUE", vbCritical, "ERROR"
Text13.SetFocus
End If
End Sub
Private Sub Text15_KeyPress(KeyAscii As Integer)
If (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub Text15_LostFocus()
Text16.Text = Val(Text14.Text) - (Val(Text14.Text) *
(Val(Text15.Text) / 100))
End Sub
Private Sub Text17_KeyPress(KeyAscii As Integer)
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub Text17_LostFocus()
If Text17.Text <> "" Then
rs.Open "select prod_name,prod_cost,prod_desc,prod_avail from
product_tab where prod_id='" & Text17.Text & "'", con,
adOpenDynamic, adLockOptimistic
If rs.EOF = False Then
Text18.Text = rs(0)
Text19.Text = rs(1)
Text76.Text = rs(2)
max = rs(3)
Else
MsgBox "NO records", vbOKOnly, "Info"
End If
rs.Close
End If
End Sub
Private Sub Text20_KeyPress(KeyAscii As Integer)
If (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub Text22_KeyPress(KeyAscii As Integer)
If (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub Text24_KeyPress(KeyAscii As Integer)
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub Text27_KeyPress(KeyAscii As Integer)
If (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text16_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text23_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text30_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text37_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text44_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text51_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text58_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Text73_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub txtcid_KeyPress(KeyAscii As Integer)
If (KeyAscii < 97 Or KeyAscii > 122) And (KeyAscii < 65 Or KeyAscii >
90) And (KeyAscii <> 8) And (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
End If
End Sub
Private Sub txtcid_LostFocus()
rs.Open "select fname,lname,cust_type,cust_ph from cust_tab where
cust_id='" & txtcid.Text & "'", con, adOpenDynamic, adLockOptimistic
If rs.EOF = False Then
txtfname.Text = rs(0)
txtlname.Text = rs(1)
txtcusttype.Text = rs(2)
txtcustph.Text = rs(3)
txtcid.Enabled = False
txtfname.Enabled = False
txtlname.Enabled = False
txtcusttype.Enabled = False
txtcustph.Enabled = False
lblcid.Enabled = False
lblfname.Enabled = False
lbllname.Enabled = False
lblcusttype.Enabled = False
lblcustph.Enabled = False
Else
MsgBox "NO records", vbOKOnly, "Info"
txtcid.SetFocus
End If
rs.Close
End Sub
Private Sub Text20_LostFocus()
If Val(Text20.Text) >= 0 Then
If Val(Text20.Text) > max Then
MsgBox "AVAILABILITY IS LESS", vbCritical, "NO AVAILABILITY"
Text20.SetFocus
Else
Text21.Text = Val(Text20.Text) * Val(Text19.Text)
End If
Else
MsgBox "ILLEGAL VALUE", vbCritical, "ERROR"
Text20.SetFocus
End If
End Sub
Private Sub Text22_LostFocus()
Text23.Text = Val(Text21.Text) - (Val(Text21.Text) *
(Val(Text22.Text) / 100))
End Sub
Private Sub Text24_LostFocus()
If Text24.Text <> "" Then
rs.Open "select prod_name,prod_cost,prod_desc,prod_avail from
product_tab where prod_id='" & Text24.Text & "'", con,
adOpenDynamic, adLockOptimistic
If rs.EOF = False Then
Text25.Text = rs(0)
Text26.Text = rs(1)
Text77.Text = rs(2)
max = rs(3)
Else
End Sub
Private Sub Text27_LostFocus()
If Val(Text27.Text) >= 0 Then
If Val(Text27.Text) > max Then
MsgBox "AVAILABILITY IS LESS", vbCritical, "NO AVAILABILITY"
Text27.SetFocus
Else
Text28.Text = Val(Text27.Text) * Val(Text26.Text)
End If
Else
MsgBox "ILLEGAL VALUE", vbCritical, "ERROR"
Text27.SetFocus
End If
End Sub
Private Sub Text29_LostFocus()
Text30.Text = Val(Text28.Text) - (Val(Text28.Text) *
(Val(Text29.Text) / 100))
End Sub
Private Sub Text3_LostFocus()
If Text3.Text = "" Then
MsgBox "Invalid data", vbOKOnly, "Info"
Else
End Sub
Private Sub Text34_LostFocus()
If Val(Text34.Text) >= 0 Then
If Val(Text34.Text) > max Then
MsgBox "AVAILABILITY IS LESS", vbCritical, "NO AVAILABILITY"
Text34.SetFocus
Else
Text35.Text = Val(Text34.Text) * Val(Text33.Text)
End If
Else
MsgBox "ILLEGAL VALUE", vbCritical, "ERROR"
Text34.SetFocus
End If
End Sub
Private Sub Text36_LostFocus()
Text37.Text = Val(Text35.Text) - (Val(Text35.Text) *
(Val(Text36.Text) / 100))
End Sub
Private Sub Text38_LostFocus()
If Text38.Text <> "" Then
rs.Open "select prod_name,prod_cost,prod_desc,prod_avail from
product_tab where prod_id='" & Text38.Text & "'", con,
adOpenDynamic, adLockOptimistic
If rs.EOF = False Then
Text39.Text = rs(0)
Text40.Text = rs(1)
Text79.Text = rs(2)
max = rs(3)
Else
Text47.Text = rs(1)
Text80.Text = rs(2)
max = rs(3)
Else
MsgBox "NO records", vbOKOnly, "Info"
End If
rs.Close
End If
End Sub
Private Sub Text48_LostFocus()
If Val(Text48.Text) >= 0 Then
If Val(Text48.Text) > max Then
MsgBox "AVAILABILITY IS LESS", vbCritical, "NO AVAILABILITY"
Text48.SetFocus
Else
Text49.Text = Val(Text48.Text) * Val(Text47.Text)
End If
Else
MsgBox "ILLEGAL VALUE", vbCritical, "ERROR"
Text48.SetFocus
End If
End Sub
Private Sub Text50_LostFocus()
Text51.Text = Val(Text49.Text) - (Val(Text49.Text) *
(Val(Text50.Text) / 100))
End Sub
Private Sub Text52_LostFocus()
If Text52.Text <> "" Then
Text67.Text = rs(0)
Text68.Text = rs(1)
Text83.Text = rs(2)
Else
MsgBox "NO records", vbOKOnly, "Info"
End If
End If
rs.Close
End Sub
Private Sub Text69_LostFocus()
Text70.Text = Val(Text69.Text) * Val(Text68.Text)
End Sub
Private Sub Text71_LostFocus()
Text72.Text = Val(Text70.Text) - (Val(Text70.Text) *
(Val(Text71.Text) / 100))
End Sub
Private Sub Text73_LostFocus()
If (Text9.Text = "") Then
Text9.Text = 0
End If
If (Text16.Text = "") Then
Text16.Text = 0
End If
If (Text23.Text = "") Then
Text23.Text = 0
End If
If (Text30.Text = "") Then
Text30.Text = 0
End If
Normalization
Department Details:
There are various departments for handling various types of
products in the supermarket. So the necessary details are:
• DEPT_ID
• DEPT_TYPE
Customer details:
There may be many customers coming to the supermarket. The
customers may be classified into two categories like regular and
casual.So the neccassary details are:
• CUST_ID
• CUST_NAME
• CUST_ADDRESS
• CUST_PH
• CUST_TYPE
Product details:
There are various products in the supermarket which the
customer can purchase.So the necessary details are:
• PROD_ID
• PROD_NAME
• PROD_DESC
[Type text] Page 64
FOOD WORLD 2008
• PROD_COST
• PROD_AVAIL
• PROD_DEPT
Bank details:
There may be regular or casual customers who may be having
bank accounts. So the necessary details of the bank are:
• BANK_ID
• BANK_NAME
• BANK_ADDRESS
• BANK_PHONE
Vendor details:
There may be a lot of vendors for the supermarket.So the
details regarding them are maintained as follows:
• VEND_ID
• VEND_NAME
• VEND_ADDRESS
• VEND_PH
Customer Billing:
The supermarket management should maintain the transaction
of all regular and casual customers. Transactions with a person with no
CID is not entered.So the details regarding this are:
• BILL_NO
• CUST_ID
• TOTAL
• DATE_OF_BILL
Vendor Billing:
Details of normalization
into different table all together. Thus many more redundancies are
identified.
1.Department Details:
Dept_id Dept_type
2.Customer Details:
3.Product Details:
4.Bank Details:
5.Vendor Details:
Table descriptions
Department details:
Customer details:
The customer plays an important role in the supermarket. The
customer table consists of
• The customer ID which is a primary key should start with CID.
• The customer’s first name which should be present.
• The customer’s last name which is not a must as some persons
might not have it.
• The address of the customer divided into house No,street,city
Bank details:
The customers can also pay by cheque. So we need the basic
bank details such as:
• The bank ID which is a primary key and should start from BID.
• The name of the bank which cannot be null.
Product details:
The details of the product should be stored in the database.The
product table consists of
• The product ID which is a primary key and should start with PID.
• The name of the product which cannot be null.
• The description of the product.
• The number of each of the products available in stock.
• The department handling the product.
Vendor details:
The vendor details should be maintained.
• The vendor ID is a primary key and should start with VID.
• The name of the vendor enterprise.
• The address details of the vendor
• The phone number of the vendor. This is not a must.
VEND_ID NOT NULL VARCHAR(10)
NAME NOT NULL VARCHAR(30)
ADDRESS NOT NULL VARCHAR(10)
STREET VARCHAR(30)
CITY VARCHAR(30)
VEND_PH VARCHAR(10)
Customer Billing:
The supermarket management should maintain the transaction
of all regular and casual customers.
Vendor Billing:
The transaction with respect to vendors should be maintained in
the database.So the details regarding this are:
BILL_NO NOT NULL VARCHAR(10)
VEND_ID NOT NULL VARCHAR(10)
TOTAL INT(10)
DATE_OF_BILL NOT NULL DATE
Introduction to DBMS
DATABASE MANAGEMENT SYSTEM CONCEPTS:
known facts that have been recorded and have an implicit meaning. A
database is designed, built and populated with data for a specific
purpose. It has an intended group of users and some preconceived
applications in which these users are interested.
Now that we are aware of what a database is we can easily
understand the concepts of a database management system. A
database management system is a collection of programs that enable
a user to create and maintain a database. The DBMS is a general
purpose system that facilitates the process of defining, constructing
and manipulating database for various applications.
Defining a database involves specifying the datatypes, structures
and constraints for data to be stored in the database, Constructing the
database is the process of storing the data itself on some medium that
is controlled by the DBMS.
The symbols used for the various parts of E.R. diagram are as Follows:
SYMBOL MEANING
ENTITY
WEAK ENTITY
RELATION
SHIP
IDENTIFYING
RELATIONSHIP
ATTRIBUTE
MULTIVALUED
ATTRIBUTE
KEY ATTRIBUTE
COMPOSITE ATTRIBUTE
Relationship constraints:
Domain constraints specify that the value of each attribute A
must be an atomic value from the domain(A).
The key constraints specify that all elements of a set are
distinct. Hence all tuples in a relation should also be distinct. This
means that no two tuples in a relation must have the same
combination of values for all their attributes. The primary key of the
relation is underlined.
Entity integrity constraint stakes no primary key value can
be null. Referential integrity constraint is specified between two
relations. It is used to maintain the consistency among the tuples of
two relations. Informally, the referential integrity constraint states that
a tuple in one relation that refers to another relation must refer to an
existing tuple in that relation.
1.Time Factor:
In manual system if the user has to search for a particular record it
would take a lot of time. Where as in a computerized system the
search period is reduced by the use of indexed files.
2.Accuracy:
If the user is mentally not conscious he might go wrong and may enter
few wrong entries, which will affect the final result. This
problem occurs most of the times in manual system. In
computerized system these problems are removed with
programs validating the entered data & also by alerting the user
whenever he makes mistakes. So the user need not worry, his
job is only to key in the data.
3.Repeatability:
In manual system if the user wants to take many copies of
ledger each time he has to type to type it , which requires a lot of time
4.Efficiency:
If the number of entries increases searching of a particular
record in a manual system becomes a tedious job. Whereas in a
computer the record can be located in relatively short period based on
a key filed. Manpower required in manual system is high where as
manpower in a computer required is considerably less.
INTRODUCTION TO MYSQL
• APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl
are available.
• Fully multi-threaded using kernel threads. This means it can
easily use multiple CPUs if they are available.
• Provides transactional and non-transactional storage engines.
• Uses very fast B-tree disk tables (MyISAM) with index
compression.
• Relatively easy to add another storage engine. This is useful if
you want to add an SQL interface to an in-house database.
• A very fast thread-based memory allocation system.
• Very fast joins using an optimized one-sweep multi-join.
• In-memory hash tables which are used as temporary tables.
• SQL functions are implemented through a highly optimized class
library and should be as fast as possible. Usually there isn't any
memory allocation at all after query initialization.
• The MySQL code is tested with Purify (a commercial memory
leakage detector) as well as with Valgrind..
• Available as client/server or embedded (linked) version.
• Many column types: signed/unsigned integers 1, 2, 3, 4, and 8
bytes long, FLOAT, DOUBLE, CHAR, VARCHAR, TEXT, BLOB,
DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, and ENUM
types.
• Fixed-length and variable-length records.
Menu Bar:
Menu Bar displays the commands you use to work with Visual Basic
and is located at the top. Besides the standard File, Edit, View,
Windows and Help menus, menus are provided to accessfunctions
specific to programming such as Project, Format or Debug.
Context Menus:
Context Menus provide certain short cuts to frequently performed
actions. To open a context menu, click the right mouse button on the
object you are using. The specific list of shortcuts available from
context menus depends on the part of the environment where you
click the right mouse button. For example, the context menu
displayed when you right click on the Toolbox lets you display the
components dialog box, hide the Toolbox, dock or undock the Toolbox,
or add a custom tab to the Toolbox etc.
Toolbars:
Toolbars provide quick access to commonly used commands in the
programming environment and is located below the menu bar. You
click a button on the toolbar once to carry out the action represented
by that button. By default, the Standard toolbar is displayed when
you start VB. Additional toolbars, for editing, form design, and
debugging can be toggled on or off from the Toolbars command on the
View Menu. Toolbars can be docked beneath the menu bar or can
“float” if you select the vertical bar on the left edge and drag it away
from the menu bar.
Toolbox:
Toolbox provides a set of controls that you use at design time to
place them on the form and is located on the left side. In addition to
the default controls layout, you can create your own custom layouts
by selecting Add Tab from the context menu and adding controls to
the resulting tab.
Properties Window:
Properties Window displays the different properties of the
different objects, such as size, caption, color etc., which can be set at
the design time and located at the right side.
Object Browser:
The Object browser lists the available objects in your project,
and gives you a way to navigate through your code. You can use the
Object browser to explore objects in VB , see what methods and
properties are available for those objects, and paste code procedures
into your application.
Form Designer:
The Form serves as the designer window or the container for
placing the different controls, graphics and pictures needed for your
applications and is located at the center. There can be more than one
form or a designer window for a single application.
Immediate Window:
The Immediate Window is provided for debugging purposes and
is located below the form window. You can use it in the calculator
mode to immediately compute big expressions.
Kinds of Objects
Objects can be used to form the interface, store data, and share
functionality across applications.
Controls
Database
ActiveX
Custom Controls
Custom controls are provided to get input from the user in
familiar ways. Controls are text boxes, list boxes, command buttons
and more. These are provided in Visual Basic Studio via the toolbox to
build your application.Custom Controls are interface objects that the
user interacts with to drive the application. Each custom control has its
own properties, methods and event handlers.
Custom Control properties are variable settings that effect the
state of the control. Properties range from setting its appearance to
changing its data. Properties can be changed both at design-time and
run-time.
Object Properties
Setting object properties varies with each property.Properties
can be set:
At Design-Time
At Run-time
Object Methods
Objects in Visual Basic may have methods (another name for
procedures) that perform tasks that may affect the values in its
properties. There may be tasks that need to be performed on the
object in order to access its properties.
Telephones have a "dial" method Phone.Dial 080-6721983 passes the
"dial" method the phone number then performs the dialing task Use
the following syntax when calling an object method:
object.method
List Box
The list box is a more sophisticated version of the text box.
Instead of just supporting one string entry, it can hold multiple string
entries. The list box is similar to an array because it uses an index to
keep track of each entry in the list.
Object Events
Each object in Visual Basic may have events and event-
handlers.An event is an internal flag that represents an action that has
occurred. When the user clicks on a command button or types in a text
box, an event flag is raised (namely, a "Button Click" for the command
button and a "Change" for the text box). When an event flag is raised,
Visual Basic notifies the object for which it was raised. It then calls the
corresponding procedure (known as an event-handler in VB) to
execute the code.
Creating Objects
You can create objects in Visual Basic by drawing the control on
the form. OR Creating objects in code become useful when you are
using a programs Object Model.
Object Model
The object model is a hierarchy of objects that contain the
methods, properties, and events that control the application.
Creating an object is different then creating a variable of a
known type. Before you can use the properties, methods, and events
of an object model, you must first create a programmatic reference to
the class containing the properties, methods, or events you wish to
use.You do this by declaring a local object variable to hold a reference
to the object. You then assign a reference to the object to the local
variable.
Introduction to SQL
Basics Of SQL:
Basics of the SELECT Statement
Conditional Selection
Relational Operators
Compound Conditions
IN & BETWEEN
Using LIKE
Joins
Aliases & In/Subqueries
Aggregate Functions
Views
RESULT
SCREEN SHOTS OF FORMS
FUTURE ENHANCEMENTS
CONCLUSION
BIBLIOGRAPHY