Blog Post


Biyernes, Marso 6, 2015

Visual Basic 6.0 : SQL Exist (Primary Key)

Sample Codes Here:

Private Sub txtFN_Change()
Dim rs As New ADODB.Recordset

rs.Open "select * from tblsampledb where FirstName='" & txtFN.Text & "'", con, adOpenDynamic
If Not rs.EOF Then
MsgBox "YOUR PRIMARY KEY ALREADY EXIST!!", vbCritical, "Message"

txtFN.Text = ""
txtFN.SetFocus
cmdS.Enabled = False

Else
cmdS.Enabled = True
Exit Sub

End If

Watch video below

0 (mga) komento:

Mag-post ng isang Komento