SQLTeam.com | Weblogs | Forums

Creating a connection and identifying parameters in Excel 2010


#1

Greetings Everyone,
I have inherited an Excel 2010 spreadsheet with connections and SQL queries.
I need to create new worksheets with different data. The existing SQL queries have 3 parameters identified with "?" in a WHERE statement;

WHERE (HistoricalData.DateAndTime>?) AND (HistoricalData.DateAndTime<?) AND (HistoricalData.TagIndex=?) and (HistoricalData.Val <>0)

The TagIndex determines which data is selected.

When I create a new connection, I'm not getting the same "Connection String" and the when I paste in the SQL code, I'm not prompted to identify the parameters. Also the "Parameters" Button on the bottom of the "Definition" box, is greyed out.

Any idea what I'm missing?

Here's the connection string that works. (Pasting it in doesn't work)

DRIVER=SQL Server Native Client 11.0;SERVER=MADAPLCGW801\SQLEXPRESS;UID=rsview;PWD=********;APP=2007 Microsoft Office system;WSID=MADAPLCGW801;