Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Process data in a sheet within workbook using SQL query?

I asked this a while back, never really got it pinned down, thought I'd try again.
I'd like to query a sheet in a workbook - example...

Set rs = SomeFunction("SELECT TOP 5 Sales FROM Sheet1")

While Not rs.EOF
'Do something with rs
rs.MoveNext
Wend

Obviously this is in VBA - thats fine.

If this can be done (even if pivot tables have to be used) please help.

Cheers.

PS:
I could, as an alternative, go straight to SQL Server for data, but there are no DSNs set-up on users PCs (nor will
there be).
Is it possible to do my queries directly to SQL Server without a DSN (i.e. using a connection string)?
example...
sConnectionString = "Data Source=server1;Initial Catalog=myDatabaseName;Integrated Security=SSPI"
Set rs = SomeOtherFunction("SELECT TOP 5 Sales FROM SalesTable", sConnectionString)

While Not rs.EOF
'Do something with rs
rs.MoveNext
Wend




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Process data in a sheet within workbook using SQL query?

"Stevie_mac" wrote ...

Is it possible to do my queries directly to SQL Server without
a DSN (i.e. using a connection string)?


You can use ADO with a DSN-less connection string e.g. using OLE DB
provider:

http://www.able-consulting.com/MDAC/...erForSQLServer

Jamie.

--
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
Query data from same workbook JT Charts and Charting in Excel 0 October 6th 06 12:23 AM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 1 November 29th 05 01:44 PM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 0 November 28th 05 06:37 PM
Free Data Process/Query Tool Daniel CHEN New Users to Excel 1 May 25th 05 07:48 AM
Free Data Process/Query Tool Daniel CHEN Excel Discussion (Misc queries) 0 May 24th 05 10:15 PM


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