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

add sqlsrv support for external database enrolment

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.1
    • 3.3
    • Enrolments
    • None
    • MOODLE_32_STABLE
    • MOODLE_33_STABLE

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              knys Koen Nys
              knys Koen Nys
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/May/17