Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cannot connect to sql server 2000, connectonstring

Author  Topic 

rgparkins
Starting Member

4 Posts

Posted - 2008-03-12 : 08:51:43
Hi,

I really am struggling at the moment and someone maybe able to help. I currently have a windows server running sql server 2000. I have a .NET 1.1 site running off this server talking to the database and all is fine.

I am adding another site to the server running .net 2.0 and it will talk to the same database. My issue comes when the new site tries to connect to the database. I get an exception raised when I try to access any page as follows:

Could not locate entry in sysdatabases for database 'm_WMS01'.

Now ordinarily I would say ok, the db doesn;t exist BUT the db does exist and m_WMS01 IS NOT the database I am trying to connect to, in fact its the username I am using in the connection string. The connection string is as follows:

<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=www.xxxx.com;Initial Catalog=WMS-LIVE;User ID=m_WMS01;Password=xxxx"
providerName="System.Data.SqlClient" />
</connectionStrings>

I am stumped and have tried creating new databases with new users and I have the same issue EVERYTIME. COuld it be somthing to do with permissions as this is a .NET 2.0 site running on a different application pool?, my connection string? something else?

Would be great if someone could point me in the right direction so I can get this site running

Many thanks in advance

Richard

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-12 : 09:07:35
The provider name is NOT the .Net class name! It should something similar to "SQLOLEDB" or "SQLNCLI".
Have a look at www.connectionstrings.com for variations of connectionstrings.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

rgparkins
Starting Member

4 Posts

Posted - 2008-03-12 : 09:59:27
quote:
Originally posted by Peso

The provider name is NOT the .Net class name! It should something similar to "SQLOLEDB" or "SQLNCLI".
Have a look at www.connectionstrings.com for variations of connectionstrings.



E 12°55'05.25"
N 56°04'39.16"




Thanks for the feedback, I have tried all versions of the connectionstring at this url to no avail! :( The connection string I quoted was actually generated by Visual Studio so I assume thats correct?

Anyway I did notice that no matter what user I place in the connection string it ALWAYS displays

Could not locate entry in sysdatabases for database 'm_WMS01'.

and m_WMS01 is the owner of all the objects in this database, ie all tables and stored procedures are m_WMS01.Table1 not dbo.Table1 etc..

Am really confused with this :( any extra info you may have would be welcome.

I have a gut feeling its something to do with the objects and who they are owned by but how to prove this I dont know.

Thanks


Richard
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-12 : 10:01:51
Might be the case that the default database mapped to user - m_WMS01 was m_WMS01 but which is now non-existent. Just a thought!

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

rgparkins
Starting Member

4 Posts

Posted - 2008-03-12 : 12:07:48
quote:
Originally posted by harsh_athalye

Might be the case that the default database mapped to user - m_WMS01 was m_WMS01 but which is now non-existent. Just a thought!

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"



Its mad, the same cnnection string used in my .net 1.1 app works but fails in .net 2.0 app, see below

"data source=www.xxx.com;initial catalog=m_WMS_Mirror;User ID=m_WMS01;Password=richard1;persist security info=False;packet size=4096"

Any pointers again (even its make a cup of tea and come back) welcome

Rich :)
Go to Top of Page

rgparkins
Starting Member

4 Posts

Posted - 2008-03-13 : 04:34:52
OK I found the issue and it wasn;t sql at all. I was using a relational mapping generator to generate my database and for some reason the app was prepending the database name to all queries (a hot fix!) To compiund things my username is the same name as my database thus I thought it was trying to open the username!

I fixed the issue with the app generator and all is now well. Thanks for your support
Go to Top of Page
   

- Advertisement -