Server-side Processing on MSSQL

Server-side Processing on MSSQL

DanielSCDanielSC Posts: 19Questions: 7Answers: 1

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?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • DanielSCDanielSC Posts: 19Questions: 7Answers: 1

    @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.

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    What libraries are you using for your server-sude processing? Our Editor libraries support MSSQL.

    Allan

  • DanielSCDanielSC Posts: 19Questions: 7Answers: 1

    @allan We are using SQLSRV https://www.php.net/manual/en/book.sqlsrv.php
    PDO connections are working outside of datatable on the server

  • DanielSCDanielSC Posts: 19Questions: 7Answers: 1

    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.

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    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

This discussion has been closed.