Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Thursday, March 29, 2012

Adding a ODBC link to many computers

Is there any way of adding an OBDC connection to multiple computers without
going to each system. I need to push out a new SQL Server connection, does
anyone know an easy way.
Thanks!
Use a DSN-less connection.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"HenryG" <HenryG@.discussions.microsoft.com> wrote in message
news:49B3EF04-D325-462C-9FFC-A79600D0CAD9@.microsoft.com...
> Is there any way of adding an OBDC connection to multiple computers
> without
> going to each system. I need to push out a new SQL Server connection,
> does
> anyone know an easy way.
> Thanks!
sql

Sunday, March 25, 2012

Adding a data connection in Visual Studio

Not sure if I should add this in this forum or in a VS forum, but here goes.

I have a Visual Studio project setup using VB.Net 2005 RTM. I have a SQL2000 data connection set up and it is working. We have just added a SQL2000 database that is on the same server as a named instance. When I go to add the 2000 SQL data connection all I can see is the name of the Server and the 2005 databases. Both the SQL2005 and the SQL2000 are on a box cleverly called SERVER. In the "Add Connection" dialog box I enter Server as the server name and then when I click on the dropdown for the databases I just see the SQL2005 database. The 2000 instance name is SQL2000 so I entered \\Server\SQL2000 as the server name but that didn't get me anything. Any suggestions?

Thanks...

To connect to a named instance, you specify the server name in the connection dialog as <servername>\<instancename>. So in your environment, you would enter SERVER\SQL2000. Remove the leading backslashes and you should be ok.

jeff.

Adding a data connection in Visual Studio

Not sure if I should add this in this forum or in a VS forum, but here goes.

I have a Visual Studio project setup using VB.Net 2005 RTM. I have a SQL2000 data connection set up and it is working. We have just added a SQL2000 database that is on the same server as a named instance. When I go to add the 2000 SQL data connection all I can see is the name of the Server and the 2005 databases. Both the SQL2005 and the SQL2000 are on a box cleverly called SERVER. In the "Add Connection" dialog box I enter Server as the server name and then when I click on the dropdown for the databases I just see the SQL2005 database. The 2000 instance name is SQL2000 so I entered \\Server\SQL2000 as the server name but that didn't get me anything. Any suggestions?

Thanks...

To connect to a named instance, you specify the server name in the connection dialog as <servername>\<instancename>. So in your environment, you would enter SERVER\SQL2000. Remove the leading backslashes and you should be ok.

jeff.

Adding a Connection in Visual C++ 2005 Express

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

The error above sometimes happens when the instance name is incorrect, and the SqlClient provider infers that it is connecting to a SQL Server 2000 (even if none is installed).

Was the SQL Express installed as a named instance named "SQLEXPRESS" (which is the default case)?

You can verify this by opening a command windo and run

net start | findstr -i "sql"

You can verify the instance name used by the opening the "Advanced" tab in the "Add Connection" window.

It should match the instance name of the installed SQL Express.

|||I'm having the same problem connecting to SQL Server 2005 Express.

C:\net start | findstr -i "sql"
PostgreSQL Database Server 8.1
SQL Server (SQLEXPRESS)

/////////////////////////////////////////////////////////////////////

CDatabase dbDateServ;

dbDateServ.Open("ODBC; DSN=MyDSN; UID=myuid; PWD=mypass; DATABASE=mydatabase");

How do I determine the following:
1) How do I determine what the DSN is?
2) How do I determine what my UID is?
3 )How do I determine what my PWD is (or how to set it)?
4) Example database I can use within SQL Server 2005 express?

Adding a Connection in Visual C++ 2005 Express

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

heimdaloz wrote:

I am new to SQL Server 2005 and Visual C++ 2005 Express.

When I try and add a connection in Visual C++:

DataSource: SQL Server Database File

File Name: c:\.......file.mdf

Windows Authentication

I get the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow remote connections. (provider: Share Memeory Provider, error:36 - The Shared Memory dll used to connect to SQL Server 2000 was not found)

Any ideas?

Try this:

in MFC - Visual C++

CDatabase dbData;

CString szConectSql;

szConectSql = "ODBC; DSN=.SQL Server Database File; UID=sa; PWD=pwd_sa(Your_pwd_sa); DATABASE=name_of_database_you";

dbData.Open(szConectSql);

dbData.Close();

In MFC is OK!

|||

The error above sometimes happens when the instance name is incorrect, and the SqlClient provider infers that it is connecting to a SQL Server 2000 (even if none is installed).

Was the SQL Express installed as a named instance named "SQLEXPRESS" (which is the default case)?

You can verify this by opening a command windo and run

net start | findstr -i "sql"

You can verify the instance name used by the opening the "Advanced" tab in the "Add Connection" window.

It should match the instance name of the installed SQL Express.

|||I'm having the same problem connecting to SQL Server 2005 Express.

C:\net start | findstr -i "sql"
PostgreSQL Database Server 8.1
SQL Server (SQLEXPRESS)

/////////////////////////////////////////////////////////////////////

CDatabase dbDateServ;

dbDateServ.Open("ODBC; DSN=MyDSN; UID=myuid; PWD=mypass; DATABASE=mydatabase");

How do I determine the following:
1) How do I determine what the DSN is?
2) How do I determine what my UID is?
3 )How do I determine what my PWD is (or how to set it)?
4) Example database I can use within SQL Server 2005 express?

Sunday, March 11, 2012

Add Reporting Services to Trusted Accounts

I installed SQL 2005 SP2 and RS add-in for Sharepoint to a WSS 3.0 site.

I get the error: 'A connection to the server cannot be established' when I try to use the sharepoint account set up for this purpose. It is in the farm administrators, and has the required permissions when I check the database. Are there any other recommended troubleshooting tips that I can do? Thanks.

Dan

FYI - I resolved the problem by adding the account to the local group WSS_RESTRICTED_WPG. This account needs to be in the Local Administrator's group, and the groups starting with WSS.

Friday, February 24, 2012

Add connection error: 40

Hi i just reinstalled windows, and installed visual studio .net 2005 and the Sql server.

But when im trying to add connection, select my computer at Server

name, type a databasename then pressing OK i get this message:

An error has occured while estabilishing a connection to the server.

When connection to SQL server 2005, this faliure may be caused by the

fact that under the default settings SQL Server does not allow remote

connections. (provider: Names pipes provider, error: 40 - Could not

open a connection to SQL Server)

Does anyone know what todo?

hermanTry this: open the SQL Server Configuration Manager, expand SQL Server 2005 Network Configuration, highlight protocols for MSSQLSERVER and enable TCIP/IP.

Mike

Add connction Fails in VS.NET with SQL Server Everywhere

When I try to use the "Data Source Configuration Wizard" (Menu: Data\Add New Data Source...) and I try to add a new Connection to the "Northwind.sdf" database using Microsoft SQL Server Mobile Edition it fails with

"Unable to find the requested .Net Framework Data Provider. It may not be installed."

What's really strange about this is that if I click the Test Connection" button it states "Test Connection Succeeded."

I've looked everywhere and I see that other have had the same problem but no one seem to know the solution.

jc3

This usually happens if you un-install .Net Fx and re-install. So please go to ADd Remove programs and do repair for Microsoft SQL Server 2005 Mobile Developer Tools. This will add some extra config entries which will help you.|||

Nope, unfortunately that was not the cause of the problem because I never un-installed (or re-installed) .NET FX, but here's what I did to figure it out...

1. I did a repair of Visual Studio but that didn't work.

2. I wrote a sample application that just opened a connection and loaded a dataset and that worked so this particular problem is strictly a Visual Studio issue.

3. I got on a friends machine whose "Data Source Configuration Wizard" worked and ran FileMon (from SysInternals) to see what the wizard was actually doing and noticed it was reading from Machine.config so I searched his Machine.config and noticed an entry for "SQL Server CE Data Provider" that my copy of Machine.config did not have.

4. Since I was using the latest CTP and he was using the default version that shipped with VS I didn't copy his entry but instead composed my own using one of the other as a template as well as using the GAC for PublicKeyToken, Version and other info.

So, to recap:
Apparently, Visual Studio 2005 uses the Machine.config when you are running the "Data Source Configuration Wizard" to generate a data connection for Server Explorer's Data Connections.

Here's a copy of my missing entry:
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Also, I actually never got a notification about your reply even though I had "Alert Me" set up. Strange, I only signed on to update this issue with what I did to fix it.

jc3

|||

this didn't work for me... no matter what I try, I cannot get the database to connect from the designer!! I've installed the RC1 but when I go to add a new connection, there's nothing there for the compact/mobile edition :( any ideas what's going on? that entry is in my machine.config, but instead of microsoft.sqlserverce.clinent it's system.data.sqlserverce which is the right name for the dll file...

-SelArom

|||1. Install VS2005
2. Install VS2005 SP1 Beta
http://www.microsoft.com/downloads/details.aspx?FamilyID=8d702463-674b-4978-9e22-c989130f6553&DisplayLang=en
3. Install SQL Server Ce
4. Install SQL Server CE tools

Then you can open up a project and add a .sdf file (say Northwind) when the Data Source Configuration Wizard will auto start.|||

tools will not install! it says that I don't have the right version to be updated?!! what is that all about? I did install vs 2005, then sp1 beta then ce... now as I try tools it gives me that error... wtf?

-SelArom

|||

okay here is the exact error message:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade path.

I don't know what else I can verify, as I have installed visual studio 2005 and SP1, then Sql Server Compact Edition RC1. So what gives?

-SelArom

|||

Has anyone been able to resolve the issue surrounding the above error message, when attempting to install the "SQL Server Everywhere Tools for Visual Studio."

I get the same error message attempting to install the beta Toolset. Note that I am attempting to install the Tools on top of the just-released Visual Studio 2005 Service Pack 1 (not the beta as is specified in the instructions).

Any words of wisdom would be very helpful.

Thanks, Rob V

|||Adding the entry in Machine.config works fine for me, thanks!|||

I faced the same issue, however in my machine.config the entry was not missing but preceeded by another one.

<add name="SQL Server Everywhere Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Commenting or deleting the first one solves the problem.

Add connction Fails in VS.NET with SQL Server Everywhere

When I try to use the "Data Source Configuration Wizard" (Menu: Data\Add New Data Source...) and I try to add a new Connection to the "Northwind.sdf" database using Microsoft SQL Server Mobile Edition it fails with

"Unable to find the requested .Net Framework Data Provider. It may not be installed."

What's really strange about this is that if I click the Test Connection" button it states "Test Connection Succeeded."

I've looked everywhere and I see that other have had the same problem but no one seem to know the solution.

jc3

This usually happens if you un-install .Net Fx and re-install. So please go to ADd Remove programs and do repair for Microsoft SQL Server 2005 Mobile Developer Tools. This will add some extra config entries which will help you.|||

Nope, unfortunately that was not the cause of the problem because I never un-installed (or re-installed) .NET FX, but here's what I did to figure it out...

1. I did a repair of Visual Studio but that didn't work.

2. I wrote a sample application that just opened a connection and loaded a dataset and that worked so this particular problem is strictly a Visual Studio issue.

3. I got on a friends machine whose "Data Source Configuration Wizard" worked and ran FileMon (from SysInternals) to see what the wizard was actually doing and noticed it was reading from Machine.config so I searched his Machine.config and noticed an entry for "SQL Server CE Data Provider" that my copy of Machine.config did not have.

4. Since I was using the latest CTP and he was using the default version that shipped with VS I didn't copy his entry but instead composed my own using one of the other as a template as well as using the GAC for PublicKeyToken, Version and other info.

So, to recap:
Apparently, Visual Studio 2005 uses the Machine.config when you are running the "Data Source Configuration Wizard" to generate a data connection for Server Explorer's Data Connections.

Here's a copy of my missing entry:
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Also, I actually never got a notification about your reply even though I had "Alert Me" set up. Strange, I only signed on to update this issue with what I did to fix it.

jc3

|||

this didn't work for me... no matter what I try, I cannot get the database to connect from the designer!! I've installed the RC1 but when I go to add a new connection, there's nothing there for the compact/mobile edition :( any ideas what's going on? that entry is in my machine.config, but instead of microsoft.sqlserverce.clinent it's system.data.sqlserverce which is the right name for the dll file...

-SelArom

|||1. Install VS2005
2. Install VS2005 SP1 Beta
http://www.microsoft.com/downloads/details.aspx?FamilyID=8d702463-674b-4978-9e22-c989130f6553&DisplayLang=en
3. Install SQL Server Ce
4. Install SQL Server CE tools

Then you can open up a project and add a .sdf file (say Northwind) when the Data Source Configuration Wizard will auto start.|||

tools will not install! it says that I don't have the right version to be updated?!! what is that all about? I did install vs 2005, then sp1 beta then ce... now as I try tools it gives me that error... wtf?

-SelArom

|||

okay here is the exact error message:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade path.

I don't know what else I can verify, as I have installed visual studio 2005 and SP1, then Sql Server Compact Edition RC1. So what gives?

-SelArom

|||

Has anyone been able to resolve the issue surrounding the above error message, when attempting to install the "SQL Server Everywhere Tools for Visual Studio."

I get the same error message attempting to install the beta Toolset. Note that I am attempting to install the Tools on top of the just-released Visual Studio 2005 Service Pack 1 (not the beta as is specified in the instructions).

Any words of wisdom would be very helpful.

Thanks, Rob V

|||Adding the entry in Machine.config works fine for me, thanks!|||

I faced the same issue, however in my machine.config the entry was not missing but preceeded by another one.

<add name="SQL Server Everywhere Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Commenting or deleting the first one solves the problem.

Add connction Fails in VS.NET with SQL Server Everywhere

When I try to use the "Data Source Configuration Wizard" (Menu: Data\Add New Data Source...) and I try to add a new Connection to the "Northwind.sdf" database using Microsoft SQL Server Mobile Edition it fails with

"Unable to find the requested .Net Framework Data Provider. It may not be installed."

What's really strange about this is that if I click the Test Connection" button it states "Test Connection Succeeded."

I've looked everywhere and I see that other have had the same problem but no one seem to know the solution.

jc3

This usually happens if you un-install .Net Fx and re-install. So please go to ADd Remove programs and do repair for Microsoft SQL Server 2005 Mobile Developer Tools. This will add some extra config entries which will help you.|||

Nope, unfortunately that was not the cause of the problem because I never un-installed (or re-installed) .NET FX, but here's what I did to figure it out...

1. I did a repair of Visual Studio but that didn't work.

2. I wrote a sample application that just opened a connection and loaded a dataset and that worked so this particular problem is strictly a Visual Studio issue.

3. I got on a friends machine whose "Data Source Configuration Wizard" worked and ran FileMon (from SysInternals) to see what the wizard was actually doing and noticed it was reading from Machine.config so I searched his Machine.config and noticed an entry for "SQL Server CE Data Provider" that my copy of Machine.config did not have.

4. Since I was using the latest CTP and he was using the default version that shipped with VS I didn't copy his entry but instead composed my own using one of the other as a template as well as using the GAC for PublicKeyToken, Version and other info.

So, to recap:
Apparently, Visual Studio 2005 uses the Machine.config when you are running the "Data Source Configuration Wizard" to generate a data connection for Server Explorer's Data Connections.

Here's a copy of my missing entry:
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Also, I actually never got a notification about your reply even though I had "Alert Me" set up. Strange, I only signed on to update this issue with what I did to fix it.

jc3

|||

this didn't work for me... no matter what I try, I cannot get the database to connect from the designer!! I've installed the RC1 but when I go to add a new connection, there's nothing there for the compact/mobile edition :( any ideas what's going on? that entry is in my machine.config, but instead of microsoft.sqlserverce.clinent it's system.data.sqlserverce which is the right name for the dll file...

-SelArom

|||1. Install VS2005
2. Install VS2005 SP1 Beta
http://www.microsoft.com/downloads/details.aspx?FamilyID=8d702463-674b-4978-9e22-c989130f6553&DisplayLang=en
3. Install SQL Server Ce
4. Install SQL Server CE tools

Then you can open up a project and add a .sdf file (say Northwind) when the Data Source Configuration Wizard will auto start.|||

tools will not install! it says that I don't have the right version to be updated?!! what is that all about? I did install vs 2005, then sp1 beta then ce... now as I try tools it gives me that error... wtf?

-SelArom

|||

okay here is the exact error message:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade path.

I don't know what else I can verify, as I have installed visual studio 2005 and SP1, then Sql Server Compact Edition RC1. So what gives?

-SelArom

|||

Has anyone been able to resolve the issue surrounding the above error message, when attempting to install the "SQL Server Everywhere Tools for Visual Studio."

I get the same error message attempting to install the beta Toolset. Note that I am attempting to install the Tools on top of the just-released Visual Studio 2005 Service Pack 1 (not the beta as is specified in the instructions).

Any words of wisdom would be very helpful.

Thanks, Rob V

|||Adding the entry in Machine.config works fine for me, thanks!|||

I faced the same issue, however in my machine.config the entry was not missing but preceeded by another one.

<add name="SQL Server Everywhere Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Commenting or deleting the first one solves the problem.

Add connction Fails in VS.NET with SQL Server Everywhere

When I try to use the "Data Source Configuration Wizard" (Menu: Data\Add New Data Source...) and I try to add a new Connection to the "Northwind.sdf" database using Microsoft SQL Server Mobile Edition it fails with

"Unable to find the requested .Net Framework Data Provider. It may not be installed."

What's really strange about this is that if I click the Test Connection" button it states "Test Connection Succeeded."

I've looked everywhere and I see that other have had the same problem but no one seem to know the solution.

jc3

This usually happens if you un-install .Net Fx and re-install. So please go to ADd Remove programs and do repair for Microsoft SQL Server 2005 Mobile Developer Tools. This will add some extra config entries which will help you.|||

Nope, unfortunately that was not the cause of the problem because I never un-installed (or re-installed) .NET FX, but here's what I did to figure it out...

1. I did a repair of Visual Studio but that didn't work.

2. I wrote a sample application that just opened a connection and loaded a dataset and that worked so this particular problem is strictly a Visual Studio issue.

3. I got on a friends machine whose "Data Source Configuration Wizard" worked and ran FileMon (from SysInternals) to see what the wizard was actually doing and noticed it was reading from Machine.config so I searched his Machine.config and noticed an entry for "SQL Server CE Data Provider" that my copy of Machine.config did not have.

4. Since I was using the latest CTP and he was using the default version that shipped with VS I didn't copy his entry but instead composed my own using one of the other as a template as well as using the GAC for PublicKeyToken, Version and other info.

So, to recap:
Apparently, Visual Studio 2005 uses the Machine.config when you are running the "Data Source Configuration Wizard" to generate a data connection for Server Explorer's Data Connections.

Here's a copy of my missing entry:
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Also, I actually never got a notification about your reply even though I had "Alert Me" set up. Strange, I only signed on to update this issue with what I did to fix it.

jc3

|||

this didn't work for me... no matter what I try, I cannot get the database to connect from the designer!! I've installed the RC1 but when I go to add a new connection, there's nothing there for the compact/mobile edition :( any ideas what's going on? that entry is in my machine.config, but instead of microsoft.sqlserverce.clinent it's system.data.sqlserverce which is the right name for the dll file...

-SelArom

|||1. Install VS2005
2. Install VS2005 SP1 Beta
http://www.microsoft.com/downloads/details.aspx?FamilyID=8d702463-674b-4978-9e22-c989130f6553&DisplayLang=en
3. Install SQL Server Ce
4. Install SQL Server CE tools

Then you can open up a project and add a .sdf file (say Northwind) when the Data Source Configuration Wizard will auto start.|||

tools will not install! it says that I don't have the right version to be updated?!! what is that all about? I did install vs 2005, then sp1 beta then ce... now as I try tools it gives me that error... wtf?

-SelArom

|||

okay here is the exact error message:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade path.

I don't know what else I can verify, as I have installed visual studio 2005 and SP1, then Sql Server Compact Edition RC1. So what gives?

-SelArom

|||

Has anyone been able to resolve the issue surrounding the above error message, when attempting to install the "SQL Server Everywhere Tools for Visual Studio."

I get the same error message attempting to install the beta Toolset. Note that I am attempting to install the Tools on top of the just-released Visual Studio 2005 Service Pack 1 (not the beta as is specified in the instructions).

Any words of wisdom would be very helpful.

Thanks, Rob V

|||Adding the entry in Machine.config works fine for me, thanks!|||

I faced the same issue, however in my machine.config the entry was not missing but preceeded by another one.

<add name="SQL Server Everywhere Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Commenting or deleting the first one solves the problem.

Add connction Fails in VS.NET with SQL Server Everywhere

When I try to use the "Data Source Configuration Wizard" (Menu: Data\Add New Data Source...) and I try to add a new Connection to the "Northwind.sdf" database using Microsoft SQL Server Mobile Edition it fails with

"Unable to find the requested .Net Framework Data Provider. It may not be installed."

What's really strange about this is that if I click the Test Connection" button it states "Test Connection Succeeded."

I've looked everywhere and I see that other have had the same problem but no one seem to know the solution.

jc3

This usually happens if you un-install .Net Fx and re-install. So please go to ADd Remove programs and do repair for Microsoft SQL Server 2005 Mobile Developer Tools. This will add some extra config entries which will help you.|||

Nope, unfortunately that was not the cause of the problem because I never un-installed (or re-installed) .NET FX, but here's what I did to figure it out...

1. I did a repair of Visual Studio but that didn't work.

2. I wrote a sample application that just opened a connection and loaded a dataset and that worked so this particular problem is strictly a Visual Studio issue.

3. I got on a friends machine whose "Data Source Configuration Wizard" worked and ran FileMon (from SysInternals) to see what the wizard was actually doing and noticed it was reading from Machine.config so I searched his Machine.config and noticed an entry for "SQL Server CE Data Provider" that my copy of Machine.config did not have.

4. Since I was using the latest CTP and he was using the default version that shipped with VS I didn't copy his entry but instead composed my own using one of the other as a template as well as using the GAC for PublicKeyToken, Version and other info.

So, to recap:
Apparently, Visual Studio 2005 uses the Machine.config when you are running the "Data Source Configuration Wizard" to generate a data connection for Server Explorer's Data Connections.

Here's a copy of my missing entry:
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Also, I actually never got a notification about your reply even though I had "Alert Me" set up. Strange, I only signed on to update this issue with what I did to fix it.

jc3

|||

this didn't work for me... no matter what I try, I cannot get the database to connect from the designer!! I've installed the RC1 but when I go to add a new connection, there's nothing there for the compact/mobile edition :( any ideas what's going on? that entry is in my machine.config, but instead of microsoft.sqlserverce.clinent it's system.data.sqlserverce which is the right name for the dll file...

-SelArom

|||1. Install VS2005
2. Install VS2005 SP1 Beta
http://www.microsoft.com/downloads/details.aspx?FamilyID=8d702463-674b-4978-9e22-c989130f6553&DisplayLang=en
3. Install SQL Server Ce
4. Install SQL Server CE tools

Then you can open up a project and add a .sdf file (say Northwind) when the Data Source Configuration Wizard will auto start.|||

tools will not install! it says that I don't have the right version to be updated?!! what is that all about? I did install vs 2005, then sp1 beta then ce... now as I try tools it gives me that error... wtf?

-SelArom

|||

okay here is the exact error message:

The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade path.

I don't know what else I can verify, as I have installed visual studio 2005 and SP1, then Sql Server Compact Edition RC1. So what gives?

-SelArom

|||

Has anyone been able to resolve the issue surrounding the above error message, when attempting to install the "SQL Server Everywhere Tools for Visual Studio."

I get the same error message attempting to install the beta Toolset. Note that I am attempting to install the Tools on top of the just-released Visual Studio 2005 Service Pack 1 (not the beta as is specified in the instructions).

Any words of wisdom would be very helpful.

Thanks, Rob V

|||Adding the entry in Machine.config works fine for me, thanks!|||

I faced the same issue, however in my machine.config the entry was not missing but preceeded by another one.

<add name="SQL Server Everywhere Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

<add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Commenting or deleting the first one solves the problem.

Thursday, February 16, 2012

Add a new data source to a SQL Server Compact Edition

I have installed SQL Server 2005 CE on my computer, but when I try to add a data connection to a CE database in Visual Studio 2005, I cannot find the option "SQL Server 2005 Combact Edition". Why?

Hi,

see this here: http://img366.imageshack.us/img366/555/untitledph0.jpg
-Jens.

|||I have the same issue. I install the SQL compact framework runtime, SDK, and VS2K5 components but the option is never listed in the potential data sources for any project. I can create as many SQL server, SQL server express, or Access databases as I want, but the option for the Compact Edition just isn't listed.|||Hi,

I face the exactly the same problem. Have anyone found the solution to this?
thanks.

regards,
TY|||Hi,

Finally i got the problem fixed. Seem like there are some name conflict within the VS2005 for the Mobile Edition and Compact Edition. Just need to install the VS2005 SP1 all those problem will automatic fixed.
thanks.

regards,
Tze Yang

Add a new data source to a SQL Server Compact Edition

I have installed SQL Server 2005 CE on my computer, but when I try to add a data connection to a CE database in Visual Studio 2005, I cannot find the option "SQL Server 2005 Combact Edition". Why?

Hi,

see this here: http://img366.imageshack.us/img366/555/untitledph0.jpg
-Jens.

|||I have the same issue. I install the SQL compact framework runtime, SDK, and VS2K5 components but the option is never listed in the potential data sources for any project. I can create as many SQL server, SQL server express, or Access databases as I want, but the option for the Compact Edition just isn't listed.|||Hi,

I face the exactly the same problem. Have anyone found the solution to this?
thanks.

regards,
TY
|||Hi,

Finally i got the problem fixed. Seem like there are some name conflict within the VS2005 for the Mobile Edition and Compact Edition. Just need to install the VS2005 SP1 all those problem will automatic fixed.
thanks.

regards,
Tze Yang

Monday, February 13, 2012

AD/ SQL Server 2000/ Trusted Connection in .Net

Hi,
I have a Windows Application, a Novell Network and a SQL Server 2000 on an
Active Directory controlled server. My AD account has access to teh database.
I want to login to the database using an Active Directory account, trusted
security...but I can't.
Sequence of Events:
1. Login to Network using Novell account.
2. Start Application and it displays login screen.
3. Enter AD account details and press OK
4. This verifies against Active Directory Account using the following code:
visual basic
code:---- Public Function Login() As String
' now create the directory entry to establish connection
Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
Me.strPass, Me.atAuthentType)
Try
' if user is verified then it will welcome then
Try
Return deDirEntry.Username
Catch exp As Exception
Return ""
End Try
Finally
'deDirEntry.Dispose()
End Try
End Function 'Login
This all works fine and returns the username if the credentials match
5. Make database connection string (sUserName is the AD username):
visual basic
code:----Dim
sConnstring As String = "User ID=" & sUserName & ";Initial
Catalog=VendorSample;Data
Source=MyServer...;Timeout=20;Trusted_Connection=T rue"----
6. I get the following error:
Login failed for user '(null)'. Reason: Not associated witha trusted SQl
Server connection.
I'm not well up on how AD works etc. but does anybody have any idea how to
get past this? I presume the problem is that it is not recognising the
username passed as the account I want to use.
There are two ways to logging into SQL Server: WIndows Security
(Trusted_Connection) or SQL Server Security. In either case, your "Login"
function is useless.
In your connectionString, you have "Trusted_Connection=True", that implies
the SQL Server uses Windows security, meaning, you do not need pass
username/password pair in ConnectionString (even there is user/password,
they are ignored). That means SQL Server accept the current windows/AD user
account credential, and then does the authorization based on this
credential. As long as the the windows/AD user account (which is running
your app) is given adequate permission to what he needs, the app should run
fine.
If you use SQL Server security (it must be enabled), you must have
user/password pair in the ConnectionString, and SQL Server authenticates it,
regardless whether you have done it in your own "Login" function or not. SO,
your "Login" function does nothing usefull here.
"Dec" <Dec@.discussions.microsoft.com> wrote in message
news:E608FA02-488A-4E9A-BC5B-9AF816F28F87@.microsoft.com...
> Hi,
> I have a Windows Application, a Novell Network and a SQL Server 2000 on an
> Active Directory controlled server. My AD account has access to teh
> database.
> I want to login to the database using an Active Directory account, trusted
> security...but I can't.
> Sequence of Events:
> 1. Login to Network using Novell account.
> 2. Start Application and it displays login screen.
> 3. Enter AD account details and press OK
> 4. This verifies against Active Directory Account using the following
> code:
>
> visual basic
> code:----
> Public Function Login() As String
> ' now create the directory entry to establish connection
> Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
> Me.strPass, Me.atAuthentType)
> Try
> ' if user is verified then it will welcome then
> Try
> Return deDirEntry.Username
> Catch exp As Exception
> Return ""
> End Try
> Finally
> 'deDirEntry.Dispose()
> End Try
> End Function 'Login
> ----
> This all works fine and returns the username if the credentials match
> 5. Make database connection string (sUserName is the AD username):
> visual basic
> code:----Dim
> sConnstring As String = "User ID=" & sUserName & ";Initial
> Catalog=VendorSample;Data
> Source=MyServer...;Timeout=20;Trusted_Connection=T rue"----
> 6. I get the following error:
> Login failed for user '(null)'. Reason: Not associated witha trusted SQl
> Server connection.
> I'm not well up on how AD works etc. but does anybody have any idea how to
> get past this? I presume the problem is that it is not recognising the
> username passed as the account I want to use.
|||Hi,
If I have logged onto pc/ network using a windows account, will the app
always run using this account? If so, is there any way to change this so that
the app run using an AD account instead? As you've probably guesed, I'm not
well up on Windows/ AD accounts etc. so please explain in very simple terms!!
Thanks.
"Norman Yuan" wrote:

> There are two ways to logging into SQL Server: WIndows Security
> (Trusted_Connection) or SQL Server Security. In either case, your "Login"
> function is useless.
> In your connectionString, you have "Trusted_Connection=True", that implies
> the SQL Server uses Windows security, meaning, you do not need pass
> username/password pair in ConnectionString (even there is user/password,
> they are ignored). That means SQL Server accept the current windows/AD user
> account credential, and then does the authorization based on this
> credential. As long as the the windows/AD user account (which is running
> your app) is given adequate permission to what he needs, the app should run
> fine.
> If you use SQL Server security (it must be enabled), you must have
> user/password pair in the ConnectionString, and SQL Server authenticates it,
> regardless whether you have done it in your own "Login" function or not. SO,
> your "Login" function does nothing usefull here.
>
> "Dec" <Dec@.discussions.microsoft.com> wrote in message
> news:E608FA02-488A-4E9A-BC5B-9AF816F28F87@.microsoft.com...
>
>

AD/ SQL Server 2000/ Trusted Connection in .Net

Hi,
I have a Windows Application, a Novell Network and a SQL Server 2000 on an
Active Directory controlled server. My AD account has access to teh database.
I want to login to the database using an Active Directory account, trusted
security...but I can't.
Sequence of Events:
1. Login to Network using Novell account.
2. Start Application and it displays login screen.
3. Enter AD account details and press OK
4. This verifies against Active Directory Account using the following code:
visual basic
code:---- Public Function Login() As String
' now create the directory entry to establish connection
Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
Me.strPass, Me.atAuthentType)
Try
' if user is verified then it will welcome then
Try
Return deDirEntry.Username
Catch exp As Exception
Return ""
End Try
Finally
'deDirEntry.Dispose()
End Try
End Function 'Login
----
This all works fine and returns the username if the credentials match
5. Make database connection string (sUserName is the AD username):
visual basic
code:----Dim
sConnstring As String = "User ID=" & sUserName & ";Initial
Catalog=VendorSample;Data
Source=MyServer...;Timeout=20;Trusted_Connection=True"----
6. I get the following error:
Login failed for user '(null)'. Reason: Not associated witha trusted SQl
Server connection.
I'm not well up on how AD works etc. but does anybody have any idea how to
get past this? I presume the problem is that it is not recognising the
username passed as the account I want to use.There are two ways to logging into SQL Server: WIndows Security
(Trusted_Connection) or SQL Server Security. In either case, your "Login"
function is useless.
In your connectionString, you have "Trusted_Connection=True", that implies
the SQL Server uses Windows security, meaning, you do not need pass
username/password pair in ConnectionString (even there is user/password,
they are ignored). That means SQL Server accept the current windows/AD user
account credential, and then does the authorization based on this
credential. As long as the the windows/AD user account (which is running
your app) is given adequate permission to what he needs, the app should run
fine.
If you use SQL Server security (it must be enabled), you must have
user/password pair in the ConnectionString, and SQL Server authenticates it,
regardless whether you have done it in your own "Login" function or not. SO,
your "Login" function does nothing usefull here.
"Dec" <Dec@.discussions.microsoft.com> wrote in message
news:E608FA02-488A-4E9A-BC5B-9AF816F28F87@.microsoft.com...
> Hi,
> I have a Windows Application, a Novell Network and a SQL Server 2000 on an
> Active Directory controlled server. My AD account has access to teh
> database.
> I want to login to the database using an Active Directory account, trusted
> security...but I can't.
> Sequence of Events:
> 1. Login to Network using Novell account.
> 2. Start Application and it displays login screen.
> 3. Enter AD account details and press OK
> 4. This verifies against Active Directory Account using the following
> code:
>
> visual basic
> code:----
> Public Function Login() As String
> ' now create the directory entry to establish connection
> Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
> Me.strPass, Me.atAuthentType)
> Try
> ' if user is verified then it will welcome then
> Try
> Return deDirEntry.Username
> Catch exp As Exception
> Return ""
> End Try
> Finally
> 'deDirEntry.Dispose()
> End Try
> End Function 'Login
> ----
> This all works fine and returns the username if the credentials match
> 5. Make database connection string (sUserName is the AD username):
> visual basic
> code:----Dim
> sConnstring As String = "User ID=" & sUserName & ";Initial
> Catalog=VendorSample;Data
> Source=MyServer...;Timeout=20;Trusted_Connection=True"----
> 6. I get the following error:
> Login failed for user '(null)'. Reason: Not associated witha trusted SQl
> Server connection.
> I'm not well up on how AD works etc. but does anybody have any idea how to
> get past this? I presume the problem is that it is not recognising the
> username passed as the account I want to use.|||Hi,
If I have logged onto pc/ network using a windows account, will the app
always run using this account? If so, is there any way to change this so that
the app run using an AD account instead? As you've probably guesed, I'm not
well up on Windows/ AD accounts etc. so please explain in very simple terms!!
Thanks.
"Norman Yuan" wrote:
> There are two ways to logging into SQL Server: WIndows Security
> (Trusted_Connection) or SQL Server Security. In either case, your "Login"
> function is useless.
> In your connectionString, you have "Trusted_Connection=True", that implies
> the SQL Server uses Windows security, meaning, you do not need pass
> username/password pair in ConnectionString (even there is user/password,
> they are ignored). That means SQL Server accept the current windows/AD user
> account credential, and then does the authorization based on this
> credential. As long as the the windows/AD user account (which is running
> your app) is given adequate permission to what he needs, the app should run
> fine.
> If you use SQL Server security (it must be enabled), you must have
> user/password pair in the ConnectionString, and SQL Server authenticates it,
> regardless whether you have done it in your own "Login" function or not. SO,
> your "Login" function does nothing usefull here.
>
> "Dec" <Dec@.discussions.microsoft.com> wrote in message
> news:E608FA02-488A-4E9A-BC5B-9AF816F28F87@.microsoft.com...
> > Hi,
> > I have a Windows Application, a Novell Network and a SQL Server 2000 on an
> > Active Directory controlled server. My AD account has access to teh
> > database.
> > I want to login to the database using an Active Directory account, trusted
> > security...but I can't.
> > Sequence of Events:
> > 1. Login to Network using Novell account.
> > 2. Start Application and it displays login screen.
> > 3. Enter AD account details and press OK
> > 4. This verifies against Active Directory Account using the following
> > code:
> >
> >
> > visual basic
> > code:----
> > Public Function Login() As String
> > ' now create the directory entry to establish connection
> > Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
> > Me.strPass, Me.atAuthentType)
> > Try
> >
> > ' if user is verified then it will welcome then
> > Try
> > Return deDirEntry.Username
> > Catch exp As Exception
> > Return ""
> > End Try
> > Finally
> > 'deDirEntry.Dispose()
> > End Try
> > End Function 'Login
> > ----
> >
> > This all works fine and returns the username if the credentials match
> > 5. Make database connection string (sUserName is the AD username):
> >
> > visual basic
> > code:----Dim
> > sConnstring As String = "User ID=" & sUserName & ";Initial
> > Catalog=VendorSample;Data
> > Source=MyServer...;Timeout=20;Trusted_Connection=True"----
> > 6. I get the following error:
> > Login failed for user '(null)'. Reason: Not associated witha trusted SQl
> > Server connection.
> >
> > I'm not well up on how AD works etc. but does anybody have any idea how to
> > get past this? I presume the problem is that it is not recognising the
> > username passed as the account I want to use.
>
>

AD/ SQL Server 2000/ Trusted Connection in .Net

Hi,
I have a Windows Application, a Novell Network and a SQL Server 2000 on an
Active Directory controlled server. My AD account has access to teh database
.
I want to login to the database using an Active Directory account, trusted
security...but I can't.
Sequence of Events:
1. Login to Network using Novell account.
2. Start Application and it displays login screen.
3. Enter AD account details and press OK
4. This verifies against Active Directory Account using the following code:
visual basic
code:----
-- Public Function Login() As String
' now create the directory entry to establish connection
Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
Me.strPass, Me.atAuthentType)
Try
' if user is verified then it will welcome then
Try
Return deDirEntry.Username
Catch exp As Exception
Return ""
End Try
Finally
'deDirEntry.Dispose()
End Try
End Function 'Login
----
--
This all works fine and returns the username if the credentials match
5. Make database connection string (sUserName is the AD username):
visual basic
code:----
--Dim
sConnstring As String = "User ID=" & sUserName & ";Initial
Catalog=VendorSample;Data
Source=MyServer...;Timeout=20;Trusted_Connection=True"--
----
6. I get the following error:
Login failed for user '(null)'. Reason: Not associated witha trusted SQl
Server connection.
I'm not well up on how AD works etc. but does anybody have any idea how to
get past this? I presume the problem is that it is not recognising the
username passed as the account I want to use.There are two ways to logging into SQL Server: WIndows Security
(Trusted_Connection) or SQL Server Security. In either case, your "Login"
function is useless.
In your connectionString, you have "Trusted_Connection=True", that implies
the SQL Server uses Windows security, meaning, you do not need pass
username/password pair in ConnectionString (even there is user/password,
they are ignored). That means SQL Server accept the current windows/AD user
account credential, and then does the authorization based on this
credential. As long as the the windows/AD user account (which is running
your app) is given adequate permission to what he needs, the app should run
fine.
If you use SQL Server security (it must be enabled), you must have
user/password pair in the ConnectionString, and SQL Server authenticates it,
regardless whether you have done it in your own "Login" function or not. SO,
your "Login" function does nothing usefull here.
"Dec" <Dec@.discussions.microsoft.com> wrote in message
news:E608FA02-488A-4E9A-BC5B-9AF816F28F87@.microsoft.com...
> Hi,
> I have a Windows Application, a Novell Network and a SQL Server 2000 on an
> Active Directory controlled server. My AD account has access to teh
> database.
> I want to login to the database using an Active Directory account, trusted
> security...but I can't.
> Sequence of Events:
> 1. Login to Network using Novell account.
> 2. Start Application and it displays login screen.
> 3. Enter AD account details and press OK
> 4. This verifies against Active Directory Account using the following
> code:
>
> visual basic
> code:---
--
> Public Function Login() As String
> ' now create the directory entry to establish connection
> Dim deDirEntry As New DirectoryEntry(Me.strDomain, Me.strUser,
> Me.strPass, Me.atAuthentType)
> Try
> ' if user is verified then it will welcome then
> Try
> Return deDirEntry.Username
> Catch exp As Exception
> Return ""
> End Try
> Finally
> 'deDirEntry.Dispose()
> End Try
> End Function 'Login
> ----
--
> This all works fine and returns the username if the credentials match
> 5. Make database connection string (sUserName is the AD username):
> visual basic
> code:---
--Dim
> sConnstring As String = "User ID=" & sUserName & ";Initial
> Catalog=VendorSample;Data
> Source=MyServer...;Timeout=20;Trusted_Connection=True"--
----
> 6. I get the following error:
> Login failed for user '(null)'. Reason: Not associated witha trusted SQl
> Server connection.
> I'm not well up on how AD works etc. but does anybody have any idea how to
> get past this? I presume the problem is that it is not recognising the
> username passed as the account I want to use.|||Hi,
If I have logged onto pc/ network using a windows account, will the app
always run using this account? If so, is there any way to change this so tha
t
the app run using an AD account instead? As you've probably guesed, I'm not
well up on Windows/ AD accounts etc. so please explain in very simple terms!
!
Thanks.
"Norman Yuan" wrote:

> There are two ways to logging into SQL Server: WIndows Security
> (Trusted_Connection) or SQL Server Security. In either case, your "Login"
> function is useless.
> In your connectionString, you have "Trusted_Connection=True", that implies
> the SQL Server uses Windows security, meaning, you do not need pass
> username/password pair in ConnectionString (even there is user/password,
> they are ignored). That means SQL Server accept the current windows/AD use
r
> account credential, and then does the authorization based on this
> credential. As long as the the windows/AD user account (which is running
> your app) is given adequate permission to what he needs, the app should ru
n
> fine.
> If you use SQL Server security (it must be enabled), you must have
> user/password pair in the ConnectionString, and SQL Server authenticates i
t,
> regardless whether you have done it in your own "Login" function or not. S
O,
> your "Login" function does nothing usefull here.
>
> "Dec" <Dec@.discussions.microsoft.com> wrote in message
> news:E608FA02-488A-4E9A-BC5B-9AF816F28F87@.microsoft.com...
>
>