Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57689

add sqlsrv support for external database enrolment


    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3
    • 3.2.1
    • Enrolments
    • None

      We have an azure database that we want to use as a source of our enrolments.

      The sqlsrv driver by microsoft is now available for both linux and windows so it's no longer only windows servers that can connect with azure or sql server through this driver.

      I noticed the external database enrolment plugin uses adodb in the background, adodb already has support for pdo_sqlsrv so it's mostly a matter of changing the settings form to allow you to select this driver.

      I've tested it out myself with moodle 3.2.1 by hardcoding some changes in enrol/database/lib.php

      change line 870 to: $extdb = ADONewConnection('PDO');
      change line 878 to: $result = $extdb->Connect('sqlsrv:server=SERVERNAME;database=DATABASENAME', $this->config->user, $this->config->pass);

      Everything seemed to work without problems with this hardcoded version. I suppose the biggest issue is the fact that the connection string through PDO looks very different from the currently supported database types. Which makes it more work to add this then simply expanding the options list with one extra option.

            knys Koen Nys
            knys Koen Nys
            0 Vote for this issue
            3 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.