Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/03/2011, 14:12
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Problema con cadena de conexión

Hola!!
Necesitas Usuario|Clave para el Server?

Código vb:
Ver original
  1. Sub ConectarSQL()
  2.     Dim strConectarSQL As String
  3.    
  4.     Set ConexionSQL = New ADODB.Connection
  5.  
  6.     strConectarSQL = "Provider=SQLOLEDB.1"  _
  7.             & ";Password=" & "PASSWORD" _
  8.             & ";Persist Security Info=True;" _
  9.             & ";User ID=" & "USUARIO" _
  10.             & ";Initial Catalog=BS1" _
  11.             & ";Data Source=WILLIAMS"
  12.  
  13.     ConexionSQL.ConnectionString = strConectarSQL
  14.     ConexionSQL.Open
  15. End Sub

O es que te quieres conectar a Access?
Código vb:
Ver original
  1. Set Conexion = New ADODB.Connection
  2.     With Conexion
  3.         .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
  4.         App.Path & "\BaseDatos.mdb;Persist Security Info=False"
  5.         Conexion.Open
  6.     End With