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.
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.
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
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
For more reference :
http://veccse2.blogspot2011/03/recruitme...oject.html