473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 11503
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.