O
oscar.c.marin
Office 2003
I'm trying to obtain information from a query in Access from a Sub in
Excel-VBA. The code follows. I receive an error message indicating that the
recordset cannot be opened.
Dim rngEmployees As Range
Set rngEmployees = vacations.Range("vacations_names").Offset(1, 0)
Dim rngEmpLastName As Range
Set rngEmpLastName =
vacations.Range("vacations_names").Offset(1, 1)
Dim intColIndex As Integer
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source" & _
"=C:\Documents and Settings\oscar\Mis Documentos\aaa-oacm\" & _
"aaa-tech_projects\planillas_project\nomina.mdb;"
rs.Open "tblEmployees, cn"
rngEmployees.CopyFromRecordset rs
Thank you in advance.
Oscar
I'm trying to obtain information from a query in Access from a Sub in
Excel-VBA. The code follows. I receive an error message indicating that the
recordset cannot be opened.
Dim rngEmployees As Range
Set rngEmployees = vacations.Range("vacations_names").Offset(1, 0)
Dim rngEmpLastName As Range
Set rngEmpLastName =
vacations.Range("vacations_names").Offset(1, 1)
Dim intColIndex As Integer
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source" & _
"=C:\Documents and Settings\oscar\Mis Documentos\aaa-oacm\" & _
"aaa-tech_projects\planillas_project\nomina.mdb;"
rs.Open "tblEmployees, cn"
rngEmployees.CopyFromRecordset rs
Thank you in advance.
Oscar