View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default How to return query with out headers

See in VBA Help : SQLRequest Function

SQLRequest(ConnectionStr, QueryText, OutputRef, DriverPrompt, ColNamesLogical)

ColNamesLogical must be set to FALSE







I am running ODBC queries from Excel to pull data from an SQL2000 server.
In my query editor I have:

SELECT OL.Item, OL.Item_Desc, OL.Qty
FROM TestDatabase.dbo.OurLib OL
ORDER OL.Item

It returns the data but has a header from the SELECT statement.

Item Item_Desc Qty
ABC First Item 2
DEF Second Item 3

Can anyone help?

DG