Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC - Data source name not found and no default driver specified

Status
Not open for further replies.

Bifa

Programmer
Jun 25, 2001
15
BR
I am trying to connect to an Access database and I am receiving the msg above. At this time, you may be thinking "That's easy. This moron did not create a System DSN...". I wish that was the reason! :)

Well, I have a System DSN called "sisco" on my W2K web server. In my php program, I have the following code:

...
$cnx = odbc_connect('sisco','Admin','cmonbaby');
//query string
$SQL_Exec_String = "select * from AnyTable";
//query execution
$cur= odbc_exec( $cnx, $SQL_Exec_String );
...

But this simple script always gives me the same result. I have tried to access other databases via ODBC, including MSSQL, receiving the same message in all tests.

Any ideas?

Txs

Bif@
"Try to make the best even better"
 
I'm assuming that your DNSs work correctly through other apps on your W2K box.

I don't have much experience with PHP on Win32, but I have one idea. In the standard php.ini configuration file, there is a which reads, "extension=php_odbc.dll". Is that line commented out on your machine? ______________________________________________________________________
TANSTAAFL!
 
Txs Sleipnir!

Yes, the DSN is working fine for other apps. Regarding the line you mentioned, I am using PHP version 4. I read somewhere that odbc support is built-in on this version.
Anyway, I took a look at PHP.INI for precaution and could not find that line under the "Dynamic Extensions" section. Also, that dll is not listed in my "Extensions" folder.

Bif@
"Try to make the best even better"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top