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 2008 Forums
 Other SQL Server 2008 Topics
 Cant connect to sql server 2008 from 2008 server

Author  Topic 

Crotalus
Starting Member

16 Posts

Posted - 2011-09-13 : 12:33:14
I have sql server 2008 running on a windows 2008 server. I have a vb.net program on a windows xp computer that writes data to the sql server. I just bought a new windows 2008 R2 server. I want the program that currently runs on the windows xp computer to run on the new windows 2008 server. I should just be able to install the program and run it. But it doesn't work. I get an error that says "invalid connection string". I am using an ADODB connection. My connection string looks like this.

"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=XXXX;Data Source=XXXX;Connection Timeout=0"

The problem must be with the new server. But what is it? The connection string is good on any other computer. I have spent two days searching for a solution but it looks like I am the only one on the web with this issue.

Crotalus
Starting Member

16 Posts

Posted - 2011-09-13 : 12:35:22
the error is actually "invalid connection string attribute"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-09-13 : 12:43:10
"Integrated Security=SSPI"

Is Windows Authentication going to work between your new APP location and the SQL box?

If you have SQL Logins set up on the SQL Box, in addition to Windows Authentication, try a connect string with a SQL Login to see if that gets through. If it does then it will be the Windows Authentication that you need to fix.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-09-13 : 12:44:29
www.connectionstrings.com

may be some help if you are needing to explore the various options / parameters available
Go to Top of Page

Crotalus
Starting Member

16 Posts

Posted - 2011-09-13 : 14:36:44
Thanks Kristen

I added sql server authentication and created a new user/password.
Then I changed my connection string to this:

"Provider=SQLOLEDB.1;Initial Catalog=AHAS;Data Source=mysource;User Id=TEST;Password=test#1;Connection Timeout=0"

This worked perfectly on my windows xp machine. But, I still get the same error on the server.

Also, when I look at the log files on SQL, I can see the Test user log in from the XP machine, but not from the server. Since I don't even see the log in attempt, I think my connection attempt never gets past the server.

There must be some magic check box buried deep in the server that will allow me to do this.
Go to Top of Page

Crotalus
Starting Member

16 Posts

Posted - 2011-09-13 : 15:05:03
I think I got it, for anyone else that ever has this problem.

I had to open ODBC Data Source Administrator on the new server and set up a User DSN to my sql server. I had already done this but it didn't work before because the name needs to be the same as the name of the sql server. Or, I guess I could use a different name and then use that name in the program. Either way, it works now.

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-09-13 : 15:13:58
Suprised you have to set up a DSN when using OLE-DB - but its certainly one route to getting connected :)
Go to Top of Page

Crotalus
Starting Member

16 Posts

Posted - 2011-09-13 : 15:24:39
I take it back. It doesn't work. It worked once, but only once. Now it doesn't work anymore and back to the same error as before.
Go to Top of Page
   

- Advertisement -