ADODB connection problem because too many rows in source file?

crito

New Member
Joined
Feb 21, 2012
Messages
1
Hi,

I am using an excel vba macro to get data from others excel files through an adodb connection.

There are different source files containing extacly the same kind of data (same column type, same number of column etc), just the number of rows in each file is different.

The vba macro works just fine for every source file with less than 32570 rows and doesnt work when the source file has 34638 rows or more.

I didn't check precisely but my guess is that it doesn't work if the source file a more than 2^15 = 32768 rows

Here is my code:

Code:
Dim source As String
    source = "W:\Usr\Pagode\HistoParam\" & stock & "_Ech.xls"
    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection
    With cn
        .Provider = "Microsoft.ACE.OLEDB.12.0"
        .ConnectionString = "Data Source=" & source & ";Extended Properties=Excel 12.0 Xml;"
        .Open
    End With
    Set rs = New ADODB.Recordset
    rs.Open ("select max(DATE) from [TMP_PARExport]"), cn

When the code bug, Excel freezes and I have to stop it with windows task manager (end task)
It freeze while executing: rs.Open ("select max(DATE) from [TMP_PARExport]"), cn

I have tried different SQL requests and it also bugs..

Any help appreciated,
cheers
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,886
Messages
6,175,190
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top