Source Code for Attendance Management System in Vb6.0

Only available on StudyMode
  • Pages : 11 (1211 words )
  • Download(s) : 1565
  • Published : January 26, 2013
Open Document
Text Preview
Students Attendance Entry Module Source Code:
Option Explicit
Public rs As New ADODB.Recordset
Public cmd As New ADODB.Command
Public con As New ADODB.Connection

Public Sub OpenConn()
With con
.CursorLocation = adUseClient
.ConnectionString = "Provider=MSDAORA.1;Password=praem;User ID=praem;Data Source=127.0.0.1;Persist Security Info=True" .Open
End With
End Sub

Private Sub Form_Load()
OpenConn
With rs

.CursorLocation = adUseClient

.CursorType = adOpenKeyset

.LockType = adLockOptimistic

.CacheSize = 50

.Source = "Select * from students"

.ActiveConnection = "Provider=MSDAORA.1;Password=praem;User ID=praem;Data Source=127.0.0.1;Persist Security Info=True"

.Open

End With
fillforms
lock_edit
save.Enabled = False
End Sub
Private Sub fillforms()

If Not (rs.EOF = True Or rs.BOF = True) Then
rno.Text = rs(0)
student.Text = rs(1)
fname.Text = rs(2)
phno.Text = rs(3)
email.Text = rs(4)
Me.branch.Text = rs(5)
sem.Text = rs(6)
street.Text = rs(7)
city.Text = rs(8)
district.Text = rs(9)
state.Text = rs(10)
pincode.Text = rs(11)
dob.Value = rs(12)
doj.Value = rs(13)
Else
MsgBox "This is the last Record or the first Record", vbOKOnly, "Cannot Move" End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
college.Show
End Sub

Private Sub Label1_Click()

End Sub

Private Sub nex_Click()
If Not (rs.EOF = True) Then
rs.MoveNext
fillforms
End If
End Sub

Private Sub prev_Click()
If Not (rs.BOF = True) Then
rs.MovePrevious
fillforms
End If
End Sub
Private Sub first_Click()
If Not (rs.BOF = True) Then
rs.MoveFirst
fillforms
End If
End Sub
Private Sub last_Click()
If Not (rs.EOF = True) Then
rs.MoveLast
fillforms
End If
End Sub
Private Sub add_Click()
If add.Caption = "New" Then
unlock_edit
nul_text
add.Caption = "add"
delete.Caption = "Cancel"
edit.Enabled = False
save.Enabled = False
first.Enabled = False
last.Enabled = False
prev.Enabled = False
nex.Enabled = False
Exit Sub

Else
If rno.Text = "" Then
MsgBox "Register No Should not be Empty", vbOKOnly
Else
If student.Text = "" Then
MsgBox "Name should not be Empty", vbOKOnly
Else
If fname.Text = "" Then
MsgBox "Father Name Should not be Empty", vbOKOnly Else
If phno.Text = "" Then
MsgBox "Phone No Should not be Empty", vbOKOnly Else
If email.Text = "" Then
MsgBox "Email Should not be Empty", vbOKOnly Else
If branch.Text = "" Then
MsgBox "branch Name Should not be Empty", vbOKOnly Else
If sem.Text = "" Then
MsgBox "Semester Should not be Empty", vbOKOnly Else
If street.Text = "" Then
MsgBox "Address Should not be Empty", vbOKOnly Else
If city.Text = "" Then
MsgBox "Address Should not be Empty", vbOKOnly Else
If district.Text = "" Then MsgBox "Address Should not be Empty", vbOKOnly Else

If state.Text = "" Then MsgBox "Address Should not be Empty", vbOKOnly Else

If pincode.Text = "" Then MsgBox "Address Should not be Empty", vbOKOnly...
tracking img