Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Run-time error 1004 - General ODBC Error | Excel Programming | |||
1004 General ODBC Error | Excel Programming | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Runtime error '1004' General ODBC error | New Users to Excel |