?
Solved

vba ado provider to sql server -- ole and native client

Posted on 2016-08-04
11
Medium Priority
?
203 Views
Last Modified: 2016-08-11
i haven't tested the performance recently.. but I want to throw this question out there to get perspective.

I have an Excel/vba app that runs reports off of a sql server warehouse in a corporate environment, using windows authentication.  

I'm using an ADO connection to the db, and have alternated between using the OLE (SQLOLEDB) and the native client (SQLNCLI10) provider.

It's worked fine with both providers for 6 years, and I haven't noticed a significant performance difference, although I haven't been scientific in benchmarking them.

But now some people have been upgraded from version 10 to version 11, and now it doesn't work for them, since it is version specific.  

That will be a pain to maintain, and I'll have to come up with a creative way to try more than one and turn off  On Error.  

I know that OLE has been depreciated, but it seems to me it has the significant advantage of not being version specific in the connection string.

Is there a way to use the native client that is not version specific?  And is it truly better than using OLE?  When will OLE be phased out?

Thanks...
0
Comment
Question by:dougfosterNYC
  • 5
  • 3
  • 2
  • +1
11 Comments
 

Author Comment

by:dougfosterNYC
ID: 41742553
Oh, and we are migrating to a new server environment.  So the legacy is sql server 2008, and the new one is version 2012.  I'm not sure if that is going to make any difference...
0
 
LVL 24

Assisted Solution

by:Bitsqueezer
Bitsqueezer earned 500 total points
ID: 41743690
Hi,

the SQLOLEDB driver is a more "common" driver, the SQLNCLI driver supports more specific features of each version of SQL Server. I would say, if you do not use specific new datatypes of newer SQL Server versions you will not have a problem using SQLOLEDB. SQLNCLI supports ways of downloading data faster than other drivers but as far as I know that is not the case if it is used by ADO, but here I'm not completely sure.

I would always prefer to use SQLNCLI if possible, the only case when I'm forced to use SQLOLEDB is for recordsets to be assigned to an Access form to keep it updatable. In any other case I use SQLNCLI.

Details about connection strings for SQLNCLI you can find here:
http://www.connectionstrings.com/sql-server/

But there is no "upgrade" in case of SQLNCLI: All versions can be installed at the same time (I use SQLNCLI for SQL Server 2005 and 2008 in parallel on the clients), so you can use any version you want on the same machine. If you plan to use a newer SQL Server, why not let all clients install the SQLNCLI11 driver and update your connection string?

Cheers,

Christian
0
 
LVL 71

Accepted Solution

by:
Qlemo earned 1000 total points
ID: 41743762
SqlNCli increases overall speed. If it is significant and worth the version-dependant connection string hassle is a question of the environment. Sadly there is indeed no way to always use the newest available and installed Native Client, you need to provide the release (10 or 11), and exactly that driver has to be installed.

We are currently switching from OleDB to SqlNCli on a broad base for our customers, and I've implemented a registry check to switch to OleDB if the Native Driver is not installed, by manipulating the connection string.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 53

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 500 total points
ID: 41743981
SQLNCLI is deprecated since MSSQL 2014. MSSQL ODBC 11 should be used instead.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41744059
MS is leaning towards ODBC 11. OLE DB is "depricated", not the Native Client - there will be no newer release than 2012 for it, but I wouldn't tell that "depricated".
0
 
LVL 53

Expert Comment

by:Vitor Montalvão
ID: 41744093
Avoiding to make a dissertation of the "deprecated" meaning but want I wanted to state is to avoid using Native Client for MSSQL 2014 or superior. Newer versions of MSSQL ODBC has been released so don't stick with SNAC 2012 if you want to work with last SQL Server versions.
0
 

Author Comment

by:dougfosterNYC
ID: 41744145
Thanks all for your comments.  It looks like there is no clarity on this issue, but for now, there is no pressing reason to drop OLE.  But i think I'll add logic to find the newest version of the native client... i'm hoping that IT is rolling it out for all of us so we'll all be on version 11 soon....  

The reason i can't have users upgrade is because i work at a large company and our environments are completely dictated by IT.  We can't install anything on our machines (many of which are virtual)....
0
 

Author Comment

by:dougfosterNYC
ID: 41745478
excellent conversation
0
 
LVL 53

Expert Comment

by:Vitor Montalvão
ID: 41751916
Doug, I'm not sure if you're expecting any comment from our part or you're done with this question.
0
 

Author Comment

by:dougfosterNYC
ID: 41751944
Ok, thanks.  I thought i closed this out but clearly it didn't take. I'm not sure what happened... I'll do it again.
0
 

Author Closing Comment

by:dougfosterNYC
ID: 41751950
thanks, excellent help.  Sorry i didn't close this out before... I tried but didn't see this portion of the process...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question