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 2005 Forums
 Express Edition and Compact Edition (2005)
 SQL SERVER EXPRESS 2005 CONNECTION STRING

Author  Topic 

sirmilt
Starting Member

49 Posts

Posted - 2011-08-31 : 16:39:04
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

38200 Posts

Posted - 2011-08-31 : 16:43:38
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

49 Posts

Posted - 2011-09-01 : 12:21:23
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

38200 Posts

Posted - 2011-09-01 : 13:00:12
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

49 Posts

Posted - 2011-09-01 : 14:05:25
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

38200 Posts

Posted - 2011-09-01 : 15:32:18
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

49 Posts

Posted - 2011-09-02 : 13:31:54
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

49 Posts

Posted - 2011-09-02 : 15:46:32
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

38200 Posts

Posted - 2011-09-02 : 16:06:31
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

49 Posts

Posted - 2011-09-03 : 11:21:15
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
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-09-03 : 17:53:00
Makes no difference, it's a security and auditing feature.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -