May 2021 1 138 Report
Ayuda con una conexion entre ado entre excel y vb 6.0?

Utlizo la referencia Microsoft Activex Data Objects 2.1

El compilador muesta el error en la cadena de Conexion. Error '-214746729 (80004005)' En Tiempo De Ejecucion: No se puedo Encontrar el Archivo ISAM Instalable.

Sub Leer_Datos_De_Excel_En_Un_DataGird()

Dim Conexion_Excel As New ADODB.Connection, RsExcel As New ADODB.Recordset

Set Conexion_Excel = New ADODB.Connection

' EN LA SIGUIENTE LINEA MUESTRA EL ERROR

Conexion_Excel.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Ruta & ";Extented Properties=""Excel 8.0;HDR=Yes;""" ' AQUI MUESTRA EL ERROR

Set RsExcel = New ADODB.Recordset

With RsExcel

.CursorType = adOpenStatic

.LockType = adLockOptimistic

.CursorLocation = adUseClient

.Open "Select * From [" & Hoja & "]", Conexion_Excel, , , adCmdText

End With

Set DataGrid.DataSource = RsExcel

End Sub

solo esta el procedimiento, si es necesaria mas informacion me avisan y se las proporcionare.

gracias de antemano

salu2

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.