How to change Open EMR database connectivity from MySQL to MSSQL

sivaprakashqat wrote on Tuesday, January 28, 2014:

Hi,

I am new to PHP and i need to change the database connectivity from MySQL to MSSQL. I have seen that database connectivity is mentioned in sqlconf.php in the (openemr\sites\default) directory. Please help me to do that.

I am eagerly waiting for your reply.

Thanks,
Sivaprakash C

yehster wrote on Tuesday, January 28, 2014:

OpenEMR depends on a number of features which are specific to MySQL Server, so there is certainly not plug and play compatibility.

At a minimum, you would start by changing the driver class in library/sql.inc to subclass from a mssql driver instead of mysql, however you would also have to identify all the queries throughout which use non-standard SQL (including in the database creating scripts that specify “ENGINE” type which is a MySQL only feature.)

There would need to be a very good reason for using mssql instead of MySQL to justify the effort.

sivaprakashqat wrote on Tuesday, January 28, 2014:

Kevin,

First of all thank you for your reply.

I changed the driver reference to require_once(dirname(FILE) . “/adodb/drivers/adodb-mssql.inc.php”); instead of require_once(dirname(FILE) . “/adodb/drivers/adodb-mysql.inc.php”);

I changed the drivers in three more files in (openemr\library\adodb\drivers).

Still not able to see the login page. When i browse the url from browser blank page is displaying.

yehster wrote on Tuesday, January 28, 2014:

It is a futile task in my opinion to try and switch to MSSQL. This is my last statement on the topic.

sivaprakashqat wrote on Tuesday, January 28, 2014:

Yes Kevin, It’s very difficult to find the exact location to change the code. Since i am new to PHP, basically i’m a C#.NET developer. Here in PHP i’m mot able to debug the code like by line as like .NET.