Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2003
    Posts
    30

    Unanswered: Microsoft SQL 2000 Login Problem

    Hi,

    I'm trying to slove this problem from last few hours. I cannot slove this problem. Getting following error message if i try to login in Microsoft SQL Server 2000. Programming in Visual Studio NET -> MFC...


    Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

    Code:
     
    
    	CDBVariant value;
    	CDatabase db;
    	char sql_statement [2048] = "";
    
    	//CDatabase object "db" created to connect database
    	db.OpenEx(_T("DSN=MQIS"),CDatabase::noOdbcDialog);
    .
    .
    .
    .
    can someone please help me out, is something wrong with the code ??

  2. #2
    Join Date
    Nov 2003
    Location
    FRANCE
    Posts
    393
    does your DSN include a username and a password ?

  3. #3
    Join Date
    Sep 2003
    Posts
    30
    well,

    i didn't created one. I had a computer crash... and i had to reinstall everything. but know my sourcecode isnt working anymore. even with username dbo it isn't working


    weird. must be wrong with the sql server 2000

  4. #4
    Join Date
    Nov 2003
    Location
    FRANCE
    Posts
    393
    "db.OpenEx(_T("DSN=MQIS"),CDatabase::noOdbcDialog) "


    you have to create a new DSN named MQSI
    with a integrated user and a password
    or specify them after after the DSN

    "db.OpenEx(_T("DSN=MQIS;UID=sa;PWD=password"). ..

  5. #5
    Join Date
    Sep 2003
    Posts
    30
    how can i create a new dsn name ??

    when installed last time before this time the sql server 2000 i used the beauty and could login with it as a dsn name. like "DSN=beauty" the name of my server is now "motherindia" but i cant login now anymore. i didnt did anything different then before.

  6. #6
    Join Date
    Nov 2003
    Location
    FRANCE
    Posts
    393
    In your

    > Config Pannel
    > Administration Tools
    > ODBC Data Sources


    Add a new System Data Source
    named "MQIS"

  7. #7
    Join Date
    Sep 2003
    Posts
    30
    i dont have these options in Microsofts sql server

  8. #8
    Join Date
    Nov 2003
    Location
    FRANCE
    Posts
    393
    This is not done in SQL Server
    but on your Computer ...

  9. #9
    Join Date
    Sep 2003
    Posts
    30
    lol

    thx.. i had to choose the same name

    works pefect

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •