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

Warning: Illegal string offset 'echo' in /var/www/html/wp-great-seo/wp-content/themes/social/library/extensions/custom-field-series.php on line 79

2 Comments


  1. Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /var/www/html/wp-great-seo/wp-content/plugins/user-photo/user-photo.php:203 Stack trace: #0 /var/www/html/wp-great-seo/wp-includes/class-wp-hook.php(300): userphoto_filter_get_avatar('<img alt='Jeff'...', 'sunshine@yahoo....', 80, 'mm') #1 /var/www/html/wp-great-seo/wp-includes/plugin.php(203): WP_Hook->apply_filters('<img alt='Jeff'...', Array) #2 /var/www/html/wp-great-seo/wp-includes/pluggable.php(2455): apply_filters('get_avatar', '<img alt='Jeff'...', 'sunshine@yahoo....', 80, 'mm', 'Jeff', Array) #3 /var/www/html/wp-great-seo/wp-content/themes/social/library/functions/comments.php(76): get_avatar('sunshine@yahoo....', '80', NULL, 'Jeff') #4 /var/www/html/wp-great-seo/wp-content/themes/social/library/functions/comments.php(103): hybrid_avatar() #5 /var/www/html/wp-great-seo/wp-includes/class-walker-comment.php(180): hybrid_comments_callback(Object(WP_Comment), Array, 1) #6 /var/www/html/wp-great-seo/wp-includes/class-wp-walker.php(146): in /var/www/html/wp-great-seo/wp-content/plugins/user-photo/user-photo.php on line 203