Excel Automation - OLEDB Support

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Rajesh G (rgodavarthi_at_hotmail.com)
Date: 02/26/04


Date: Thu, 26 Feb 2004 10:28:04 -0800

All,

I am working on a project in C# .Net, which allows user to create a query in
Winform and Export the data to Excel and then User can refresh the data
whenever needed.
My data source is MS SQL Server.

Here is the code snippet:
m_objQryTables = m_obj***.QueryTables;

m_objQryTable =
(Excel._QueryTable)m_objQryTables.Add("OLEDB;Provider=SQLOLEDB;Data
Source=XXX;Initial catalog=Northwind;user id=sa;password=;", m_objRange,
"Select * From Employees");

My Question:
- Is there anyway we can use OLEDB provider to connect to MS SQL Server..?
  Any current versions or future versions of Excel support this...?

I found OLEDB provider for only Jet Engine in Excel, looks like all other
datasources can be accessd only through ODBC.

Any Ideas ..

Thanks for your time.

-- 
Rajesh in Christ.

Quantcast