php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20086 SQLDriverConnect supported by win32
Submitted: 2002-10-25 09:45 UTC Modified: 2002-10-31 11:22 UTC
From: john at johnandlouise dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4CVS-2002-10-25 OS: W2K
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: john at johnandlouise dot com
New email:
PHP Version: OS:

 

 [2002-10-25 09:45 UTC] john at johnandlouise dot com
In ext/odbc/php_odbc.php dsn-less connections are only supported for empress and unixodbc. Windows also supports this connection method.

Changing the line:
#if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC)

to:
#if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC) || defined(WIN32)

enables dsn-less connections under windows.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-27 19:46 UTC] kalowsky@php.net
Unified diffs are your and my friends.  Can you please provide one!
 [2002-10-28 11:38 UTC] john at johnandlouise dot com
diff is now my new friend. Is this right? :-)

2110c2110
< #if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC)
---
> #if defined(HAVE_EMPRESS) || defined(HAVE_UNIXODBC) || defined(PHP_WIN32)
2133c2133
< 			rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, strlen(ldb), dsnbuf, 300,
---
> 			rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, (short)strlen(ldb), dsnbuf, 300,

The (short) typecast is to prevent a warning in win32 - don't know if it will have issues with other platforms. Now using PHP_WIN32 not WIN32 for consistency with other code.
 [2002-10-30 20:57 UTC] kalowsky@php.net
PHP is now your DSN-less friend.  Please test a snapshot and make sure this is working properly for you.
 [2002-10-31 11:22 UTC] john at johnandlouise dot com
Snapshot tested OK - thanks

John
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC