Recruitment System VB Project
Recruitment System VB Project
In this post I am explaining how to create a simple mini project for Recruitment System using Visual Basic.
I am using VB 6.0 because many colleges still use that and are yet to update to Visual Studio 2010.
Disclaimer - You can use this code for your project, but must not use as it is. Make some changes and then use it.
Download the Project in VB 6.0
Project Details
Front End : Visual Basic
Back End - MS Access (You can use Oracle however)
Steps Involved
1. Creating the database
I am using VB 6.0 because many colleges still use that and are yet to update to Visual Studio 2010.
Disclaimer - You can use this code for your project, but must not use as it is. Make some changes and then use it.
Download the Project in VB 6.0
Project Details
Front End : Visual Basic
Back End - MS Access (You can use Oracle however)
Steps Involved
1. Creating the database
- In Visual Basic 6.0 open Add-Ins -> Visual Data Manger.
- Select File -> New -> Microsoft Access ->Version 7.0 mdb.
- Name it as 'record'
- Create a table named 'record' with following fields
- Name - Text
- Age - Text
- DOB - Date
- Phno - Text
- Qualification - Text
- Percentage - Text
- Id - Integer
- Status - Text with size as 250.
- Now Select 'Build the table'. Your table gets created.
Before starting with the project go to Project->References and add Microsoft ActiveX Data Objects 2.0 Library and click ok. This is important.
Design the form as shown below,
The basic idea here is that if a person is an applicant he can select wither 'Register' or 'Status' button. However if he is an HR then a login panel has given to them to differentiate them from applicants. Only after proper username and password they can enter into Admin Panel. If he provides a wrong password the Recruitment System will display an error.
The components in this form are,
(The text within brackets refers to the 'Name' property of the corresponding control.)
Command Buttons
- Register (Command2)
- Know Status (Command1)
- Login (Command4)
- Username (hr_username)
- Password (hr_password0
- Exit (Image2)
Private Sub Command1_Click()
Status.Show
End Sub
Private Sub Command2_Click()
Register.Show
End Sub
Private Sub Command4_Click()
If hr_username = "admin" And hr_password = "admin" Then
hr_username = ""
hr_password = ""
Hr.Show
Else
MsgBox "Invalid Username / Password", vbCritical, "Recruitment System"
End If
End Sub
Private Sub Image2_Click()
Unload Me
End Sub
3. Creating the 'Register' form
Design the form as below,
Here the user can enter his personal information and when they click submit button their information is added to the database.
The components in this form are,
Textboxes
- Name (Text1)
- Age (Text2)
- D.O.B (Text3)
- Phone No (Text4)
- Qualification (Text5)
- Percentage (Text6)
- Submit (Command1)
Code for this form
This contains the code for connecting Visual Basic 6.0 with MS Access.
Dim c As Integer
Private Sub Command2_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\record.mdb;Persist Security Info=False"
rs.Open "record", cn, adOpenKeyset, adLockPessimistic, adCmdTable
c = c + 1
rs.AddNew
rs("Name") = Text1
rs("Age") = Text2
rs("DOB") = Text3
rs("Phno") = Text4
rs("Qualification") = Text5
rs("Percentage") = Text6
rs("Id") = c
rs("Status") = "Yet to be processed. Waiting for the response from HR. Stay Tuned for updates"
MsgBox "Registration Successful...Your Application id is " & c & "", vbInformation, "Recruitment System"
rs.Update
rs.Close
cn.Close
Unload Me
End Sub
Private Sub Form_Load()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\record.mdb;Persist Security Info=False"
rs.Open "select * from record", cn, adOpenKeyset, adLockOptimistic
c = rs.RecordCount
End Sub
Private Sub Timer1_Timer()
Label8.Caption = Now
End Sub
After the user enters the information the following dialog with 'Applicant Id' will be displayed
This applicant id will used by the applicant to check their application status.
4. Creating the Status Form
Design the form as below,
The components in this form are,
Textboxes
- Id (Text1)
- Name (Text2)
- Response text (Text3)
- Get Response (Command1)
Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\record.mdb;Persist Security Info=False"
rs.Open "select * from record where Id=" & Text1.Text & "", cn, adOpenKeyset, adLockOptimistic
If (rs(0).Value = Text2.Text) Then
Text3.Text = rs(7).Value
Else
MsgBox "Please verify the details you have given", vbCritical, "Recruitment System"
End If
End Sub
4. Creating the HR Admin form
The HR user will enter after entering the correct username and password in the 'Home' form.
Design the Admin Panel form as follows,
Components in this form,
DataGrid
To display the list of applications. To add this go to Project-> Components and in the dialog box that appears select Microsoft DataGrid control 6.0 (OLEDB).
Textboxes
- Enter Applicant Id (Text1)
- Enter response message (Text2).
- Delete Applicant Id (Command2)
Private Sub Command1_Click()
On Error Resume Next
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\record.mdb;Persist Security Info=False"
rs.Open "update record set status='" + Text2.Text + "' where Id=" + Text1.Text + "", cn, adOpenKeyset, adLockOptimistic
MsgBox "Response sent successfully..", vbInformation, "Recruitment System"
Unload Me
Me.Show
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\record.mdb;Persist Security Info=False"
rs.Open "delete from record where Id=" & Text1.Text & "", cn, adOpenKeyset, adLockOptimistic
MsgBox "Delete successfully..", vbInformation, "Recruitment System"
Unload Me
Me.Show
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim oconn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String
strSQL = "select * from record"
Set oconn = New ADODB.Connection
oconn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\record.mdb;Persist Security Info=False"
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open strSQL, oconn, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = rs
End Sub
Finally after this if the applicant checks his status, it will be displayed as follows,
Thats it!!! Your Project is completed in 5 Steps...:)
Hope You all liked it....If you like this I can post other projects that I did.
(The project has been put only under partial testing. There may be some slight errors in it. In case you find any please modify it or mail me.)
0 comments: