me sale este error [ sql network interfaces : error locating server/instance specfied ] y la verdad no se porque... :o
mi conex es esta
Cita: Option Explicit
Public Declare Sub InitCommonControls Lib "comctl32" ()
' variables para la conexión y el recordset
''''''''''''''''''''''''''''''''''''''''''''
Public cnn As New ADODB.Connection
Public rs As New ADODB.Recordset
Public ObjItem As ListItem
Sub Main()
On Error Resume Next
Call InitCommonControls
Err.Clear
FrmPrincipalCarmen.Show
End Sub
Public Sub IniciarConexion()
With cnn
.CursorLocation = adUseClient
.Open "Provider=SQLNCLI;Server=SERVIDOR\Administrador;Da tabase=NWINDFINALSQL; Trusted_Connection=yes;"
End With
End Sub
Public Sub CargarListView(LV As ListView, rs As ADODB.Recordset)
On Error GoTo ErrorSub
Dim i As Integer
'limpia el LV
LV.ListItems.Clear
' si hay registros
If rs.RecordCount > 0 Then
' recorre el recordset
While Not rs.EOF
' añade los datos
Set ObjItem = LV.ListItems.Add(, , rs(0))
ObjItem.SubItems(1) = rs!voucher
ObjItem.SubItems(2) = rs!dia
ObjItem.SubItems(3) = rs!contacto
ObjItem.SubItems(4) = rs!razonsocial
ObjItem.SubItems(5) = rs!nºderuc
ObjItem.SubItems(6) = rs!direccion
ObjItem.SubItems(7) = rs!inspector
ObjItem.SubItems( = rs!tipodecertificado
ObjItem.SubItems(9) = rs!cantidad
ObjItem.SubItems(10) = rs!precio
ObjItem.SubItems(11) = rs!total
ObjItem.SubItems(12) = rs!codigodebarra
ObjItem.SubItems(13) = rs!cit
ObjItem.SubItems(14) = rs!nºdeplaca
ObjItem.SubItems(15) = rs!nºdemotor
ObjItem.SubItems(16) = rs!nºdeserieochasis
ObjItem.SubItems(17) = rs!nºdecertificado
ObjItem.SubItems(18) = rs!totalvoucher
ObjItem.SubItems(19) = rs!boletaofactura
ObjItem.SubItems(20) = rs!mes
ObjItem.SubItems(21) = rs!lista
ObjItem.SubItems(22) = rs!asignacion
ObjItem.SubItems(23) = rs!observacion
' siguiente registro
rs.MoveNext
Wend
End If
Call ForeColorColumn(&H8000&, 0, FrmPrincipalCarmen.LV)
'Call ForeColorColumn(vbRed, 6, FrmPrincipalcarmen.LV)
Exit Sub
ErrorSub:
If Err.Number = 94 Then Resume Next
End Sub
' cierra
Sub Desconectar()
On Local Error Resume Next
rs.Close
Set rs = Nothing
cnn.Close
Set cnn = Nothing
End Sub
lo rojo es mi error que me muestra...