473,409 Members | 1,943 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,409 software developers and data experts.

Can't connect to SQL Server via ODBC

I just installed PHP 5.1.4 with SQL Server 2005 on my laptop. PHP is
running fine and so is SQL Server 2005. When I try to connect to SQL
Server from my my PHP code I get this error.

Warning: odbc_connect() [function.odbc-connect]: SQL error:
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified, SQL state IM002 in SQLConnect in
C:\Inetpub\wwwroot\index.php on line 5

Here's my connection string that is causing the error

$connect_id = odbc_connect("Driver={SQL
Server};Server=mydbname;Database=myDB","myUser", "myPass");
Any idea what's wrong? This is driving me nutts.. I installed PHP on my
computer at home and had no problem connecting to SQL Server. It's like
this laptop is cursed.

Jul 11 '06 #1
1 13287
~john wrote:
I just installed PHP 5.1.4 with SQL Server 2005 on my laptop. PHP is
running fine and so is SQL Server 2005. When I try to connect to SQL
Server from my my PHP code I get this error.

Warning: odbc_connect() [function.odbc-connect]: SQL error:
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified, SQL state IM002 in SQLConnect in
C:\Inetpub\wwwroot\index.php on line 5

Here's my connection string that is causing the error

$connect_id = odbc_connect("Driver={SQL
Server};Server=mydbname;Database=myDB","myUser", "myPass");
Any idea what's wrong? This is driving me nutts.. I installed PHP on my
computer at home and had no problem connecting to SQL Server. It's like
this laptop is cursed.
Do you have the ODBC database registered with the correct driver?

I don't use odbc much - but most of the time I've found when it works on
one machine but not another there's a problem with how the database
and/or driver is registered (if it is at all).

It could also be a difference driver in levels; never worked with the
SQL Server driver.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 11 '06 #2

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

Similar topics

1
by: webhead74 | last post by:
Hi, I've worked on this for a couple of days & can't figure out what I'm doing wrong. I'm trying to connect to a remote AS400 database using odbc & php. Here's my environment: Server: RedHat...
1
by: Rick Hickerson | last post by:
I can't get PHP to connect to DB2 on the same server. I'm running both Apache/PHP and DB2 on Mandrake Linux 9.2. I didn't compile PHP; just installed what appear to be the appropriate RPMs (I...
5
by: Kona | last post by:
Hello, Is it right to tell that DB2 Connect has the same function that Oracle Net ? If I have an ODBC application is it also right to tell that I have 2 possibilities on my client workstation to...
3
by: Dave F. | last post by:
I am using ODBC to connect to dBase data on a remote server. The ASP.NET app will be running on Win 2k or 2003 server. I have tried to make it work but all I can get is an error. ...
1
by: Alex Hardin | last post by:
Hey, I'm trying to use the connect to database wizard to connect to a MySQL database on my web server, 66.235.193.45 (I'm actually not sure if that points specifically to my part of the server, if...
1
by: Thijs | last post by:
Hi, i'm new to db2, so the answer on this question is maybe verry simple (or not)... i've installed db2 on a server, and now, I want to make a connection with odbc from a client (windows...
2
by: 111mike | last post by:
Hello, Here's my problem. I cannot connect to mysql database using odbc string connections or dns. I keep getting a "cannot connect to mysql server localhost." I'm running windows XP Pro and...
6
by: xx75vulcan | last post by:
Hi, I have two seperate production machines that I'm trying to get to play nicely together. This setup has worked for years before - until recently bother machines were reformatted, and...
3
by: evonczoernig | last post by:
I Can not connect to Oracle 10g XE from ASP perscript web page on IIS 6 running on server 2003. I have set up the database and the ODBC connections. The ODBC connection is workinh and I can connect...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.