Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/09/2005, 11:48
Avatar de lop7
lop7
 
Fecha de Ingreso: junio-2005
Ubicación: portuguesa (Venezuela)
Mensajes: 187
Antigüedad: 18 años, 11 meses
Puntos: 1
Buscar datos

bueno asi calientico sera esto lo que buscas
en un modulo.................

Código:
Global ors As ADODB.Recordset
Global ocnn As New ADODB.Connection
Global oCmd As New ADODB.Command
despues
Código:
sub buscar()
dim str as string
dim buscando 

abrirBD
buscando = InputBox("Ingrese el numro a Buscar")

Set ors = New ADODB.Recordset
oCmd.CommandType = adCmdText
oCmd.CommandText = "select campo1,campo2,campo3 from tabla where numero="& buscando 
Set ors = oCmd.Execute
if not ors.eof then
    text1.text=ors.fields!campo1
    text2.text=ors.fields!campo2
    text3.text=ors.fields!campo3
end if
end sub
Código:
Sub abrirBD()
Set ors = New ADODB.Recordset
Set ors = New ADODB.Recordset
If ocnn.State = adestateclose Then

ocnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\misdatos.mdb;Persist Security Info=False"
Set oCmd.ActiveConnection = ocnn
End If
End Sub
espero te sirva
nos vemos
__________________
A quien dices un secreto le entregas tu libertad :si: