Buenas tardes listeros!
Estoy trabajando sobre una aplicación ya hecha, el tema es que abre un archivo de excel así:
 
    Set cnn = New ADODB.Connection
    cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                    "Data Source=" & Trim(Ruta) & ";" & _
                    "Extended Properties=""Excel 8.0;HDR=YES; IMEX=1;"""

luego:
 
    Set rs = New ADODB.Recordset
    With rs
        .CursorLocation = adUseClient
        .CursorType = adOpenStatic
        LockType = adLockReadOnly
       
    End With
 
y luego carga los datos:
 
    Set rec = cnn.OpenSchema(adSchemaTables)
    While Not rec.EOF
        If intContador = 1 Then
           strNombreHoja = rec!TABLE_NAME
        End If
       
        intContador = intContador + 1
       
        rec.MoveNext
    Wend

finalmente:
 
            rs.Open "SELECT *  FROM [" & strNombreHoja & "]", cnn, , , adCmdText

El tema es que funciona bien, pero tarda mucho, según mis jefes...
Habrá alguna forma de hacer lo mismo pero que tarde mucho menos? Ahora tarda unos 40 segundos en recuperar los datos...
Alguna indicación?

Héctor Daniel Correa

__________________________________________________

Internet gratis. Siempre.
http://www.fullzero.com.ar

Responder a