View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
06217Bug reportsOtherpublic2012-06-22 09:45
Reporteruser20391Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionwon't fix 
Product Version1.92RC2 
Summary06217: LimeSurvey Installation fails when database doesn’t exist
Description

The following error is given on the installation page when no LimeSurevey database has been created:
"Can't connect to LimeSurvey database. Reason: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requested in login 'limesurvey'. Login fails."

The problem exists within part of the installation process where it tries to check if the database exits before trying to create one.
https://github.com/LimeSurvey/LimeSurvey/blob/master/common.php#L174

Normal the logic works correctly for non MS SQL database types, where it tries to connect to the database with the database name. If that fails it tries again without specify the database name to confirm a connection can at least be established.

However for ODBC MS SQL connections the database name is specified in the JDBC URL:
https://github.com/LimeSurvey/LimeSurvey/blob/master/common.php#L169

The logic within the ADOdb class is slightly different when it runs the connect command. Currently the connect command without the database name parameter is the same as the connect command with it.

Because there is no change between the two connect commands the second command will fail just like the first command. This bug has since been reported to ADOdb here:
http://phplens.com/lens/lensforum/msgs.php?id=19150

With the fix now released in the latest version:
http://sourceforge.net/projects/adodb/files/adodb-php5-only/adodb-517-for-php5/
“Added support for $database parameter in odbc Connect() function. E.g. $DB->Connect( $dsn_without_db, $user, $pwd, $database). Previously $database had to be left blank and the $dsn was used to pass in this parameter.”

I suggest Limesurevey update the ADOdb class to the latest version then change one line in the common.php file:
https://github.com/LimeSurvey/LimeSurvey/blob/master/common.php#L169

By removing the Database Name from the JDBC URL:
case "odbc_mssql": $dbhost="Driver={SQL Server};Server=$databaselocation;

The ODBC MS SQL then behaves correctly like the other database types.

Steps To Reproduce

Fresh install without first creating the LimeSurvey database in a MS SQL 2000 Database.

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)120613
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2012-06-22 09:45

administrator   ~19453

I am sorry but we will not update the adodb in an stable version. 2.0 will not use adodb anymore.

Issue History

Date Modified Username Field Change
2012-06-14 15:56 user20391 New Issue
2012-06-14 17:08 user20391 Issue Monitored: user20391
2012-06-21 13:28 c_schmitz Project @2@ => Bug reports
2012-06-21 13:28 c_schmitz Category Installation => Other issues
2012-06-22 09:45 c_schmitz Note Added: 19453
2012-06-22 09:45 c_schmitz Status new => closed
2012-06-22 09:45 c_schmitz Assigned To => c_schmitz
2012-06-22 09:45 c_schmitz Resolution open => won't fix