S
Shilps
Hi,
I have an ODBC Query in VB. Its running fine for all the tables of the database but for one table it always gives general ODBC error on
.Refresh BackgroundQuery:=Fals
the code is
With ActiveSheet.QueryTables.Add(Connection:=Array(Array(
"ODBC;DSN=MS Access Database;DBQ=" + CStr(datab) + ";DefaultDir=" + CStr(direc) + ";DriverId=25;"
), Array("FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;")), Destination:=
Range("AR1")
.Sql = Array(
"SELECT DISTINCT " + CStr(field) + "" & Chr(13) & "" & Chr(10) & "FROM `" + CStr(datab) + "`." + CStr(table_name) + " " + CStr(table_name) + ""
FieldNames = Tru
.RefreshStyle = xlInsertDeleteCell
.RowNumbers = Fals
.FillAdjacentFormulas = Fals
.RefreshOnFileOpen = Fals
.HasAutoFormat = Tru
.BackgroundQuery = Tru
.TablesOnlyFromHTML = Tru
.Refresh BackgroundQuery:=Fals
.SavePassword = Tru
.SaveData = Tru
TI
Shilps
I have an ODBC Query in VB. Its running fine for all the tables of the database but for one table it always gives general ODBC error on
.Refresh BackgroundQuery:=Fals
the code is
With ActiveSheet.QueryTables.Add(Connection:=Array(Array(
"ODBC;DSN=MS Access Database;DBQ=" + CStr(datab) + ";DefaultDir=" + CStr(direc) + ";DriverId=25;"
), Array("FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;")), Destination:=
Range("AR1")
.Sql = Array(
"SELECT DISTINCT " + CStr(field) + "" & Chr(13) & "" & Chr(10) & "FROM `" + CStr(datab) + "`." + CStr(table_name) + " " + CStr(table_name) + ""
FieldNames = Tru
.RefreshStyle = xlInsertDeleteCell
.RowNumbers = Fals
.FillAdjacentFormulas = Fals
.RefreshOnFileOpen = Fals
.HasAutoFormat = Tru
.BackgroundQuery = Tru
.TablesOnlyFromHTML = Tru
.Refresh BackgroundQuery:=Fals
.SavePassword = Tru
.SaveData = Tru
TI
Shilps