external database enrolment using sqlsrv driver?

external database enrolment using sqlsrv driver?

Ron Mitchell發表於
Number of replies: 5

Hi
I'm working on a project where we've been testing external database enrolment by using exports from mssql imported into mysql. Now that this is working we thought it would be a simple task to change settings to a direct connection to the mssql database but it seems that assumption was very wrong! 傷心

We are using Windows + Apache + PHP 5.3.3 and after initial tests thought it would be a simple task of enabling the new sqlsrv extension. However it seems the database enrolment code hasn't been updated to work with the sqlsrv extensions yet is that correct? Has anyone found a work around? e.g. this isn't for using MSSQL for the whole moodle installation it's just for using MSSQL for external database enrolment and it seems there is no adodb-sqlsrv.inc.php?

Hoping someone can help.

Thanks

Ron

評比平均分數: -
In reply to Ron Mitchell

Re: external database enrolment using sqlsrv driver?

Maxime Taisne發表於

Hi Ron,

I have the same problem.

Our Moodle is running on a Windows Server 2008 + SQL Server 2008 + IIS 7 + PHP 5.3.6 and the site works perfectly. But I can't use the database enrolment because I can't seem to find any way to connect to the external database containing enrolment information.

I'll post the solution here if I manage to find one

Cheers!
Maxime

In reply to Ron Mitchell

Re: external database enrolment using sqlsrv driver?

Phil McCullough發表於

Hi Guys

I have the same problem, but have a fix that works for me.
The adodb name for "sqlsrv" seems to be "mssqlnative", this wont be in your database driver dropdown in the enrolment external database setup but its easy to add.

Go into your moodle install folder then \enrol\database and edit the settings.php theres an $options variable that lists all the drivers just add "mssqlnative" to the list save and go back into the plugin setup and select it, everything else should work as before.

i.e.

$options = array('', "access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mysql", "mysqli", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp", "mssqlnative");

Hope it works for you.

Phil

In reply to Phil McCullough

Re: external database enrolment using sqlsrv driver?

Ben Graham發表於

Hi Phil,

You seem to be very knowledgeable about the sqlsrv driver. Would you happen to know what sqlsrv_configure: error code = -14 might be?

I also get sqlsrv_configure: message = An invalid parameter was passed to sqlsrv_configure

Thank you very much

In reply to Ron Mitchell

Re: external database enrolment using sqlsrv driver?

Eric Seneca發表於

I used FreeTDS to accomplish the connection for MSSQL in PHP. http://www.freetds.org/ We have been running a direct MSSQL to MYSQL interface for course population for the past 6 months.

In reply to Eric Seneca

Re: external database enrolment using sqlsrv driver?

Ben Graham發表於

Thanks Eric,

I tried FreeTDS originally, but it was causing major performance issues with my Windows 2003 server and PHP 5. As soon as I upgraded to MS SQL Driver for PHP, Moodle became lightning fast and all the log errors disappeared...

The external database plugin doesn't have the mssql server driver as a drop down option, so I added mssqlnative to the /enrol/database/settings.php array definition to make it work as described above.