SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 SQL SERVER EXPRESS 2005 CONNECTION STRING
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sirmilt
Starting Member

USA
49 Posts

Posted - 08/31/2011 :  16:39:04  Show Profile  Reply with Quote
I had SQL Server 2008R@ installed and created a database for a Visual Basic 2008 application, and it worked fine...until I was ready to distribute (deploy) the application, I then learned that the Visual Basic Deployment prerequisites did not recognize SQL Server R2.

After trying some suggested solutions I gave up, I downloaded and installed SQL Server Express 2005 and removed 2008R2 and redid my database. Now, I can't get the connection string to work. I have tried about 1/2 different variations of this:

server=localhos\SQLEXPR5\SQLEXPRESS;database=EntertainmentCollectionData; user id = sa;password=;

None work. Can anyone point me in the right direction?

Milt

tkizer
Almighty SQL Goddess

USA
37142 Posts

Posted - 08/31/2011 :  16:43:38  Show Profile  Visit tkizer's Homepage  Reply with Quote
Try: server=(local)\sqlexpress

Please DON'T use sa for your userid! When IT professionals see this, we know right away that the person who wrote this software isn't experienced enough with SQL Server and has no regard for security.

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

Subscribe to my blog
Go to Top of Page

sirmilt
Starting Member

USA
49 Posts

Posted - 09/01/2011 :  12:21:23  Show Profile  Reply with Quote
Thanks for the responding to my very frustrating problem. Your comment about the user name "sa" is 100% accurate, I am a retired, rank amateur, programmer. I have 2 questions about your response...

1) I assume that you are suggesting that I start the connection string with server=(local)SQLEXPR5\SQLEXPRESS;... rather then
server=localhost\SQLEXPR5\SQLEXPRESS;
2) Have you any suggestions for a User ID and is Windows Authentication satisfactory or should I change to SQL Server Windows Authentication?

Milt

Milt
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37142 Posts

Posted - 09/01/2011 :  13:00:12  Show Profile  Visit tkizer's Homepage  Reply with Quote
1) No. Why are you adding SQLEXPR5 to it? What is your instance actually named?
2) Windows auth is best, but SQL auth is fine.

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

Subscribe to my blog
Go to Top of Page

sirmilt
Starting Member

USA
49 Posts

Posted - 09/01/2011 :  14:05:25  Show Profile  Reply with Quote
Thanks for the quick reply.I assume from my log in "Server Name "SIRMILT\SQLEXPR5" .The computer name is SIRMILT and the server name is SQLEXPR5 the full path is C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data.

Milt
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37142 Posts

Posted - 09/01/2011 :  15:32:18  Show Profile  Visit tkizer's Homepage  Reply with Quote
Have you tried: SIRMILT\SQLEXPR5

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

Subscribe to my blog
Go to Top of Page

sirmilt
Starting Member

USA
49 Posts

Posted - 09/02/2011 :  13:31:54  Show Profile  Reply with Quote
I appreciate all the help that you have been giving me, but nothing seems to work and I have reverted to an Access database, which is where I started and which worked fine before I Decided to up-size and learn SQL Server.

Thanks for trying to help this old beginner.

Milt
Go to Top of Page

sirmilt
Starting Member

USA
49 Posts

Posted - 09/02/2011 :  15:46:32  Show Profile  Reply with Quote
I may have spoken to soon. My program runs past the point where the prior error halted execution
I now get a message "Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection."
The properties for the User 'sa' are under Schemas owned by this User" and "Database Role Membership" "db_Owner" is checked

I've tried to find some documentation of what belongs there or what else should be done, but can't


Milt
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37142 Posts

Posted - 09/02/2011 :  16:06:31  Show Profile  Visit tkizer's Homepage  Reply with Quote
You need to switch your server to mixed-mode authentication. Windows-only mode is the default. In SQL Server Management Studio, after you connect to the instance, you would right click on the server and go to properties, then to the security page.

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

Subscribe to my blog
Go to Top of Page

sirmilt
Starting Member

USA
49 Posts

Posted - 09/03/2011 :  11:21:15  Show Profile  Reply with Quote
Thanks, Tara Kizer for the follow up.

I followed your instructions and the security page had "SQL Server and Windows Authentication mode" checked. Under the section "Login auditing" the "Failed logins only" was checked. Should it be?

Milt

Milt
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 09/03/2011 :  17:53:00  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
Makes no difference, it's a security and auditing feature.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000