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
 Can't Connect to sql 2005 Express

Author  Topic 

rsumo
Starting Member

4 Posts

Posted - 2009-04-17 : 15:53:20

I am writing an asp application. Below is my connection string to the remote MS SQL 2005 Express database in my ASP application:

Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;Integrated Security=SSPI;User Id=LBC200df;Password=Lead#200kjm;"

When I try to connect to the database in my form and insert data, I received the following error message "Invalid connection string". Please help.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-04-18 : 00:02:11
Check this out:
http://www.connectionstrings.com/
Go to Top of Page

rsumo
Starting Member

4 Posts

Posted - 2009-04-18 : 08:48:32
Thank you for the link. I have already been on the site and used the connection string, but I still have the same problem.
Thanks
Go to Top of Page

Stumbler
Starting Member

23 Posts

Posted - 2009-04-19 : 08:32:12
Did you test the ODBC datasource?

Hans, Belgium
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2009-04-19 : 09:00:44
Don't use both Integrated Security and the user/name password combo. If you are using windows authentication, use this:
Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;Integrated Security=SSPI;"
If you are using SQL authentication, then use this:
Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;User Id=LBC200df;Password=Lead#200kjm;"

Go to Top of Page

rsumo
Starting Member

4 Posts

Posted - 2009-04-20 : 07:07:55
quote:
Originally posted by sunitabeck

Don't use both Integrated Security and the user/name password combo. If you are using windows authentication, use this:
Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;Integrated Security=SSPI;"
If you are using SQL authentication, then use this:
Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;User Id=LBC200df;Password=Lead#200kjm;"



Go to Top of Page

rsumo
Starting Member

4 Posts

Posted - 2009-04-20 : 07:11:08

I have tried both connection strings but I continue to receive the same error message:"invalid connection string"
Is there a difference in connection string when connecting to MS SQL Standard, Enterprise, and express?
Thank you

quote:
Originally posted by sunitabeck

Don't use both Integrated Security and the user/name password combo. If you are using windows authentication, use this:
Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;Integrated Security=SSPI;"
If you are using SQL authentication, then use this:
Conn.Open "Provider=SQLOLEDB;DSN=mssql;Initial Catalog=LBC200s;User Id=LBC200df;Password=Lead#200kjm;"



Go to Top of Page
   

- Advertisement -