Wednesday, March 7, 2012

Error connecting to database

I get the following error:

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 the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

How do I correct it?

check this linkhttp://support.microsoft.com/kb/914277/en-us

hope it was helpful

|||

There was a big long thread on this over here.

http://codingforums.com/archive/index.php/index.php?t-124900.html

Error connecting to ASPNETDB - Cannot open database

Hi everyone, i have already created posts about this problem and im aware theres millions of replys, but i still cant get this to work and its driving me mad. The posts i have seen i dont understand?

Im using the standard ASPNETDB Database, i have never opened up SQL Server Management studio, although i do have the express edition.

i have tried everything and i am totally stumped as to what to do. Heres my web.config.

It works in VWD 2005 Express, but not in WWWROOT or on webserver?

PLEASE PLEASE PLEASE Can someone help me!!!!!!!!!

Dan :)

<?

xmlversion="1.0"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

appSettings/>

<

connectionStrings>

<

addname="northwindsConnectionString1"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.mdf;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="ConnectionString"connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\MyDatabase.mdb;Persist Security Info=True"providerName="System.Data.OleDb" />

</

connectionStrings>

<

system.web>

<

profile>

<

properties>

<

addname="FullName"defaultValue=""/>

</

properties>

</

profile>

<

roleManagerenabled="true" />

<

compilationdebug="false" />

<

authenticationmode="Forms" />

</

system.web>

</

configuration>

Are you sure that your provider supports SQL express and Access type database on web server?

Thanks

|||

Hi jpazgier, thanks for the immediate response.

The website im creating uses access databases fine. The thing that confuses me is that it runs under visual web developers development server, but if i put the app in the WWWROOT folder on my C:/ it doesnt work, same as if i upload it to my webserver. I emailed my hosting company and they provided me with this error (sorry its longwinded.)

Thanks mate,

Dan

----------

Here is the error the page is throwing:

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.]

|||

Maybe it is connected with security settings Web developer works inder your account IIS under ASP.NET

Janusz

|||its really confusing, what i dont understand is if i configure a setting on my local machine, what happens when i upload it to mywebserver?|||

The error you get has been driving people crazy for months.

Any way, When on a server IIS uses a generic account to access the file system. On your compurer IIS uses Your account.

In the connection string you have user instance =true so it is a problem with the the generic account not having a profile on the server.

If it is your server you can create an admin account and tell the application to use it instead of the gerneric one. It is a two part process, 1 create the accout on the server, 2 set the identity in the web.confg

Idealy you should attach the database to the sql server and access it that way. I had some problems with the profile provider doing it that way though.

I know this isn't a detailed solution but maybe you'll at least understand the problem better.

|||

Hi mate, thanks for replying, i dont have the option to create an admin account i dont think as its not my server.

I will try the other stuff that you have said, one other question i have is, that im using the ASPNETDB for the logins, but i have my own seperate database for holding information to do with the site im building. Now im only aloud to have one sql server database file on the server, so i need to join them together to make one database. Is this what you mean by attaching?

Thanks loads for your help

Dan

Sunday, February 26, 2012

Error connecting to a SQL 2005 (June CTP) Cube using Excel 2003

When I use the PivotTable Wizard in Excel 2003 to connect to a SQL 2005 cube
,
the wizard successfully finds and connects to the cube, but when I click
'finish' to retrieve the data, I get the following error:
"Initialization of the data source failed.
Check the database server or contact your database administrator. Make sure
the external database is available, and then try the operation again. If you
see this message again, create a new data source to connect to the database.
"
Any ideas what could be causing this? I have Excel 2003 and SQL 2005 (June
CTP) running on the same machine.
Thanks,
--
DuncanHi Duncan
I have the same error.
I have Excel 2000 and Excel 2003 installed on my pc and SQL server 2000 and
SQL Server 2005 installed on a server. It seems that I can use most
combinations of these 2 - Excel 2000 will read data from SQL server 2000 and
2005, Excel 2003 will read data from SQL Server 2000 cubes.
But I get the same error as you when I try to read data from SQL Server 2005
Analysis Services Cubes from Excel 2003. It knows the cubes are there but
can't read the data.
Did you manage to resolve this? Can anyone else help?
Regards
Dave
"Duncan" wrote:

> When I use the PivotTable Wizard in Excel 2003 to connect to a SQL 2005 cu
be,
> the wizard successfully finds and connects to the cube, but when I click
> 'finish' to retrieve the data, I get the following error:
> "Initialization of the data source failed.
> Check the database server or contact your database administrator. Make sur
e
> the external database is available, and then try the operation again. If y
ou
> see this message again, create a new data source to connect to the databas
e. "
> Any ideas what could be causing this? I have Excel 2003 and SQL 2005 (June
> CTP) running on the same machine.
> Thanks,
> --
> Duncan|||If you found a solution, please let me know. I'm getting the same error
message.
Thanks a lot.
Duncan wrote:
> *When I use the PivotTable Wizard in Excel 2003 to connect to a SQL
> 2005 cube,
> the wizard successfully finds and connects to the cube, but when I
> click
> 'finish' to retrieve the data, I get the following error:
> "Initialization of the data source failed.
> Check the database server or contact your database administrator.
> Make sure
> the external database is available, and then try the operation again.
> If you
> see this message again, create a new data source to connect to the
> database. "
> Any ideas what could be causing this? I have Excel 2003 and SQL 2005
> (June
> CTP) running on the same machine.
> Thanks,
> --
> Duncan *
hpanneflek
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message1781676.html|||hpanneflek wrote:
> *If you found a solution, please let me know. I'm getting the same
> error message.
> Thanks a lot. *
I got around this by re-registering the OLAP v9.0 dll:
regsvr32 c:\program files\common files\system\oledb\msolap90.dll
This worked for me.
Good luck
Dave
Daffyd
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message1781676.html|||Thank you! It worked.
I've been using AS 2K for 3 years now and I love it. I started playing
with AS2K5 and I am realizing that a lot of things changed. My email is
hpanneflek@.univision.net in case you have any question, I'll be glad to
help.
Thanks again.
Daffyd wrote:
> *I got around this by re-registering the OLAP v9.0 dll:
> regsvr32 c:\program files\common files\system\oledb\msolap90.dll
> This worked for me.
> Good luck
> Dave *
hpanneflek
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message1781676.html

Error connecting to a SQL 2005 (June CTP) Cube using Excel 2003

When I use the PivotTable Wizard in Excel 2003 to connect to a SQL 2005 cube,
the wizard successfully finds and connects to the cube, but when I click
'finish' to retrieve the data, I get the following error:
"Initialization of the data source failed.
Check the database server or contact your database administrator. Make sure
the external database is available, and then try the operation again. If you
see this message again, create a new data source to connect to the database. "
Any ideas what could be causing this? I have Excel 2003 and SQL 2005 (June
CTP) running on the same machine.
Thanks,
Duncan
Hi Duncan !
Have you got to resolve this problem ?
Unfortunately I also have it in my environment.
If possible tell me what you did.
Thank you !
Aduir.

Quote:

Originally posted by Duncan
When I use the PivotTable Wizard in Excel 2003 to connect to a SQL 2005 cube,
the wizard successfully finds and connects to the cube, but when I click
'finish' to retrieve the data, I get the following error:
"Initialization of the data source failed.
Check the database server or contact your database administrator. Make sure
the external database is available, and then try the operation again. If you
see this message again, create a new data source to connect to the database. "
Any ideas what could be causing this? I have Excel 2003 and SQL 2005 (June
CTP) running on the same machine.
Thanks,
Duncan

|||Hi both - I have exactly the same problem. Did you ever find a solution to this?
Yours in hope,

Quote:

Originally posted by Duncan
When I use the PivotTable Wizard in Excel 2003 to connect to a SQL 2005 cube,
the wizard successfully finds and connects to the cube, but when I click
'finish' to retrieve the data, I get the following error:
"Initialization of the data source failed.
Check the database server or contact your database administrator. Make sure
the external database is available, and then try the operation again. If you
see this message again, create a new data source to connect to the database. "
Any ideas what could be causing this? I have Excel 2003 and SQL 2005 (June
CTP) running on the same machine.
Thanks,
Duncan

|||Hi Duncan
I have the same error.
I have Excel 2000 and Excel 2003 installed on my pc and SQL server 2000 and
SQL Server 2005 installed on a server. It seems that I can use most
combinations of these 2 - Excel 2000 will read data from SQL server 2000 and
2005, Excel 2003 will read data from SQL Server 2000 cubes.
But I get the same error as you when I try to read data from SQL Server 2005
Analysis Services Cubes from Excel 2003. It knows the cubes are there but
can't read the data.
Did you manage to resolve this? Can anyone else help?
Regards
Dave
"Duncan" wrote:

> When I use the PivotTable Wizard in Excel 2003 to connect to a SQL 2005 cube,
> the wizard successfully finds and connects to the cube, but when I click
> 'finish' to retrieve the data, I get the following error:
> "Initialization of the data source failed.
> Check the database server or contact your database administrator. Make sure
> the external database is available, and then try the operation again. If you
> see this message again, create a new data source to connect to the database. "
> Any ideas what could be causing this? I have Excel 2003 and SQL 2005 (June
> CTP) running on the same machine.
> Thanks,
> --
> Duncan

Error connecting to .sdf database

Dear All,

I am trying to connect to a .sdf database. I am building a console application. First I got an error "Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)". Then I manage to solve "Unable to load DLL 'sqlceme30.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)". So wat is the possible error on my side ?

Is it not amazing. I have been searching the forums for a solution to this specific problem for weeks now and everyone that answers has no idea what it is we are requesting. you get redirected to a thousand other sites that still can not answer this question. I dont think anyone knows how to solve this!

|||

Which version of the product are you using?

Checking the basics first: Is the product installed on your machine ( check in Add and remove programs).Also check that the System.Data.SqlServerCe.dll is in GAC (C:\windows\assembly).

If your installation was correct, then sqlceme30.dll (and other dlls) should be loaded automatically using some registry settings.

Btw, did you try reinstalling the runtime package on your machine?

Error connecting to .sdf database

Dear All,

I am trying to connect to a .sdf database. I am building a console application. First I got an error "Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)". Then I manage to solve "Unable to load DLL 'sqlceme30.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)". So wat is the possible error on my side ?

Is it not amazing. I have been searching the forums for a solution to this specific problem for weeks now and everyone that answers has no idea what it is we are requesting. you get redirected to a thousand other sites that still can not answer this question. I dont think anyone knows how to solve this!

|||

Which version of the product are you using?

Checking the basics first: Is the product installed on your machine ( check in Add and remove programs).Also check that the System.Data.SqlServerCe.dll is in GAC (C:\windows\assembly).

If your installation was correct, then sqlceme30.dll (and other dlls) should be loaded automatically using some registry settings.

Btw, did you try reinstalling the runtime package on your machine?

Error connecting through the web

Hi all, I'm new to SQL so here goes, we got a dbase we're putting up for the
web, and basically we're testing it out for connectivity, I set the system
dsn with the account that's in SQL server (got the server in mixed mode
auth), when I try to login to a page we put together I get this error
"Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user 'mitch'.
/ConnOpen.inc, line 10"
the username mitch exists in SQL server, the tests runs fine through
ODBC>system dsn. I looked all over the forums and can't find my issue or
anything similar, if anyone's seen this before, any pointers or ideas would
be great. ThanksA just plain "Login failed" error message indicates a bad
user name/password. If there is more with the message,
sometimes that can't help track it down. Turn on failed
login audits in SQL Server to make sure you are getting the
entire message. To turn it on, open Enterprise Manager,
right click on the server and select properties. Go to the
security tab and under Audit Level select Failed. Restart
SQL Server. The failed logins will then be logged to the SQL
Server logs.
If you are getting a full error message of login failed for
xyz. Not associated with a trusted SQL Server connection,
then it means you are trying to use a SQL login but your
server is only configured for Windows authentication. If you
need to use SQL logins, change the Authentication to SQL
Server and Windows. It's on the security tab of the
properties for SQL Server.
If you are trying to connect with Windows authentication,
then in the connection string, don't supply a user name and
password. Use Integrated Security=SSPI with an OLE DB
provider in your connection string instead of supplying a
username and password.
You may want to change drivers that you are using. The OLE
DB provider for ODBC is considered obsolete.
You can find more on connection strings at:
http://www.carlprothman.net/Default.aspx?tabid=81
-Sue
On Mon, 31 Oct 2005 14:55:06 -0800, "carlomd"
<carlomd@.discussions.microsoft.com> wrote:

>Hi all, I'm new to SQL so here goes, we got a dbase we're putting up for th
e
>web, and basically we're testing it out for connectivity, I set the system
>dsn with the account that's in SQL server (got the server in mixed mode
>auth), when I try to login to a page we put together I get this error
>"Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
>[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user 'mitch'.
>/ConnOpen.inc, line 10"
>the username mitch exists in SQL server, the tests runs fine through
>ODBC>system dsn. I looked all over the forums and can't find my issue or
>anything similar, if anyone's seen this before, any pointers or ideas would
>be great. Thanks|||Thanks for the reply, it works now, I changed the username settings in a
config file that resides in inetpub and it worked, thanks again.
"Sue Hoegemeier" wrote:

> A just plain "Login failed" error message indicates a bad
> user name/password. If there is more with the message,
> sometimes that can't help track it down. Turn on failed
> login audits in SQL Server to make sure you are getting the
> entire message. To turn it on, open Enterprise Manager,
> right click on the server and select properties. Go to the
> security tab and under Audit Level select Failed. Restart
> SQL Server. The failed logins will then be logged to the SQL
> Server logs.
> If you are getting a full error message of login failed for
> xyz. Not associated with a trusted SQL Server connection,
> then it means you are trying to use a SQL login but your
> server is only configured for Windows authentication. If you
> need to use SQL logins, change the Authentication to SQL
> Server and Windows. It's on the security tab of the
> properties for SQL Server.
> If you are trying to connect with Windows authentication,
> then in the connection string, don't supply a user name and
> password. Use Integrated Security=SSPI with an OLE DB
> provider in your connection string instead of supplying a
> username and password.
> You may want to change drivers that you are using. The OLE
> DB provider for ODBC is considered obsolete.
> You can find more on connection strings at:
> http://www.carlprothman.net/Default.aspx?tabid=81
> -Sue
> On Mon, 31 Oct 2005 14:55:06 -0800, "carlomd"
> <carlomd@.discussions.microsoft.com> wrote:
>
>