Академический Документы
Профессиональный Документы
Культура Документы
212
49K views
4.6/5 score
Download
Add to library
Other Library Actions
Embed
Description: Our 3rd year project in Database Management System.
View More
Our 3rd year project in Database Management System.
Copyright:Attribution Non-Commercial (BY-NC)
Downloadas DOCX, PDF, TXT or read online from Scribd
Flag for inappropriate content
RELATED
by Priyanshu Koranga
by Razman Othman
by Razman Othman
Previous
Next
Page 1 of 7
of 38
1
End SubPrivate
Sub Command
4_Click()Dim
confirmDim
diddid =
DataGrid1.Colu
mns(0).TextIf
Not did = ""
Thenconfirm =
MsgBox("This
will delete
the selected
Record!..proce
ed anyway!",
vbOKCancel+
vbExclamation
, "Warning!")If
confirm =
vbOK ThenCall
connectmecon
n.Openconn.Ex
ecute "DELETE
FROM
employeetable
WHERE
Emp_id=" &
didMsgBox
"The Record
was
successfully
Deleted!",
vbInformationc
onn.CloseCall
myqueryEnd
If ElseMsgBox
"There are no
records
to delete!",
vbCriticalEnd
If End
SubPrivate
Sub Command
5_Click()Unloa
d MeEnd
SubPrivate Sub
Form_Load()Cal
l
myquery''*****
******* USER
LEVELIf
userlevel = 1
ThenCommand
1.Enabled =
TrueCommand
2.Enabled =
TrueCommand
4.Enabled =
True ElseCom
mand1.Enable
d=
FalseCommand
2.Enabled =
FalseCommand
4.Enabled =
FalseEnd If End
SubPublic Sub
myquery() Call
connectme co
nn.Open query
= "SELECT
* FROM
employeetable
ORDER BY
Emp_Id desc"
rs.Open query,
connSet
DataGrid1.Dat
aSource = rs If
Not rs.EOF
Thenrs.MoveLa
streccnt.Captio
n
= rs.RecordCo
untElsereccnt.
Caption =
0End If Call
datgridDataGri
d1.MarqueeSty
le = 3 End
SubPublic Sub
datgrid()DataG
rid1.Font.Size
= 11DataGrid1
.Font.Name
= "Arial"DataG
rid1.HeadFont.
Size
= 11DataGrid1
.HeadFont.Bold
=
TrueDataGrid1.
HeadFont.Nam
e
= "Arial"DataG
rid1.Columns(0
).Caption =
"Emp ID"Data
Grid1.Columns
(0).Width
= 1000DataGri
d1.Columns(4).
Caption =
"Telephone
No."DataGrid1.
Columns(4).Wi
dth
= 1700DataGri
d1.Columns(5)
.Caption
= "CellPhone
No."DataGrid1.
Columns(5).Wi
dth
= 1600DataGri
d1.Columns(7)
.Caption
= "Date
Hired"DataGrid
1.Columns(7).
Width
= 1600End
Sub
FRMLOGIN
Private
Sub Command
1_Click()Call
connectmecon
n.Openssql
= "SELECT *
FROM myusers
WHERE myuse
rname='"
& txt_user.Text
&
"' ANDmypass
word='" &
txt_pass.Text &
"'"rs.Open
ssql, connIf
Not rs.EOF
ThenWith
rsuserlevel = !
user_levelmyu
ser =
txt_user.Textfr
mcarrental.Ena
bled =
TrueUnload
MeEnd
WithElse
MsgBox
"Invalid
username and
password !",
vbCritical,
"KRIN"txt_user.
SetFocusfrmcar
rental.Enabled
= False End
If conn.Close
End SubPrivate
Sub Command
2_Click()EndEn
d SubPrivate
Sub
Form_Load()fr
mcarrental.Sho
wEnd Sub
FRMNEWCUS
T
Private
Sub cmd_canc
el_Click()Unloa
d MeEnd
SubPrivate Sub
clearfields()txt
_Lastname.Text
=
""txt_Firstname
.Text =
""txt_Address.T
ext =
""txt_tp.Text
= ""txt_cp.Text
= ""txt_Positio
n.Text =
""dtdatehired.V
alue = NowEnd
SubPrivate
Sub cmd_save
_Click()If
txt_Lastname.T
ext = ""
ThenMsgBox
"Please enter
Customer
Name",
vbQuestion,
"KRIN"txt_Last
name.SetFocus
ElseIf
txt_Address.Tex
t = ""
ThenMsgBox
"Please enter
Address",
vbQuestion,
"KRIN"txt_Addr
ess.SetFocusEl
seIf cust_opt =
1 ThenCall
addrecMsgBox
"Record was
successfully sa
ved!",
vbInformation,
"KRIN"Unload
MeElseIf
cust_opt = 2
Then Call
editrecMsgBox
"Record was
successfully up
dated!",
vbInformation,
"KRIN"
End If Call
frmcustbl.myq
ueryEnd If End
SubPrivate Sub
Form_Load()Di
m rs1 As
ADODB.Record
setDim rs2 As
ADODB.Record
set Set rs1
= New
ADODB.Record
setSet rs2
= New
ADODB.Record
set Call
connectme If
cust_opt = 2
Then conn.Ope
nssqlsub =
"SELECT *
FROM
customertable
WHERE
Cus_Id=" &
custidrs2.Open
ssqlsub,
conn If Not
rs2.EOF
ThenWith
rs2txt_Lastnam
e.Text = !
lastnametxt_Fir
stname.Text
=!
firstnamedtbirt
hdate.Value
=!
Birthdatetxt_tp
.Text = !
Telephone_notx
t_cp.Text = !
Cellphone_notx
t_Address.Text
= !Address End
WithEnd
If conn.CloseE
nd If End
SubPublic Sub
addrec()'******
** save
recordCall
connectmecon
n.Openconn.Ex
ecute "INSERT
INTOcustomert
able(Lastname
,Birthdate,Tele
phone_no,Cell
phone_no,Addr
ess) VALUES('"
&txt_Lastname
& "','" &
txt_Firstname
& "','"
& dtbirthdate.V
alue & "','" &
txt_tp.Text &
"','" &txt_cp.Te
xt & "','" &
txt_Address.Tex
t & "')" End
SubPublic Sub
editrec()'******
** update
recordCall
connectmecon
n.Open
conn.Execute
"UPDATE
customertable
set
Firstname='" &
txt_Firstname.T
ext &
"',Lastname='"
& txt_Lastnam
e.Text
& "',Birthdate=
'"
& dtbirthdate.V
alue
&"',Telephone_
no='" &
txt_tp.Text & "',
Cellphone_no=
'" & txt_cp.Text
& "',
Address='"
&txt_Address
& "' WHERE
Cus_Id=" &
custid End Sub
FRMNEWEMP
Private
Sub cmd_canc
el_Click()Unloa
d MeEnd
SubPrivate Sub
clearfields()txt
_Lastname.Text
=
""txt_Firstname
.Text =
""txt_Address.T
ext =
""txt_tp.Text
= ""txt_cp.Text
= ""txt_Positio
n.Text =
""dtdatehired.V
alue = NowEnd
SubPrivate
Sub cmd_save
_Click()If
txt_Lastname.T
ext = ""
ThenMsgBox
"Please enter
Lastname",
vbQuestion,
"KRIN"txt_Last
name.SetFocus
ElseIf
txt_Firstname.T
ext = ""
ThenMsgBox
"Please enter
Firstname",
vbQuestion,
"KRIN"txt_First
name.SetFocus
ElseIf
txt_Address.Tex
t = ""
ThenMsgBox
"Please enter
Address",
vbQuestion,
"KRIN"txt_Addr
ess.SetFocusEl
seIf emp_opt =
1 ThenCall
addrecMsgBox
"Record was
successfully sa
ved!",
vbInformation,
"KRIN"Unload
MeElseIf
emp_opt = 2
Then Call
editrecMsgBox
"Record was
successfully up
dated!",
vbInformation,
"KRIN" End
If Call
frmemptbl.my
queryEnd
If End
SubPrivate Sub
Form_Load()
Dim rs1 As
ADODB.Record
setDim rs2 As
ADODB.Record
set Set rs1
= New
ADODB.Record
setSet rs2
= New
ADODB.Record
set Call
connectme If
emp_opt = 2
Then conn.Ope
nssqlsub =
"SELECT *
FROM
employeetable
WHERE
Emp_Id=" &
empidrs2.Ope
n ssqlsub,
conn If Not
rs2.EOF
ThenWith
rs2txt_Lastnam
e.Text = !
lastnametxt_Fir
stname.Text
=!
firstnametxt_P
osition.Text = !
MyPositiondtbir
thdate.Value
=!
Birthdatedtdat
ehired.Value
=!
Date_hiredtxt_t
p.Text = !
Telephone_notx
t_cp.Text = !
Cellphone_notx
t_Address.Text
= !Address End
WithEnd
If conn.CloseE
nd If End
SubPublic Sub
addrec()'******
** save
recordCall
connectmecon
n.Openconn.Ex
ecute "INSERT
INTOemployee
table(Lastnam
e,Firstname,My
Position,Birthd
ate,Date_hired
,Telephone_no,
Cellphone_no,A
ddress)
VALUES('" &
txt_Lastname
& "','" &
txt_Firstname
& "', '" &
txt_Position.Tex
t &"', '" &
dtbirthdate.Val
ue & "','" &
dtdatehired.Val
ue & "','" &
txt_tp.Text &
"','" &
txt_cp.Text&
"','" &
txt_Address.Tex
t & "')" End
SubPublic Sub
editrec()'******
** update
recordCall
connectmecon
n.Openconn.Ex
ecute "UPDATE
employeetable
set
Firstname='" &
txt_Firstname.T
ext &
"',Lastname='"
& txt_Lastnam
e.Text
& "',Birthdate=
'"
& dtbirthdate.V
alue
& "',Date_hired
='"
&dtdatehired.V
alue &
"',Telephone_n
o='" &
txt_tp.Text & "',
Cellphone_no=
'" & txt_cp.Text
&
Similar to Car Rental System Documentation
SRS Document
ER Diagram
Car Rental
Project Proposal
Car Rental
DFD CarHire
Car Rental
ARTIFICIAL INTELLIGENCE
A BO UT
Browse books
Site directory
About Scribd
Our blog
Contact Us
PA RT NE RS
Publishers
Developers / API
L EG A L
Terms
Privacy
Copyright
S UP P O RT
Help
FAQ
Accessibility
Press
Purchase help
AdChoices
M EM B ERS H IP S
Join today
Invite Friends
Gifts