Project Description

This little Access Add-In allows you to Benchmark your VBA Code.

You ever wanted to know if DLookup or opening a Recordset is faster, just try it !!

Create a Class e.g. named "clsLookup_Bench":

 

Option Compare Database
Option Explicit

Public Sub Bench_DLookup()
Debug.Assert DLookup("Feld1", "tblTest", "ID=1") = "Peter Müller"
End Sub

Public Sub Bench_DAO_Recordset()
With CurrentDb.OpenRecordset("SELECT TOP 1 Feld1 FROM tblTest WHERE ID=1")
Debug.Assert .Fields("Feld1") = "Peter Müller"
End With
End Sub

Public Sub Bench_ADO_Recordset()
With CurrentProject.Connection.Execute("SELECT TOP 1 Feld1 FROM tblTest WHERE ID=1")
Debug.Assert .Fields("Feld1") = "Peter Müller"
End With
End Sub
 
Now start the VBA Benchmark Add-In:
 

Last edited Feb 27 at 9:00 AM by Gugro, version 12