Conexion de Excell a Access
Este código me permite descargar información de un Access a un Excel, pero necesito que funcione con OLEDB. 4.0 (jet en lugar de ACE)Por favor requiero su ayuda
Dim cs As String
Dim sPath As String
Dim sql As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
sPath = ThisWorkbook.Path & "\BASE_DE_GATOS.accdb"
cs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & sPath & ";Persist Security Info=False;"
Set cn = New ADODB.Connection
cn.Open cs
Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
End With
sql = "select * from RECLAMOS_PENDIENTES"
rs.Open sql, cn
Range("A2").CopyFromRecordset rs
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing