php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20873 DSN with space will not work
Submitted: 2002-12-07 01:58 UTC Modified: 2002-12-18 13:50 UTC
From: mykbaker at msn dot com Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 4.2.3 OS: Win XP Pro
Private report: No CVE-ID: None
 [2002-12-07 01:58 UTC] mykbaker at msn dot com
Using odbc_connect with a DSN with a space causes error:

Code:

$cnx = odbc_connect("BSU Directory","","") or die(odbc_error());

Error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data., SQL state S1000 in SQLConnect in c:\inetpub\wwwroot\mbaker\Project\processInst.php on line 20
S1000

The same DSN works fine with a ColdFusion template and other DSNs work fine with PHP.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-07 02:01 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Given the error message you've recieved I'd say the problem is not PHP, but rather something else, possible solutions are described in the SQL error message.
 [2002-12-07 02:27 UTC] mykbaker at msn dot com
I would agree with you, accept the DSN can be accessed with a ColdFusion script I have. Also, I am doing the odbc_connect stuff right because when I access DSNs without spaces my code works fine.
 [2002-12-18 13:50 UTC] kalowsky@php.net
Try escaping your DSN.  There really shouldn't be a space in your dsn at all though if you were to follow specs.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 19:01:29 2024 UTC