Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/07/2009, 15:01
Avatar de juancace
juancace
 
Fecha de Ingreso: febrero-2006
Ubicación: Zona Norte del Gran Bs As
Mensajes: 89
Antigüedad: 18 años, 2 meses
Puntos: 0
Respuesta: DataGrid y ADO

AHI VA EL CODIGO:

Public Sub CargaGrid()
Dim cnn As ADODB.Connection, rs As ADODB.Recordset
Dim sql As String
Set cnn = New ADODB.Connection
Set rs = New ADODB.Recordset

With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
End With

cnn.Open ConString_HIS
MsgBox cnn.ConnectionString
sql = "select CON_CON_Codigo, CON_CON_Descripcio from CON_Convenio where CON_EMP_Rut = '30-54674125-3'" ' " & "'" & Texto & "'"

rs.Open sql, ConString_HIS, , , adCmdText
MsgBox sql

TxtCUIT = Texto

Set DataGridConvenio.DataSource = rs

If Not rs Is Nothing Then
If rs.State = adStateOpen Then rs.Close
End If

cnn.Close

End Sub


GRACIAS!
__________________
JuAnCaCe :arriba: