Page 1 of 1

coonect ot MSSQL 7.0

Posted: Wed Jul 04, 2007 6:02 am
by cade
I figure out from my coding style using ms_sql_connect fail to connect to server. I supplied the ip of the server. What am I missing?

Asking Smart Questions

Posted: Wed Jul 04, 2007 6:07 am
by feyd
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2.1. When asking a question, be as specific as you can be, provide the relevant code and any other information that is helpful in a concise and coherent manner. If you are not sure how to do that, read these guidelines.

Posted: Wed Jul 04, 2007 8:51 am
by cade

Code: Select all

$myServer = "202.157.***.***";
$myUser = "vmadmin1";
$myPass = "vmsql15062002111";

$s = mssql_connect($myServer, $myUser, $myPass) or die("Unable to connect to server: $myServer");
$myDB = "vmtmx";
$d = mssql_select_db($myDB, $s) or die("Unable to connect to database: $myDB");
I don't know what is wrong with this code. Can somebody help me.

Posted: Wed Jul 04, 2007 9:12 am
by feyd
What leads you to believe it's not working?

Posted: Wed Jul 04, 2007 9:42 pm
by cade
when I try and it show error to connect

Posted: Wed Jul 04, 2007 10:20 pm
by feyd
There error being...?

Posted: Wed Jul 04, 2007 11:15 pm
by cade
I believe the problem is on the server side...However I have checkd the PHP.ini setting. I don't know what makes my codes could not connect to the server

Posted: Wed Jul 04, 2007 11:18 pm
by feyd
What. Is. The. Error? Please make sure to post the full error.

Posted: Wed Jul 04, 2007 11:36 pm
by cade

Code: Select all

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 202.***.***.220 in C:\xampp\htdocs\jobvm2\js_form.php on line 88
is there any idea? Thanks in advance

Posted: Wed Jul 04, 2007 11:50 pm
by feyd
Have you looked at what mssql_get_last_message() returns?

Posted: Sun Jul 15, 2007 8:30 pm
by cade
I already tested the get last message. But it didn't work. The message was: unable to connect to 202.***.**.***. I already set up the MS SQL network utility to 1433. And telnet to it and the reply is success. I also checked my php info and everything was setup accordingly. Do you have any idea waht's cause this?

Posted: Mon Jul 16, 2007 5:22 am
by cade
Ok...it's my mistake for placing the IP and port number like this

202.XX.XXX.X: 1433.

it should be 202.XX.XXX.X, 1433....

More details on: http://amin2u.blogspot.com/2007/07/call ... nnect.html