SQL - Ayuda Por favor

 
Vista:

Ayuda Por favor

Publicado por mary (1 intervención) el 23/05/2007 21:56:38
Hola, estoy realizando un sistema, en el que tengo en una forma un flexgrid, yo quiero que al yo ir escribiendo en un textbox me vayan apareciendo en el flexgrid los registros que comienzan con esa letra o numero. Hasta ahora solo me aparece si coloco el numero completo.
Este es el codigo que tengo:

Private Sub txtNum_Circuito_Change()
Dim db As ADODB.Connection
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Confid;DataSource=."
db.Open
If txtNum_Circuito.Text <> "" Then
sql = "SELECT Num_Circuito,Proveedor,CIR,Agencia,Num_Agencia,Velocidad,Estado,DLCI,Fecha_Instalacion FROM Enlaces WHERE Num_Circuito='" & txtNum_Circuito & "'"
Set rs = db.Execute(sql)
With MSFlexGrid1
.CellAlignment = 9
X = 0
Do While Not rs.EOF
X = X + 1
.TextMatrix(X, 0) = rs!Num_Circuito
.TextMatrix(X, 1) = rs!Agencia
.TextMatrix(X, 2) = rs!Num_Agencia
.TextMatrix(X, 3) = rs!Proveedor
.TextMatrix(X, 4) = rs!DLCI
.TextMatrix(X, 5) = rs!CIR
.TextMatrix(X, 6) = rs!Velocidad
.TextMatrix(X, 7) = rs!Fecha_Instalacion
rs.MoveNext
Loop
End With
End If
End Sub

Por fa ayudenme
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ayuda Por favor

Publicado por Isaías (5072 intervenciones) el 24/05/2007 00:19:40
En principio, esta pregunta va en un foro de DESARROLLO, pero deberias mandar a ejecutar tu busqueda con un LIKE por cada letra que escribas o bien que quites.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar