Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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(Arra y( "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ODBC Query | Excel Worksheet Functions | |||
ODBC query problem | Excel Discussion (Misc queries) | |||
MS Query/ODBC/SQL problem | Excel Discussion (Misc queries) | |||
Problem with ODBC Query | Excel Programming | |||
SQL query to ODBC | Excel Programming |