0% found this document useful (0 votes)
71 views26 pages

VB6 Database Management System Code

The document contains a Visual Basic code for a hospital management system that utilizes ADODB for database connectivity. It includes functionalities for user login, managing doctor, employee, patient, and nurse records, with options to add, update, delete, and display records. The code also features a progress bar and various form interactions for a user-friendly interface.

Uploaded by

kalai.manickam29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views26 pages

VB6 Database Management System Code

The document contains a Visual Basic code for a hospital management system that utilizes ADODB for database connectivity. It includes functionalities for user login, managing doctor, employee, patient, and nurse records, with options to add, update, delete, and display records. The code also features a progress bar and various form interactions for a user-friendly interface.

Uploaded by

kalai.manickam29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Option Explicit

Dim cn As [Link]

Dim rs As [Link]

Private Sub Form_Load()

Dim cn As [Link]

Dim rs As [Link]

Dim strsql As String

Set cn = New [Link]

[Link] = "Provider=[Link].4.0;Data Source=D:\[Link];Persist Security Info=False"

[Link]

Set rs = [Link]("select * from login")

End Sub

Private Sub Image1_Click()


Dim a As Integer

Dim msg As String

[Link]

Do While Not [Link]

If [Link] = [Link](0) And [Link] = [Link](1) Then

[Link]

[Link]

a=1

Exit Do

Else

[Link]

End If

Loop

If a = 0 Then

MsgBox "invalid user"

End If

[Link] = ""

[Link] = ""

End Sub

Private Sub Image2_Click()

End

End Sub
Private Sub Form_Load()

[Link] = [Link]

End Sub

Private Sub Timer1_Timer()

[Link] = [Link] + 10

If [Link] >= [Link] Then

[Link] = False

End If

If [Link] = 100 Then

[Link]

[Link]

End If

End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)

End Sub

Private Sub Command1_Click()

[Link]

[Link]

End Sub

Private Sub Command2_Click()

[Link]

[Link]

End Sub

Private Sub Command3_Click()

[Link]

[Link]

End Sub
Private Sub Command4_Click()

[Link]

[Link]

End Sub

Private Sub Command7_Click()

MsgBox "loading please wait !!.............. ", , "Exit now......."

End

End Sub

Private Sub Command8_Click()

[Link]

[Link]

End Sub

Private Sub Command1_Click()

Shell "[Link]", vbNormalFocus

End Sub
Private Sub Command2_Click()

Shell "[Link]", vbNormalFocus

End Sub

Private Sub Command3_Click()

MsgBox "Sure you want to log off"

[Link]

End Sub

Private Sub Command4_Click()

[Link]

[Link]

End Sub

Option Explicit

Dim cn As [Link]

Dim rs As [Link]

Dim a As Integer
Dim b As Long

Private Sub clear()

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

End Sub

Private Sub Command8_Click()

[Link]

[Link]

End Sub

Private Sub Command9_Click()

[Link]

[Link] = "Docter Name"

Set [Link] = [Link]

[Link] = "gender"

Set [Link] = [Link]

[Link] = "Docter qualication"

Set [Link] = [Link]

[Link] = "Date of Birth"

Set [Link] = [Link]


[Link] = "Salary"

Set [Link] = [Link]

[Link] = "Phone Number"

Set [Link] = [Link]

[Link] = "Email id"

Set [Link] = [Link]

[Link] = "Doctor ID"

[Link]

[Link]

End Sub

Private Sub add()

[Link]("Docter ID") = [Link]

[Link]("Docter Name") = [Link]

[Link]("Gender") = [Link]

[Link]("Docter Eduqualication") = [Link]

[Link]("Date of Birth") = [Link]

[Link]("Docter Department") = [Link]

[Link]("Salary") = [Link]

[Link]("Phone Number") = [Link]

[Link]("E-mail id") = [Link]

End Sub

Private Sub Form_Load()

Dim cn As [Link]

Dim rs As [Link]

Dim strsql As String

Set cn = New [Link]

[Link] = "Provider=[Link].4.0;Data Source=D:\[Link];Persist Security Info=true"

[Link]

Set rs = [Link]("select * from Docter")

End Sub
Private Sub display()

[Link] = [Link]("Docter ID")

[Link] = [Link]("Docter Name")

[Link] = [Link]("Gender")

[Link] = [Link]("Docter Eduqualication")

[Link] = [Link]("Date of Birth")

[Link] = [Link]("Docter Department")

[Link] = [Link]("Salary")

[Link] = [Link]("Phone Number")

[Link] = [Link]("E-mail id")

End Sub

Private Sub Image1_Click()

[Link]

[Link]

add

[Link]

MsgBox "Record add successfully"

End Sub

Private Sub Image2_Click()

[Link]

If [Link] = True Then

[Link]

MsgBox "this is the first record"

End If

display

End Sub

Private Sub Image3_Click()

[Link]
[Link]

display

End Sub

Private Sub Image4_Click()

[Link]

If [Link] = True Then

[Link]

MsgBox "This is the Last Record"

End If

display

End Sub

Private Sub Image5_Click()

[Link]

[Link]

display

End Sub

Private Sub Image6_Click()

a=0

b = InputBox("enter the Docter ID")

[Link]

Do While Not [Link]

If (b = ([Link](0))) Then

a=1

MsgBox "Record found"

Exit Do

Else
[Link]

End If

Loop

If a = 0 Then

MsgBox "record not found"

[Link]

End If

display

End Sub

Private Sub Image7_Click()

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

End Sub

Private Sub Image8_Click()

[Link]

MsgBox "record deleted"

clear

End Sub

Private Sub Image9_Click()


End Sub

Option Explicit

Dim cn As [Link]

Dim rs As [Link]

Dim a As Integer

Dim b As Long

Private Sub add()

[Link]("Employee ID") = [Link]

[Link]("Name") = [Link]

[Link]("Gender") = [Link]

[Link]("Department") = [Link]

[Link]("Address") = [Link]

[Link]("Phone No") = [Link]

[Link]("E-mail id") = [Link]

End Sub
Private Sub cmd10_Click(Index As Integer)

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

End Sub

Private Sub cmd2_Click(Index As Integer)

[Link]

[Link]

End Sub

Private Sub cmd3_Click(Index As Integer)

[Link]

[Link]

display

End Sub

Private Sub cmd4_Click(Index As Integer)

[Link]

If [Link] = True Then

[Link]

MsgBox "This is the Last Record"

End If

display

End Sub

Private Sub cmd5_Click(Index As Integer)


[Link]

[Link]

display

End Sub

Private Sub cmd6_Click(Index As Integer)

[Link]

If [Link] = True Then

[Link]

MsgBox "this is the first record"

End If

display

End Sub

Private Sub cmd8_Click(Index As Integer)

a=0

b = InputBox("enter the Employee ID")

[Link]

Do While Not [Link]

If (b = ([Link](0))) Then

a=1

MsgBox "Record found"

Exit Do

Else

[Link]

End If

Loop

If a = 0 Then

MsgBox "record not found"

[Link]

End If
display

End Sub

Private Sub cmd9_Click(Index As Integer)

[Link]

[Link]

add

[Link]

MsgBox ("this record is added")

End Sub

Private Sub Command1_Click()

End Sub

Private Sub Command2_Click()

End Sub

Private Sub Command3_Click()

End Sub

Private Sub Command4_Click()

End Sub

Private Sub Command5_Click()

End Sub
Private Sub Command6_Click()

End Sub

Private Sub Command7_Click()

End Sub

Private Sub Form_Load()

Dim cn As [Link]

Dim rs As [Link]

Dim strsql As String

Set cn = New [Link]

[Link] = "Provider=[Link].4.0;Data Source=D:\[Link];Persist Security Info=true"

[Link]

Set rs = [Link]("select * from Employee")

End Sub

Private Sub display()

[Link] = [Link]("Employee ID")

[Link] = [Link]("Name")

[Link] = [Link]("Gender")

[Link] = [Link]("Department")

[Link] = [Link]("Address")

[Link] = [Link]("Phone No")

[Link] = [Link]("E-mail id")

End Sub
Option Explicit

Dim cn As [Link]

Dim rs As [Link]

Dim a As Integer

Dim b As Long

Private Sub Command3_Click()

[Link]

[Link] = "Patient Name"

Set [Link] = [Link]

[Link] = "Gender"

Set [Link] = [Link]

[Link] = "Patient Disease"

Set [Link] = [Link]

[Link] = "Date of Birth"

Set [Link] = [Link]

[Link] = "Doctor Fee"

Set [Link] = [Link]


[Link] = "Phone Number"

Set [Link] = [Link]

[Link] = "Fathers Name"

Set [Link] = [Link]

[Link] = "Patient ID"

[Link]

[Link]

End Sub

Private Sub cmd10_Click(Index As Integer)

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

End Sub

Private Sub add()

[Link]("Patient ID") = [Link]

[Link]("Patient Name") = [Link]

[Link]("Gender") = [Link]

[Link]("Patient Disease") = [Link]

[Link]("Date of Birth") = [Link]

[Link]("Patient Department") = [Link]

[Link]("Doctor Fee") = [Link]

[Link]("Fathers Name") = [Link]

[Link]("Phone Number") = [Link]


[Link]("Blood Group") = [Link]

End Sub

Private Sub cmd2_Click(Index As Integer)

[Link]

[Link]

add

[Link]

MsgBox "Record add successfully"

End Sub

Private Sub cmd3_Click(Index As Integer)

[Link]

[Link]

display

End Sub

Private Sub cmd4_Click(Index As Integer)

[Link]

If [Link] = True Then

[Link]

MsgBox "This is the Last Record"

End If

display

End Sub

Private Sub cmd5_Click(Index As Integer)

[Link]

[Link]

display
MsgBox "This is Last record"

End Sub

Private Sub cmd6_Click(Index As Integer)

[Link]

If [Link] = True Then

[Link]

MsgBox "this is the first record..........!!"

End If

display

End Sub

Private Sub cmd8_Click(Index As Integer)

a=0

b = InputBox("enter the Patient ID")

[Link]

Do While Not [Link]

If (b = ([Link](0))) Then

a=1

MsgBox "Record found"

Exit Do

Else

[Link]

End If

Loop

If a = 0 Then

MsgBox "record not found"

[Link]

End If

display
End Sub

Private Sub cmd9_Click(Index As Integer)

MsgBox "loading please wait !!.............. ", , "Loading Message......."

[Link]

[Link]

End Sub

Private Sub display()

[Link] = [Link]("Patient ID")

[Link] = [Link]("Patient Name")

[Link] = [Link]("Gender")

[Link] = [Link]("Patient Disease")

[Link] = [Link]("Date of Birth")

[Link] = [Link]("Patient Department")

[Link] = [Link]("Doctor Fee")

[Link] = [Link]("Fathers Name")

[Link] = [Link]("Phone Number")

[Link] = [Link]("Blood Group")

End Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()

Dim cn As [Link]

Dim rs As [Link]

Dim strsql As String

Set cn = New [Link]

[Link] = "Provider=[Link].4.0;Data Source=D:\[Link];Persist Security Info=true"

[Link]
Set rs = [Link]("select * from Patient")

End Sub

Option Explicit

Dim cn As [Link]

Dim rs As [Link]

Dim a As Integer

Dim b As Long

Private Sub cmd10_Click(Index As Integer)

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""

[Link] = ""
[Link] = ""

End Sub

Private Sub display()

[Link] = [Link]("Nurse ID")

[Link] = [Link]("Nurse Name")

[Link] = [Link]("Gender")

[Link] = [Link]("Fathers Name")

[Link] = [Link]("Nurse Department")

[Link] = [Link]("Date of Birth")

[Link] = [Link]("Nurse Department")

[Link] = [Link]("Nurse Salary")

End Sub

Private Sub add()

[Link]("Nurse ID") = [Link]

[Link]("Nurse Name") = [Link]

[Link]("Gender") = [Link]

[Link]("Fathers Name") = [Link]

[Link]("Nurse Eduqualification") = [Link]

[Link]("Date of Birth") = [Link]

[Link]("Nurse Department") = [Link]

[Link]("Nurse Salary") = [Link]

End Sub

Private Sub Command1_Click()

[Link]

[Link] = "Nurse Name"

Set [Link] = [Link]

[Link] = "Gender"

Set [Link] = [Link]

[Link] = "Fathers Name"

Set [Link] = [Link]


[Link] = "Date of Birth"

Set [Link] = [Link]

[Link] = "Nurse Department"

Set [Link] = [Link]

[Link] = "Nurse Salary"

Set [Link] = [Link]

[Link] = "Nurse ID"

[Link]

[Link]

End Sub

Private Sub cmd2_Click(Index As Integer)

MsgBox "loading please wait !!.............. ", , "Loading Message......."

[Link]

[Link]

End Sub

Private Sub cmd3_Click(Index As Integer)

[Link]

[Link]

display

End Sub

Private Sub cmd4_Click(Index As Integer)

[Link]

If [Link] = True Then

[Link]

MsgBox "This is the Last Record"

End If

display

End Sub
Private Sub cmd5_Click(Index As Integer)

[Link]

[Link]

display

MsgBox "This is Last record"

End Sub

Private Sub cmd6_Click(Index As Integer)

[Link]

If [Link] = True Then

[Link]

MsgBox "this is the first record..........!!"

End If

display

End Sub

Private Sub cmd8_Click(Index As Integer)

a=0

b = InputBox("enter the Nurse ID")

[Link]

Do While Not [Link]

If (b = ([Link](0))) Then

a=1

MsgBox "Record found"

Exit Do

Else

[Link]

End If

Loop

If a = 0 Then

MsgBox "record not found"


[Link]

End If

display

End Sub

Private Sub cmd9_Click(Index As Integer)

[Link]

[Link]

add

[Link]

MsgBox "Record add successfully"

End Sub

Private Sub Form_Load()

Dim cn As [Link]

Dim rs As [Link]

Dim strsql As String

Set cn = New [Link]

[Link] = "Provider=[Link].4.0;Data Source=D:\[Link];Persist Security Info=true"

[Link]

Set rs = [Link]("select * from Nurse")

End Sub

You might also like