Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Problem with .Background Query option of ODBC Query

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC Query Laddie Excel Worksheet Functions 0 April 23rd 10 03:35 PM
ODBC query problem Arvi Laanemets Excel Discussion (Misc queries) 3 September 26th 08 02:03 PM
MS Query/ODBC/SQL problem Jen Excel Discussion (Misc queries) 0 December 3rd 04 03:11 PM
Problem with ODBC Query Shilps Excel Programming 2 April 20th 04 05:46 AM
SQL query to ODBC gkelle[_5_] Excel Programming 2 February 12th 04 01:34 PM


All times are GMT +1. The time now is 01:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"