Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-05-2009
Member
 
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?
Reply With Quote
  #2  
Old 08-05-2009
Member
 
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');

?>
Reply With Quote
  #3  
Old 08-05-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem connecting to server via MsSQLConnect"
Thread Thread Starter Forum Replies Last Post
OS X Lion error: Problem connecting to the server JyotiT Operating Systems 8 01-10-2011 10:31 PM
WHC is not connecting to the server Alfanumeric Technology & Internet 3 15-11-2010 09:27 PM
Problem Connecting Server Bhardwaj Networking & Security 4 21-03-2009 10:27 AM
Error: 'you do not have permissions required to access the wsus server' while connecting wsus server via console HudSon Server Update Service 2 15-08-2008 12:18 AM


All times are GMT +5.5. The time now is 03:44 PM.