Windows Authentication Problems

G

Guest

In my Windows application, I am attempting to access an SQL database called
PhotoAlbum.mdf. I keep receiving the following error:

Cannot open database "PhotoAlbum" requested by the login. The login failed.
Login failed for user 'William\Will'.

Here is my connection string:

"data source=.\\SQLEXPRESS;initial catalog=PhotoAlbum;" +
"integrated security=SSPI;persist security info=False;" +
"workstation id=WILLIAM;packet size=4096";

I have also tried:

"Data Source=.\\SQLEXPRESS;" +
"AttachDbFilename=PhotoAlbum.mdf;Integrated Security=True;" +
"User Instance=True";

which also met with problems of a different nature.

I am running SQL 2005 Beta 2 on a Windows XP Pro machine w/SP2.

Any insight would be appreciated.
 
A

Angel J. Hernández M.

Is your server configured for Mixed Authentication? (Windows & SQL) if
so... does the user you want to use access to the database selected? does it
have a default database?

Regards,
 
G

Guest

1) I don't remember what mode I installed. I'm pretty sure I went with
Windows Auth though. When prompted in VS for a database connection, I am
offered both choices.

2) I'm the user, and the admin. It's all located on my workstation.

3) I have the default instance SQLEXPRESS but no attached databases.

New information:

Recently, I changed my account password on my local system from no password,
which is what I had when I installed SQL, to a password with content. The
database was created after the password was in place. I don't know if this
has any bearing on my problem.

Also, I tried attaching the database to my project using Database Explorer
and continue to experience the login error.

My sorry I'm an idiot, but I just recently decided to return to programming
after many years of other IT work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top