
15/03/2005, 08:36
|
| | Fecha de Ingreso: noviembre-2003
Mensajes: 46
Antigüedad: 21 años, 6 meses Puntos: 0 | |
DE es el DataEnvironment, pero ya lo solucione con un AdoDc
Private Sub buscar_Click() 'SOLO POR EL Y DEL NOMBRE
GoSub selecnormal
Exit Sub
selecnormal:
Dim str As String
Dim STR1 As String
STR1 = "SELECT CodCont, CodCat, NomCategoria, CodRub, NomRubro, Codemp, NomEmpresa, CodProf, Codpues, Nombre, Apellido, COMENTARIOS , Alta, CodUsu, FechaModif, Codusu1 FROM Contacto"
If On1.Value = True Then
If NombreB = "" Then
MsgBox "Ingrese un Nombre"
Exit Sub
Else
str = STR1 + " WHERE (Nombre LIKE '" & NombreB & "%')"
Text.Text = str
GoSub consultar
End If
ElseIf On2.Value = True Then
End If
consultar:
Set Temporal = New ADODB.Recordset
If Temporal.State = 1 Then
Temporal.Close
End If
Temporal.Open str, DE.Agenda 'esto lo hago para ver nomas que me devuelve
a = Temporal.RecordCount 'si me devuelve algo ok despues borrare estas 2 lineas
Ado1.CommandType = adCmdText
Ado1.RecordSource = str
Ado1.Refresh
Set DataGrid1.DataSource = Ado1
Exit Sub
Return
End Sub
pero si me sugeris alguna otra forma sin el adodc mejor porque tendria que funcionar solo con el Datagrid sin ningun control mas, pero asi me anduvo no se si habria algo mejor |