Hi
I use visual basic 2005 express and wants to connect to a sql server 2005 express database . Im a newbie and has created a small database called test on my computer and now i just want to see if i can connect to it. My connection string is:
con.ConnectionString = "server=ACER\Sqlexpress;database=test;trusted_connection=true"
And when i run the app. and it get to the con.open() command the programs gives me this error
Cannot open database "test" requested by the login. The login failed.
Login failed for user 'ACER\Dan'
Acer is the name of my computer and my user name is Dan. Im the administrator of the computer and there is no password requered to log on.
Can anybody see where it is wrong?
You are admin on your PC, but your user id does not exist in a SQL Server and it does not know anything about it. This is why it fails. Integrated security for SQL Server does not mean that SQL Server automatically accepts all the users from the PC. It means that authintication is integrated with the Windows. To resolve this issue, you need to add your user id 'ACER\Dan' to the list of the users for your SQL Server database and then grant some permissions. Lext links show how to to do this
http://support.microsoft.com/kb/325003/en-us#XSLTH4213121122120121120120
http://support.microsoft.com/kb/240872/en-us
|||Hi,
make sure that the database test exists on the instances SQLExpress. As the administrator you should be allowed to access the server and its databases, though you are in the role of the system administrators. (if this is the local system you are working on)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
No comments:
Post a Comment