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

  • Shelter Cove Marina, San Diego, CA Phone: 619.224.2471 Average Water Depth: The average water depth in this area is 11 feet, but this can change. Please call ahead before you arrive. Marine Standby Channel: Not at this time, but the marina is reachable by phone. Is there a pumpout station? No, but there are a......
  • 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...
  • The Tony Hawk Foundation The Tony Hawk Foundation is an organization that is geared towards providing youths with the resources to safely and legally hone their craft of skate boarding. In November of 2008, the entertainment elite and action sport pros met to raise money in the fifth annual Activision Presents Stand Up For......

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