arkam2020 de Mayo del 2003
PreguntaNo he podido resolver cual es el problema con la siguiente consulta:
Private Sub DOBusquedaADO()
Dim strCampoB As String
Dim condicion As String
On Error GoTo SQLError
strCampoB = frmUsuarios.txtTelefonoB(8).Text
'cuando la realizo de esta manera no resulta por
' y me indica que los criterios no coinciden con
'los tipos de datos
condicion = "select * from usuarios where telefono =" & strCampoB
'cuando realizo la consulta de esta manera si resulta
'condicion = "select * from usuarios where telefono ='15814275'"
With dataADO
.CommandType = adCmdText
.RecordSource = condicion
.Refresh
Exit Sub
'If error occurs, report it in message box
SQLError:
MsgBox Error(Err.Number), vbExclamation + vbOKOnly, "SQL Error"
End With
Exit Sub
End Sub
Les agradeceria mucho su ayuda
Private Sub DOBusquedaADO()
Dim strCampoB As String
Dim condicion As String
On Error GoTo SQLError
strCampoB = frmUsuarios.txtTelefonoB(8).Text
'cuando la realizo de esta manera no resulta por
' y me indica que los criterios no coinciden con
'los tipos de datos
condicion = "select * from usuarios where telefono =" & strCampoB
'cuando realizo la consulta de esta manera si resulta
'condicion = "select * from usuarios where telefono ='15814275'"
With dataADO
.CommandType = adCmdText
.RecordSource = condicion
.Refresh
Exit Sub
'If error occurs, report it in message box
SQLError:
MsgBox Error(Err.Number), vbExclamation + vbOKOnly, "SQL Error"
End With
Exit Sub
End Sub
Les agradeceria mucho su ayuda
