Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default General ODBC Error

I am running a VBA macro as the following statements:
When it gets to the RefreshBackgroundQuery line, I get a
Run-time error 1004 and a General ODBC Error.

This works on several machines and several users, and on other users I get
the above mentioned error. This is not a problem with the code, but must be
a setting in the persons excel options or something on their individual
machine. Also, when I run this on my own machine it works, but if I log
into terminal server I get the error.

Any help would be greatly appreciated!!

With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _
"ODBC;DSN=dBASE
Files;DefaultDir=C:\;DriverId=533;MaxBufferSize=20 48;PageTimeout=" _
), Array("5;")), Destination:=Range("A1"))
.CommandText = Array( _
"SELECT JOB_NO, DATE, EMPCODE, CODE, CLASS, HOURS, TYPE FROM
K:\DATA\TIMEDATA\DB2K\TIMESKEL.DBF " _
& "TIMESKEL WHERE([JOB_NO]=" & Range("jobnumber").Value _
& "AND [DATE]=#" & Range("entereddate").Value & "# AND [TYPE]<'3' )"
_
)
.Name = "Query from dBASE Files"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False 'changed to make refresh work
.BackgroundQuery = False 'removed January 2006
.RefreshStyle = xlOverwriteCells
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False 'removed January 2006
End With


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
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Run-time error 1004 - General ODBC Error Linda Excel Programming 0 July 5th 06 04:32 PM
1004 General ODBC Error YCI Excel Programming 1 October 21st 05 01:33 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM


All times are GMT +1. The time now is 02:44 PM.

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

About Us

"It's about Microsoft Excel"