473,480 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

odbc_connect (PHP + MSSQL) problems

Hi all,

I have tried connect to remote MS SQL server with no success. Anyone
help me?

###this is the code used to try connect

$dsn = "Driver={SQL Server};Server=200.xxx.xxx.xxx;Database=Mydb;";
$user = 'WebService';
$pass = 'triad';

if(odbc_connect($dsn, $user, $pass)){
echo "I got it!.";
}
###This is the error

Warning: odbc_connect() [function.odbc-connect]: SQL error:
[unixODBC][Driver Manager]Data source name not found, and no default
driver specified, SQL state IM002 in SQLConnect in
/home/triadbra/public_html/desenvolvimento/digs/teste2.php on line 8

anyone have any idea to solve this problem? i have a linux server with
PHP and a remote sql server

Jun 21 '06 #1
1 11523
Filipe Tomita <fi***********@gmail.com> wrote:
[unixODBC][Driver Manager]Data source name not found


I suppose you have unixODBC installed and data source name configured
for Microsoft SQL Server? Next step is to tell PHP where it can find
your ODBC configuration file:

putenv('ODBCINI=/path/to/odbc.ini');

Also make sure that your web server has permission to read that file.

--
Jari
Jun 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1965
by: Chung Leong | last post by:
I've been having intermittent connection problems with my M$SQL 2000/Apache2/PHP set up. Every now and then the mssql_pconnect() would fail. M$SQL is running on a separate dedicated server while...
2
2752
by: ao | last post by:
I had PHP installed on as CGI on a Window 2000 Server and connected to an MSSQL 2000 on another server. Both server were upgraded to Windows Server 2003 and problems developed that I could no...
11
4372
by: badz | last post by:
Hi frenz Lately I try to use MSSQL and PHP , the problem arise when PHP try to read MSSQL field with 'image' data type, header("Content-type: image/jpeg"); // act as a jpg file to browser I...
0
1252
by: dan byers | last post by:
Greetings, Curious to see if anyone has had a similar issue. - solaris 2.8, sparc - apache 1.3.31 - php v. 5.0.3 - using easysoft odbc drivers - using unixODBC - apache built with php and...
7
23853
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
2
1675
by: Ranjith | last post by:
We have a console.php which takes in SQL queries and displays them in a result.php webpage. Sometimes the query takes minutes to execute or crashes the PHP application. Is it possible to cancel...
3
7467
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
3
24885
by: Bill | last post by:
Hi, I installed PHP 5.0 on my linux box. In php.ini, i added this: extension=odbc.so But i still get the error:"Call to undefined function odbc_connect()" when trying to run this command:...
1
6431
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7084
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4779
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.