<div style='background-color: none transparent;'></div>

Pages

Home » , , » ADODC IN VB 6.0 TO MS ACCESS WITH DATAGRID CONTROL

ADODC IN VB 6.0 TO MS ACCESS WITH DATAGRID CONTROL

SCREENSHOT


CODE


Private Sub cmdDelete_Click()
On Error Resume Next
If MsgBox("Data is not recoverable!", vbInformation + vbOKCancel, "Confirm Delete") = vbOK Then
    Adodc1.Recordset.Delete
Else
txtName.SetFocus
End If
End Sub

Private Sub cmdFirst_Click()
Adodc1.Recordset.MoveFirst
End Sub

Private Sub cmdLast_Click()
Adodc1.Recordset.MoveLast
End Sub

Private Sub cmdNext_Click()
If Adodc1.Recordset.EOF = True Then
    Adodc1.Recordset.MoveFirst
Else
    Adodc1.Recordset.MoveNext
End If
End Sub

Private Sub cmdPrevious_Click()
If Adodc1.Recordset.BOF = True Then
    Adodc1.Recordset.MoveLast
Else
    Adodc1.Recordset.MovePrevious
End If

End Sub

Private Sub cmdSave_Click()
If txtName.Text = "" Or txtAge.Text = "" Or txtCourse.Text = "" Then
    MsgBox "Empty Fields!", vbExclamation, "Input Error"
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset("Name") = txtName.Text
Adodc1.Recordset("Age") = txtAge.Text
Adodc1.Recordset("Course") = txtCourse.Text
Call clear
End If
End Sub

Sub clear()
txtName.Text = ""
txtAge.Text = ""
txtCourse.Text = ""
txtName.SetFocus
End Sub

Share this article :

No comments :

Post a Comment

 
Copyright © 2011. datasavvy . All Rights Reserved
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Template Modify by Creating Website . Inpire by Darkmatter Rockettheme Proudly powered by Blogger