0

do anyone knows how to connect to a MS SQL server(database in internet,i have ip,db username and db password).i used mssql_connect from my PHP ,but how to activate it in windows or Ubutu.i download all dll files needed but i cant connect..pls help me....

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by tlore22
0

How do you mean in Windows? It will be better understood if you will expantiaite on "activate it in windows or Ubutu". Do you want to connect to your database from your windows operating system such that you will be able to export/import data?
If yes, let the forum know.
Thank you.

0

Have you checked that you have the latest ntwdblib.dll( this has solved my connection problem)? You should paste this dll over your dll's from apache and php(I think it can be found in two places). Restart apache
then use mssql_connect like this:

$myServer = "xx.xx.xx.xx";
$myUser = "sa";
$myPass = "yyyyyyyyyyyyy";
$myDB = "zzzzzzzzzzz";

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
  or die("Couldn't open database $myDB");

If it still does not work you should try to connect to the database through MS SQL Management Studio.
If it does not connect talk to the owner of the database

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.