#1
  1. Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2006
    Location
    Web Desert
    Posts
    92
    Rep Power
    15

    Smile Cannot connect to SQLEXPRESS Error:18456


    Hai there..please help

    I am trying to use SQL db first time so i have downloaded MS SQL EXPRESS 2005 and when i am trying to connect using object explorer with SQL Server Authentication mode it shows an error message like:

    Code:
    Cannot connect to CPQ..../SQLEXPRESS
    
    Login failed for user 'R4u' (Microsoft SQL server error, Error:18456)
    But i can connect to server using windows authentication mode..

    regards...
  2. #2
  3. Contributing User
    ASP Hero (2000 - 2499 posts)

    Join Date
    Nov 2003
    Location
    UK
    Posts
    2,280
    Rep Power
    311

    Cannot connect to SQLEXPRESS Error:18456


    you haven't set-up the correct permissions for the sql auth user to connect to the DB.
    Hope this advise helps.

    If so please show your appreciation by adding reputation points (click gauge image on top right of this post and score).
  4. #3
  5. Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2006
    Location
    Web Desert
    Posts
    92
    Rep Power
    15

    Cannot connect to SQLEXPRESS Error:18456


    Originally Posted by markoc
    you haven't set-up the correct permissions for the sql auth user to connect to the DB.
    hai markoc thank you for the replay...

    Bit confused...i have to setup those permissions during the installation of SQL server ?..how...?


    regards
  6. #4
  7. Contributing User
    ASP Hero (2000 - 2499 posts)

    Join Date
    Nov 2003
    Location
    UK
    Posts
    2,280
    Rep Power
    311

    Cannot connect to SQLEXPRESS Error:18456


    have you tried to connect to via SQL server managment studio using the sql login?

    when ur in SQL SMS try creating another user with a query something like the following and then try with VS:

    Code:
    USE YOUR_DATABASE_NAME
    GO 
    
    EXEC sp_addlogin 'NEW_USERNAME', 'USERS_PASSWORD', 'YOUR_DATABASE_NAME' 
    GO 
    EXEC sp_grantdbaccess 'NEW_USERNAME', 'NEW_USERNAME' 
    GO 
    EXEC sp_addrolemember 'db_datareader', 'NEW_USERNAME' 
    GO 
    EXEC sp_addrolemember 'db_datawriter', 'NEW_USERNAME' 
    GO 
    EXEC sp_addrolemember 'db_owner', 'NEW_USERNAME' 
    GO

    Comments on this post

    • micky agrees

Similar Threads

  1. Connecting a psp to my laptop - to connect to the net (simple)
    By eviljoker7075 in forum ASP Free Lounge
    Replies: 5
    Last Post: January 19th, 2007, 05:46 AM
  2. Connect String Help
    By dalezjc in forum ASP Development
    Replies: 1
    Last Post: June 8th, 2006, 05:16 PM
  3. Unable to connect Ms Access 2003 using ASP.net
    By harishreddy in forum .NET Development
    Replies: 2
    Last Post: May 12th, 2006, 02:54 AM
  4. Replies: 2
    Last Post: July 19th, 2004, 03:40 PM
  5. help me to connect Excel file and word document with asp.net
    By nimesh910 in forum .NET Development
    Replies: 0
    Last Post: May 26th, 2004, 02:40 AM

IMN logo majestic logo threadwatch logo seochat tools logo