Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Run-time error '1004' general odbc error

I have the following macro that was created and used by a previous user. I am
new to the organisation and the macro worked fine for him and all my other
colleagues. However, this does not work for me.

Sub GETdata_HT()

Sheets("HT").Select
ClearColumns

With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _

"ODBC;DSN=InspectionOutputDB;Description=RAISQL2;U ID=rsasso;APP=Microsoft
Office 2003;WSID=DES00002;DATABASE=InspectionOutputDB;Tru sted_Con" _
), Array("nection=Yes")), Destination:=Range("A1"))
.CommandText = Array( _
"SIS_HT '" & Worksheets("TITLES").Range("B12").Value & "', '" & Worksheets
("TITLES").Range("C12").Value & "' " _
)
.Name = "HT"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub


the .Refresh BackgroundQuery:=False is highlighted and I am at a loss as to
why it works for everybody else but me. Please help. I am at my wits end.

Mary.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200905/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Run-time error '1004' general odbc error

this looks odd

Office 2003;WSID=DES00002;DATABASE=InspectionOutputDB;Tru sted_Con" _
), Array("nection=Yes")), Destination:=Range("A1"))
.CommandText = Array( _

trusted_connection ... not broken up as it appears.


"sike11 via OfficeKB.com" <u21678@uwe wrote in message
news:964d639a88408@uwe...
I have the following macro that was created and used by a previous user. I
am
new to the organisation and the macro worked fine for him and all my other
colleagues. However, this does not work for me.

Sub GETdata_HT()

Sheets("HT").Select
ClearColumns

With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _

"ODBC;DSN=InspectionOutputDB;Description=RAISQL2;U ID=rsasso;APP=Microsoft
Office 2003;WSID=DES00002;DATABASE=InspectionOutputDB;Tru sted_Con" _
), Array("nection=Yes")), Destination:=Range("A1"))
.CommandText = Array( _
"SIS_HT '" & Worksheets("TITLES").Range("B12").Value & "', '" & Worksheets
("TITLES").Range("C12").Value & "' " _
)
.Name = "HT"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub


the .Refresh BackgroundQuery:=False is highlighted and I am at a loss as
to
why it works for everybody else but me. Please help. I am at my wits end.

Mary.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200905/1

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Run-time error '1004' general odbc error

The main thing is that it works for my colleagues but not for myself.

Patrick Molloy wrote:
this looks odd

Office 2003;WSID=DES00002;DATABASE=InspectionOutputDB;Tru sted_Con" _
), Array("nection=Yes")), Destination:=Range("A1"))
.CommandText = Array( _

trusted_connection ... not broken up as it appears.

I have the following macro that was created and used by a previous user. I
am

[quoted text clipped - 37 lines]

Mary.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200905/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Run-time error '1004' general odbc error

I have managed to resolve this. I found that the query calls a stored
procedure which I do not have access to. Once I was given permission, the
macro run without any problems.


sike11 wrote:
The main thing is that it works for my colleagues but not for myself.

this looks odd

[quoted text clipped - 9 lines]

Mary.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200905/1

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 CLR Excel Programming 6 September 16th 10 11:14 PM
run-time error '1004' general odbc error Jeff Gross Excel Programming 2 March 26th 09 02:24 PM
Run-time error 1004 - General ODBC Error Linda Excel Programming 0 July 5th 06 04:32 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM


All times are GMT +1. The time now is 01:19 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"