Groups | Blog | Home
all groups > sql server connect > august 2007 >

sql server connect : HELP: SQL Server 2005 Express OLEDB Connection from VB6



thompsom NO[at]SPAM aecl.ca
8/22/2007 7:57:12 AM
Hi.

I cannot connect to SQL Server 2005 Express on a Windows XP SP2
machine from a Windows 2000 PC using the SQLNCLI OLEDB provider in
VB6. I can create an ODBC System DSN and connect just fine, but I
cannot use a connection string with "Provider=SQLNCLI" or
"Provider=SQLNCLI.1". I always get...

Run-time error '3706': Provider cannot be found. It may not be
properly installed.

Windows Firewall is disabled as our network uses third-party security
software, so it is not a firewall exception problem. I have used SQL
Server Configuration Manager to enable TCP/IP and Named Pipes server
and client protocols, and the Surface Area Configuration for Services
and Connections to allow remote connections using both TCP/IP and
named pipes.

Both the SQL Server service and the SQL Server Browser services are
running, and the SQL Native Client software is definitely installed.

As I said, an ODBC DSN works just fine. What gives with the SQLNCLI
provider?

I have been to www.connectionstrings.com and have tried a number of
other connection strings I have found on the web - to no avail.

Here's an example of what I've tried:

cn.ConnectionString = "Provider=SQLNCLI;" & _
"Server=<nodename>\SQLExpress;" & _
"Database=ChemDB;" & _
"Integrated Security=SSPI"


Any troubleshooting advice would be greatly appreciated.

TIA,
Mike
William Vaughn
8/22/2007 9:36:46 AM
http://www.microsoft.com/downloads/details.aspx?FamilyId=50b97994-8453-4998-8226-fa42ec403d17&DisplayLang=en
says you have to install the SNAC provider--the fact that ADO can't find it
sounds like you skipped a step.

Microsoft SQL Server Native Client
Microsoft SQL Server Native Client (SQL Native Client) is a single
dynamic-link library (DLL) containing both the SQL OLE DB provider and SQL
ODBC driver. It contains run-time support for applications using native-code
APIs (ODBC, OLE DB and ADO) to connect to Microsoft SQL Server 7.0, 2000 or
2005. SQL Native Client should be used to create new applications or enhance
existing applications that need to take advantage of new SQL Server 2005
features. This redistributable installer for SQL Native Client installs the
client components needed during run time to take advantage of new SQL Server
2005 features, and optionally installs the header files needed to develop an
application that uses the SQL Native Client API.

Audience(s): Partner, Developer


X86 Package (sqlncli.msi) - 3516 KB
X64 Package (sqlncli_x64.msi) - 6403 KB
IA64 Package (sqlncli_ia64.msi) - 8376 KB




--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]
Mike Thompson
8/22/2007 2:49:30 PM
Thanks, Bill.

I (naively) wasn't aware that SQLNCLI (sqlncli.msi) had to be installed on
the client PC for an OLEDB connection, unlike ODBC where all you have to do
is define a System DSN using the SQL Server Driver already in existence.
Thanks for getting me to read this again and realizing they meant the client
PC.

I think we'll stick with ODBC, since there is less to install on the client
PC.

Mike
Son, Husband, Father, Dog Owner

[quoted text, click to view]

William Vaughn
8/22/2007 3:10:06 PM
Okay, but consider that the SNAC provider has no (evil) MDAC dependency and
exposes the entire gamut of SQL Server 2005 features--the ODBC provider does
not (expose all the features and types).

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]
AddThis Social Bookmark Button