Sub getReadSQL(ByVal strSrc As String, strSql As String, rng As Range)
Application.DisplayAlerts = False
With ActiveSheet.QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;" & _
"Data Source=" & strSrc & ";Mode=Share Deny write;" & _
"Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";" & _
"Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=0;" & _
"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;" & _
"Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;" & _
"Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;" & _
"Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False" _
, Destination:=rng)
.CommandType = xlCmdTable
.CommandText = strSql
.name = "getReads"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertEntireRows
.SavePassword = True
.saveData = False
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = strSrc
.Refresh BackgroundQuery:=False
.Delete
End With
Application.DisplayAlerts = True
End Sub