Server-side Processing on MSSQL
Server-side Processing on MSSQL
DanielSC
Posts: 19Questions: 7Answers: 1
in DataTables
Hello!
I have enabled serverside processing on my MySQL database, using Datatables. But I would like to also add support for MSSQL databases. When I try to connect to my database, using known correct information I get the following error:
DataTables warning: table id=memListTable - An error occurred while connecting to the database. The error reported by the server was: SQLSTATE[HY000] [2002] Connection timed out
Is there a way to enable MSSQL support for this?
This discussion has been closed.
Answers
We use MySQL for testing, so it's definitely supported. Are you able to connect from the same computer to the database, with the same connection details?
Colin
@colin I have MySQL working already. My question relates to MSSQL. I can connect to the MSSQL database using the exact same connection details, outside of Datatables.
What libraries are you using for your server-sude processing? Our Editor libraries support MSSQL.
Allan
@allan We are using SQLSRV https://www.php.net/manual/en/book.sqlsrv.php
PDO connections are working outside of datatable on the server
I have changed the connection string to this, as per one of your earlier replies to another thread @allan, and some progress has been made.
error_reporting(E_ALL);
ini_set('display_errors', '1');
$pdo = new PDO( "sqlsrv:Server=XXX;Database=XXX", 'XXX', 'XXX' );
$dbDetails = array(
"pdo" => $pdo
);
Now I'm getting the following error:
{"error":"An error occurred while connecting to the database. The error reported by the server was: SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)"}
It appears that it is not accepting the information given correctly.
Are you using the Editor PHP libraries here for the server-side processing, or something else?
Are you using
$pdo = new PDO( "sqlsrv:Server=XXX;Database=XXX", 'XXX', 'XXX' );
somewhere else in your code and it is working?!Allan