SQLOLEDB Connection Strings

This post is a little off track, but after spending quite some time trying to figure a technical problem out, I thought it might help out another lost soul, so I’m posting under Technical Architecture.

If you need to use an OLE style connection string to connect to a SQL Server database (for example, you’re using pre-written code that relies on that provider type), but you’re having trouble connecting, you can use the SQL Native Client Provider instead.

So rather than:

Provider=SQLOLEDB;Server=myhost;Database=mydatabase;Persist Security Info=False;User ID=xxxx;Password=yyyy

you can use:

Provider=SQLNCLI;Server=myhost;Database=mydatabase;Persist Security Info=False;User ID=xxxx;Password=yyyy

Bear in mind, the provider should match your version of Native Client, so in my case (I’m running SQL Server 2008 R2), it’s actually SQLNCLI10, as per:

http://msdn.microsoft.com/en-us/library/ms130822.aspx

If you can, avoid SQLOLEDB altogether and use SQLClient.

Hope that helps someone.

Related posts...

Related websites...

  • Microsoft Launch 2008 Worldwide Launch Wave Dubbed as HHH, Heroes Happen {here} and Launch 2008, this is by far the biggest launch wave ever by Microsoft. This event celebrates and inspires customer heroes, the professionals, developers and students among others. Microsoft even have this thing called HHH Comic. The HHH Comic Series is......
  • Import Prosper.com Listing, Loan, Group, Member Data into Microsoft Sql Server 2000 Prosper.com makes all publicly available data accessible via a data export. They also provide tools for importing that data into Microsoft Sql Server 2005. What they don't provide is a mechanisms for getting this data into other databases, specifically in my case Microsoft Sql Server 2000. I have succeeded in......
  • How good is a product, when the support for it SUCKS? Something I see get overlooked often in reviewing products, especially expensive security products, is support.  I've done hundreds of product reviews over the years and numerous benchmarking comparisons to find the best software/hardware for the job. Early on I took for granted the type of support and the ease...

2 Comments

  1. Jeff

    Perfect, thanks. Do you use any other MS products? My company used Microsoft applications until about 2006 and then moven to Apple. It took a lot to (2 years!) to get 100% and function to everyone’s needs but now it’s untouchable. Saved hundreds on licensing! Thanks, Jeff.

    1. Sam Langdon

      Very interesting to hear your experiences. My employer is pretty much entirely MS from an infrastructure/server point of view. Windows is pricey for OS licenses et al, but then Apple aren’t cheap for the hardware. Either way, we have hundreds of .Net based websites & applications running on Windows/IIS, so think it would take us a lot longer than 2 years to switch if we wanted to. This website is something I do in my spare time (hence I don’t post very often :o )) and is running on a Windows server in my loft at home, with an OS license kindly donated from a friend’s MSDN subscription!

Leave a Reply

newsletter software