Results 1 to 3 of 3

Thread: Problem connecting to server via MsSQLConnect

  1. #1
    Join Date
    Apr 2009
    Posts
    90

    Problem connecting to server via MsSQLConnect

    Hello,

    So here is my problem:

    I tried to connect to a database SQL Server 7.0 via windows authentication and it works.
    But when I see all the tables, it prompt me with "dtproperties".
    I noticed that by using SQL Server Management Studio Express, if I does not run the program administrator (I'm in vista), I could not see the other tables from "dtproperties.
    Have you an idea through php if there is a way to see all the tables in the database?

    Code:
      $ server = "127.0.0.1 \ S QLEXPRESS", / / port 49178 
    	  $ username = "foo"; 
    	  $ password = "t0t0"; 
    	  $ SqlConnection = mssql_connect ($ server, $ username, $ password); 
    	  if (false === $ SQLConnect) 
    	  ( 
    	       echo "Could not connect. \ n"; 
    	  ) 
    	  else 
    	  ( 
    		  echo "Connection to server successful <br>"; 
    		  mssql_close ($ SQLConnect); 
    	  )
    However when I run my code, I get the following error:

    Code:
     Warning: mssql_connect () [function. Mssql-connect]: Unable to connect to server: 127.0 .0 .1 \ sqlexpress
    Do you have any leads?

  2. #2
    Join Date
    Oct 2008
    Posts
    167

    Re: Problem connecting to server via MsSQLConnect

    you may use the following code to solve your problem this may happen that you have to do some changes according to your requirements.

    Code:
    im using a MSSQL connection instead...
    
    <?php
    
    // Connection
    $svr = 'localhost';
    $user = 'username';
    $pass = 'password';
    
    // Establish Connection
    mssql_connect($svr,$user,$pass)
        or die ('Cannot Connect to MSSQL Server');
    mssql_select_db('database');
    
    ?>

  3. #3
    Join Date
    Dec 2008
    Posts
    161

    Re: Problem connecting to server via MsSQLConnect

    with PHP MS SQL library function if you need to connect the database connection with the then you just need to add just two lines to the PHP.ini file:

    Code:
    [PHP_MSSQL]
    extension=php_mssql.dll
    
    If you had of called
    
    $db = mssql_connect(”dbhost”,”username”,”PaSsWoRd”);
    If all other things are properly connected then there won't be any problem connecting to the server.

Similar Threads

  1. OS X Lion error: Problem connecting to the server
    By JyotiT in forum Operating Systems
    Replies: 8
    Last Post: 01-10-2011, 10:31 PM
  2. WHC is not connecting to the server
    By Alfanumeric in forum Technology & Internet
    Replies: 3
    Last Post: 15-11-2010, 09:27 PM
  3. Problem Connecting Server
    By Bhardwaj in forum Networking & Security
    Replies: 4
    Last Post: 21-03-2009, 10:27 AM
  4. Replies: 2
    Last Post: 15-08-2008, 12:18 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,821,808.98565 seconds with 16 queries