I am running the same query from crystal reports and excel vba.
The crystal reports runs in about a second.
Excel VBA takes 26 seconds.
They both are going through the same ODBC connection.
The query comes directly from crystal reports > Database > Show SQL query
The vba code is simple.
Is there a reason for the time difference?
Am I doing something wrong in VBA?
thanks for any help
The crystal reports runs in about a second.
Excel VBA takes 26 seconds.
They both are going through the same ODBC connection.
The query comes directly from crystal reports > Database > Show SQL query
The vba code is simple.
Code:
Dim cnDB As New ADODB.Connection
Dim rsRecords As New ADODB.Recordset
cnDB.Open "distributions"
rsRecords.Open "SELECT history.statusdate, saledetail.id, saledetail.saleqty, saledetail.todepot, saledetail.queue, sale.saledate, history.statusid, statustable.statustablename, saledetail.invoice, saledetail.backorder, saledetail.masdept, parts.masitemnumber, vendor.vendorname FROM ((((logistics.history history INNER JOIN logistics.saledetail saledetail ON history.saledetailid=saledetail.id) INNER JOIN logistics.statustable statustable ON saledetail.statusid=statustable.id) INNER JOIN logistics.sale sale ON saledetail.saleid=sale.id) INNER JOIN logistics.parts parts ON saledetail.partsid=parts.id) INNER JOIN logistics.vendor vendor ON saledetail.vendorid=vendor.id ", cnDB
Is there a reason for the time difference?
Am I doing something wrong in VBA?
thanks for any help