LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default ODBC excel Macro help needed

Can someone tell me what is wrong with this?

With Selection.QueryTable
.Connection = Array(Array( _
"ODBC;DSN=Commerce
Center;DATABASE=CommerceCenter;Trusted_Connection= Yes"))
.CommandText = Array( _
"SELECT *" _
, _
"" & Chr(13) & "" & Chr(10) & "" _
, _
"FROM CommerceCenter.dbo.p21_view_inv_mast p21_view_inv_mast" _
)
.Refresh BackgroundQuery:=False
End With


I'm in an excel spreadsheet. I can edit the query and that works fine but
from within the macro I keep getting a "Run-time error '1004' -
Application-defined or object-defined error". I have shortened this query
down as much a possible but still get the error.

Dan


 
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
Excel Macro Needed [email protected] Excel Discussion (Misc queries) 2 April 2nd 08 10:36 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Excel Macro VBA Help Needed [email protected] Excel Programming 9 May 3rd 06 02:15 PM
Macro needed to set macro security in Excel to minimum Carl Excel Programming 3 March 18th 06 03:36 PM
help needed with excel macro shaltar[_6_] Excel Programming 1 November 21st 03 07:34 PM


All times are GMT +1. The time now is 12:11 AM.

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"