Saturday, March 12, 2011

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
  • 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
  1. Name - Text
  2. Age - Text
  3. DOB - Date
  4. Phno - Text
  5. Qualification - Text
  6. Percentage - Text
  7. Id - Integer
  8. Status - Text with size as 250. 
  • Now Select 'Build the table'. Your table gets created.
2. Creating the 'Home form' 

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)
Textboxes 
  • Username (hr_username)
  • Password (hr_password0
Images
  • Exit (Image2)
Code for this form


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)
Command Buttons
  • Submit (Command1)
A timer control (Timer1) to display the current time.

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)
Command Button
  • Get Response (Command1)
Code for this form

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).
Command Button
  •  Delete Applicant Id (Command2)
Code for this form

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.)

G.Vivek Venkatesh

19 comments:

Shobana said...

Hi Vivek ,Can this code be modified for exam registration?

G.Vivek Venkatesh said...

@Shobana - OFC you can modify..I will upload other projects soon..

Unknown said...

thanks....very useful...u made me easy....can i get the usecase description??

nandu said...

hi,,,, dis project was useful..can d same project created with many forms.......

priyadharshini said...

can u able to upload a sample for a foreign trading system using vb

Steffie Joseph said...

wow... thanks a lot... i ws so in need of it... thanks a lot bro...:D:D:D

linta issac said...

thanks a lot....Mr.Vivek..!!!!!!!:):)

faizal sharn said...

hello sir am doing my BE cse final yr,i've been planing on doing a project on
"Online Handwritten Script Recognition"if u have any ideas plz do lend me a hand.

faizal sharn said...

hello sir am doing my BE final yr,i've been planin on doing a project on "Online Handwritten Script Recognition",so if u've any ideas plz do lend me a hand

Unknown said...

Thankyou thankyou for this Poryect, It will help me a lot. Can I implement this with vb 2010?

Once again thx Vivek

Can you implement this in vb 2010?
Do you know if I can convert this vb6 project to vb net 2010?

Unknown said...

sir,
I want a Vb coding for post registration system sir.

Unknown said...

Tks for u r project..

Unknown said...

RPO Services arranges it’s Technical Expertise to scrap data and CVs from multiple Job Boards networking sites. Data sourcing services is one of the demanding services in service delivery domain.
visit: www.rposervies.com

Unknown said...

I really enjoyed reading this blog........




BEAUTIFUL TAMIL ACTRES LATEST MOVIE

Unknown said...

Could someone share me this source code to my email id? The ziddu links seems to be broken. I need this source code to implement in my college project. So, I request you to send me the source code on cenahellboy30@gmail.com. Thank you in advance!

Unknown said...

the codes are not working can you help me?

Unknown said...

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;ata Source=C:\User\user\Documents\record.mdb;Persist Security Info=False" what is wrong with this code can you help me?

Unknown said...

I want project on army recruitment system so plz share vb6.0 codeing sir

Unknown said...

Share code army recruitment