?
Solved

dsnless connection

Posted on 2006-04-27
8
Medium Priority
?
302 Views
Last Modified: 2008-01-09
hi
i have this dsn less mssql server connection on a webserver in my intranet:
//===========SERVER CONNECTION===========

$server="localhost,1433";
$username="sa";
$password="";
$database="Northwind";

//===========SERVER CONNECTION===========

but now i want to connect to another mssql server on another machine on my intranet. i tried to use instead of the server localhost the computername or the sql server name of the other machine but nothing! it keep giving me errors.

some help please!!!!!!
0
Comment
Question by:eaweb
  • 4
  • 3
8 Comments
 
LVL 15

Expert Comment

by:deepaknet
ID: 16552846
What error are you getting?
0
 

Author Comment

by:eaweb
ID: 16553104
these are the errors i get:

Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection. (severity 14) in D:\www\webroot\evmel\php\mssql.php on line 14

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: saldis21,1433 in D:\www\webroot\evmel\php\mssql.php on line 14

Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in D:\www\webroot\evmel\php\mssql.php on line 15

Warning: mssql_query() [function.mssql-query]: message: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. (severity 14) in D:\www\webroot\evmel\php\mssql.php on line 29

Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in D:\www\webroot\evmel\php\mssql.php on line 29

Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in D:\www\webroot\evmel\php\mssql.php on line 29

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in D:\www\webroot\evmel\php\mssql.php on line 30


if i use the sql sever name on the webserver self , it's no problem but if i use the name of the sql server on the other network machine, BAM ERRORS!!!!!!!!

example: with this no problem either. WORKS FINE!!
salbko92 is the computer name and name of the sql server on the webserver
$server="salbko92,1433";
$username="sa";
$password="";
$database="Northwind";
0
 
LVL 3

Expert Comment

by:mpemberton5
ID: 16553181
From my recollection, there are three different types of authentications available on MSSQL.  Windows auth, MSSQL auth, and a combination of both.  My guess is that this other server may be set to Windows only and you'll need to provide windows auth credentials to connect to it.

You can set the other server to use both auth methods, but it'll require a restart.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:eaweb
ID: 16554209
i cannot set it to mix mode in the security. i click on the option and then ok, but when i review the properties again it is set bek to windows only
0
 
LVL 3

Expert Comment

by:mpemberton5
ID: 16554389
Seems like there is another step to take.  Although I have never done this personally, it does seem that this is the practiced method to change over the authentication.  I don't know why the registry has to be edited, but it's MS....

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q285097
0
 

Author Comment

by:eaweb
ID: 16556123
ok thanks i will look at the web page.

now this problem

<input name="buttonSearch" type="submit"  id="buttonSearch" value="Search">

if($buttonSearch == "Search"){
$sqlquery="SELECT companyName FROM Customers WHERE companyName = 'Island Trading';";

//===========SQL QUERY===========


//===========QUERY RESULTS===========

$results= mssql_query($sqlquery);
while ($row=mssql_fetch_array($results)){
echo $row['companyName']."<br>\n";}

}

what is the problem here because i'am still getting an error on submit.
Error
Notice: Undefined variable: buttonSearch in D:\www\webroot\evmel\projects\listcontrol\search.php on line 101


where do i have to declare the variable
0
 

Author Comment

by:eaweb
ID: 16556148
i want the query in php be executed when clicking on submit
0
 
LVL 3

Accepted Solution

by:
mpemberton5 earned 500 total points
ID: 16556607
First off, this is a totally separate question, which should be posted under the PHP forum as a separate question.  That said, I'll give you a link that might help you understand how PHP does feedbacks (which appears to be your problem).

http://www.w3schools.com/php/php_forms.asp

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question