Excel Automation - OLEDB Support

R

Rajesh G

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_objSheet.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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top