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
 General SQL Server Forums
 New to SQL Server Programming
 SQL2000-SQL2005 connection string

Author  Topic 

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 15:32:05
Hi all,
I'm new to SQL and I am trying to move from SQL 2000 to SQL 2005 on another server. When I change my connection string from the old IP to the new one(with SQL 2005) my web app crashes. Here is the command string I need to change:

<add key="ConnStr" value="data source=myoldIP;initial catalog=gt-test;uid=myuserid;pwd=mypassword;" />

I have copied the old database exactly the way it was to the new one. I need to change myoldIP to my new one but when I do it crashes... Any ideas?
Thanks in advance for your help
-Will

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 15:36:14
Could you explain what you mean by "crashes"? What error are you getting?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 15:53:30
well thats one of my problems... the web app comes up with an error that says:

An error has occurred


--------------------------------------------------------------------------------

Error Message:
Error could not be displayed

Error Source:
Source could not be displayed

...
So I'm kinda lost... there is no difference between the two databases except one is SQL2005... I know I'm not giving much info I was hoping it was something simple that was wrong with the connection string...
thanks
-WIll

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 15:59:36
On the new server, did you install it as a default instance or a named one? Have you tried providing the port number in the connection string?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 16:08:15
I'm pretty sure it is as a default instance b/c I never had to name it... It is on the default port (80.) But I tried putting the port number in anyway but it didn't help...
-Will
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 16:12:29
80 is not the default port for SQL Server, 1433 is. Could you check SQL Server Configuration Manager for what port it is using (in TCP/IP, IPAll section? Also in there, check what name was used. If it says MSSQLSERVER, then it's the default instance.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 16:27:45
Your right it is 1433 I went in and checked it and IP1 was disabled so I enabled it then restarted the services but it still didn't work even when I put in port 1433... also it is named MSSQLSERVER... Still no luck
-Will
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 16:34:25
Why did you enable IP1?

What do the two fields underneath IPAll say in IP Addresses tab? What does Enabled say in General section of Protocols tab?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 16:41:28
I was just shooting in the dark sorry... The 2 fields in IPAll say:
TCP Dynamic ports: (blank)
TCP Port: 1433
Enabled says "yes"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 16:42:54
Try data source=HostNameOfSqlServer,1433 in your connection string. To get the value of HostNameOfSqlServer, run hostname from a cmd window from the database server and not from a client machine.

Using 1433 as the port is a very bad idea when a web application is connecting to it. It is recommended that you use a custom port that is 5 digits.


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 16:50:48
I just tried that... no luck, just fyi I don't know if this helps any but the web app and the webconfig file I am editing are on the same server as the database so you would think it would be easier to connect to than one on a separate server.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 17:02:16
Is the SQL Server service started?

Could you try the connection in ODBC Data Sources, so we know what the exception error is?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 17:15:44
All the SQL services are started except SQL Server Browser, and SQL Server VVS Writer... I connected in ODBC Data Sources and it worked fine "test completed successfully???
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 17:25:53
I'd say the problem is not with your connection string then.

How did you copy the database?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 17:30:25
We just copied the .mdf and .ldf files from one server to the other... then right clicked on databases and clicked attach. Then added the .mdf .ldf files.
-Will
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 17:32:45
Did you unorphan the accounts afterwards? Did you transfer the logins?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 17:34:51
...um...no??? Is that a problem?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 17:42:11
Yes. Here is what I sometimes use to transfer my logins: http://www.sqlmag.com/Articles/ArticleID/16090/16090.html

Run it on the source server, copy the code, run it on the destination server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-04 : 18:02:48
I'm a little confused I was messing around with that code and I'm not sure exactly what to do...
Thanks so much for sticking with me
-Will
Go to Top of Page

wcarle
Starting Member

32 Posts

Posted - 2008-06-05 : 11:30:02
I tried using the Data Transformation Services (DTS) but no luck...any other ideas?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-05 : 12:49:39
I don't understand what problem you are having with the link that I posted.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page
    Next Page

- Advertisement -