como puedo validar que un doato no se me repita en la base de datos
esta es la funcion que tengo:
Código PHP:
Function gObtieneGuia(lngNumGuia As Long) As Long
Dim strSql As String
Dim adoRs As New ADODB.Recordset
Dim lngNumGuia As Long
lngNumGuia = 0
strSql = "Select GU_id,GU_numGuia from Guia where GU_NumGuia=" & lngNumGuia
If dbCreaConsultaRapida(strSql, adoRs) Then
If Not adoRs.EOF Then
If Not IsNull(adoRs![GU_NumGuia]) Then
lngNumGuia = CLng(adoRs![GU_NumGuia])
End If
End If
End If
Set adoRs = Nothing
gObtieneGuia = lngNumGuia
End Function
y este es el que llama a la funcion
If Len(Trim(txtGuia.Text)) > 0 Then
If Not gObtieneGuia(Trim(txtGuia.Text)) Then
mstrMsg = mstrMsg & vbNewLine & "* La Guia ingresada no es valida"
blnError = True
' End If
End If
End If
si me pueden echar una mano