You are here

function qformat_coursetestmanager::connect_win in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/coursetestmanager/format.php \qformat_coursetestmanager::connect_win()
2 calls to qformat_coursetestmanager::connect_win()
qformat_coursetestmanager::getquestioncategories in includes/moodle/question/format/coursetestmanager/format.php
qformat_coursetestmanager::getquestions in includes/moodle/question/format/coursetestmanager/format.php

File

includes/moodle/question/format/coursetestmanager/format.php, line 406

Class

qformat_coursetestmanager

Code

function connect_win($filename) {
  global $CFG, $systemdb;

  // first, verify the location of System.mda
  if (!isset($systemdb)) {
    $systemdb = $this
      ->findfile("System.mda");
  }
  if (!$systemdb) {
    $this
      ->err("The system database System.mda cannot be found.  Check that you've uploaded it to the course.", $dsn);
    die;
  }
  $ldb =& ADONewConnection('access');
  $dsn = "DRIVER=Microsoft Access Driver (*.mdb);SystemDB=" . $systemdb . ";DBQ=" . $filename . ";UID=Assess;PWD=VBMango;";
  $dbconnected = $ldb
    ->Connect($dsn);
  if (!$dbconnected) {
    $this
      ->err("Moodle could not connect to the database.", $dsn);
    die;
  }
  return $ldb;
}