Friday, March 9, 2012

Problem when connect to SQL Server 2005 (SQL Native Client + Named instance)

Hi,
I have an application which previous connect to SQL Server 2000.
Now, I installed SQL Server 2005, and try to conncet to it.
The previous connection string is:
sString.Format("DSN=%s;uid=%s;pwd=%s", sDb, sUser, sPassword);
In order to support SQL Native Client driver in SQL Server 2005, I
changed the connection string to:
sString.Format("Provider=SQLNCLI;
DataTypeCompatibility=80;DSN=%s;uid=%s;pwd=%s", sDb, sUser,
sPassword);
I have a default instance and a named instance in my database. So i
created two DSN:
(1) Use SQL Native Client as the driver and connect to the default
instance.
The application could work well under this configuration.
(2) Use SQL Native Client as the driver and connect to the named
instance.
The application could not work successfully under this
configuration.
It could not connect to the database.
I have started the SQL Server Browser service.
Why I could not connect to the database when i use SQL Native Client +
Named instance
Who can help me?
Thanks in advance.
Did you enable the Allow Remote Connections option? Have you run the
Surface Area Configurator and the SQL Server Configuration Manager?
Andrew J. Kelly SQL MVP
<yangrudy@.126.com> wrote in message
news:1140155887.725187.43270@.g44g2000cwa.googlegro ups.com...
> Hi,
> I have an application which previous connect to SQL Server 2000.
> Now, I installed SQL Server 2005, and try to conncet to it.
> The previous connection string is:
> sString.Format("DSN=%s;uid=%s;pwd=%s", sDb, sUser, sPassword);
> In order to support SQL Native Client driver in SQL Server 2005, I
> changed the connection string to:
> sString.Format("Provider=SQLNCLI;
> DataTypeCompatibility=80;DSN=%s;uid=%s;pwd=%s", sDb, sUser,
> sPassword);
> I have a default instance and a named instance in my database. So i
> created two DSN:
> (1) Use SQL Native Client as the driver and connect to the default
> instance.
> The application could work well under this configuration.
> (2) Use SQL Native Client as the driver and connect to the named
> instance.
> The application could not work successfully under this
> configuration.
> It could not connect to the database.
> I have started the SQL Server Browser service.
> Why I could not connect to the database when i use SQL Native Client +
> Named instance
> Who can help me?
> Thanks in advance.
>

No comments:

Post a Comment