4 Replies - 439 Views - Last Post: 24 September 2012 - 04:51 AM Rate Topic: -----

#1 ersaan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 31-May 12

Login failed for user '(test)'. Reason: Not associated with a

Posted 24 September 2012 - 02:34 AM

Hello , i have a question maybe someone can help me to solve or to fix my problem ,

i'm trying to connect to remote server , from my desktop pc
i'm using php 5 win xp apache 2.2 AppServ and trying to connect to remote server OS :windows server 2003 & Microsoft SQL SERVER 2000 ...
In my local computer with Microsoft SQL Server 2005 it's ok i can connect .
but in remote to MSSQL 2000 i could not i get the error Login failed for user '(test)' i update the ntwdblib.dll i enabled the the services i enabled the extension:mssql but no way i couldn establish the connection bettwen my pc and server with PHP :S:S:S ...
...
$con = mssql_connect ('sa','test','test') or die ("Wrond");
mssql_select_db('database1', $con);

..
where do u think the problem is .???
thnx in adv.

Is This A Good Question/Topic? 0
  • +

Replies To: Login failed for user '(test)'. Reason: Not associated with a

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3636
  • View blog
  • Posts: 5,759
  • Joined: 08-June 10

Re: Login failed for user '(test)'. Reason: Not associated with a

Posted 24 September 2012 - 03:33 AM

According to the docs, the first parameter for the mssql_connect function is supposed to be a server name. How does "sa" fit that?

Also, I have to ask: Is it really necessary to use a SQL Server version that old? We've got three newer versions already...
Was This Post Helpful? 0
  • +
  • -

#3 ersaan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 31-May 12

Re: Login failed for user '(test)'. Reason: Not associated with a

Posted 24 September 2012 - 03:48 AM

View PostAtli, on 24 September 2012 - 03:33 AM, said:

According to the docs, the first parameter for the mssql_connect function is supposed to be a server name. How does "sa" fit that?

Also, I have to ask: Is it really necessary to use a SQL Server version that old? We've got three newer versions already...


it's was just an example "sa" cuz i'm using ersaan for server name ,it doesn't matter the problem is that i can connect to the localhost local pc with this initicials but i can't connect to the remote Server ... : )
and yes its necessary to use this version of SQL server . . .
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3636
  • View blog
  • Posts: 5,759
  • Joined: 08-June 10

Re: Login failed for user '(test)'. Reason: Not associated with a

Posted 24 September 2012 - 04:26 AM

OK, I see.

The fact that you get a "Login failed" error would indicate that you are, at least, managing to establish a connection to the server. It's just that your user credentials are invalid.

I don't know much about MSSQL 2000, but for the 2005 and 2008 versions you can choose whether or not normal username/password logins are enabled, and they are disabled by default. (The Windows User authentication thing is used by default.) - Is it possible that this is the error?

Can you connect to the server from your PC using other means? Like, using whatever GUI Microsoft provided for those version; the equivalent of MS SQL Management Studio for MSSQL 2005 and 2008.
Was This Post Helpful? 0
  • +
  • -

#5 ersaan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 31-May 12

Re: Login failed for user '(test)'. Reason: Not associated with a

Posted 24 September 2012 - 04:51 AM

View PostAtli, on 24 September 2012 - 04:26 AM, said:

OK, I see.

The fact that you get a "Login failed" error would indicate that you are, at least, managing to establish a connection to the server. It's just that your user credentials are invalid.

I don't know much about MSSQL 2000, but for the 2005 and 2008 versions you can choose whether or not normal username/password logins are enabled, and they are disabled by default. (The Windows User authentication thing is used by default.) - Is it possible that this is the error?

Can you connect to the server from your PC using other means? Like, using whatever GUI Microsoft provided for those version; the equivalent of MS SQL Management Studio for MSSQL 2005 and 2008.


the user credentials are ok ... and i can connect to the server using other means just this with this script i could not connect to the server ....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1