Re: connecting to a mssql database



Kim André Akerø wrote:
Advo wrote:


Im having major problems trying to connect to a mssql database thats
hosted on our server.

I've got the ip, username, password and database name, yet no matter
what i try, I cant seem to connect. I've trawled the net for hours
looking for code, has anyone got any that definately works, or just a
simple way I can check the connection.


I don't know how you've tried it, but you should be doing something
like this in your code:

mysql_connect($ip, $username, $password);
mysql_select_db($database);

You should also be doing this on the server, and not directly from
home. Security settings on the database server will only allow
connections from a certain IP (or IP range).


Except he's using MS SQL Server, not MySQL. But the statements are the same - just substitute 'mssql' for 'mysql'.

It's hard to say without knowing what error messages you get. Did you check the user notes for mssql_connect at http://www.php.net/manual/en/function.mssql-connect.php? They contain some good information.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Complicated Connection Problems bewteen ADP and SQL Server
    ... This database ... expertise for getting the user workstations talking to the SQL Server. ... connection would fail and the adp wouldn't be able to talk to the server. ... might be in my ADO connection string. ...
    (microsoft.public.access.adp.sqlserver)
  • Complicated Connection Problem between ADP and SQL Server
    ... This database ... expertise for getting the user workstations talking to the SQL Server. ... connection would fail and the adp wouldn't be able to talk to the server. ... might be in my ADO connection string. ...
    (microsoft.public.sqlserver.connect)
  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)