Okay
  Public Ticket #1995578
MS SQL - Separate DB Connection - Error
Closed

Comments

  • UAG-WPEnvato started the conversation

    I selected the MS SQL option under the Separate DB Connection. After entering the relevant DB information, and selecting Apply, I get the following error message: 

    Error

    wpDataTables could not connect to mssql server. mssql said: There was a problem with your SQL connection - could not find driver

    The WordPress site is hosted on GoDaddy. Do I need to work with GoDaddy to update this driver?

    PHP PDO ODBC extension, as well as PHP PDO SQLSRV.

    I've searched for solutions to the error I received, and the closest I've been able to find is here: https://tmsplugins.ticksy.com/ticket/1715679/

    The data I need to access is very minor, a total of 100 records contained in a MS SQL server. 

    Thank you,

  •  2,572
    Aleksandar replied

    Hello UAG-WPEnvato

    Thank you for your purchase.

    Yeah, that seems to be the correct workaround for MSSQL servers:

    Our plugin is using PDO_SQLSRV driver.

    Can you please check do you have installed and enabled PDO extension (pdo_sqlsrv) on your server?

    If your WordPress is hosted on Microsoft SQL Server that have drivers for PHP: SQLSRV extension or PDO_SQLSRV extension you will need to modify file wp-content/plugins/wpdatatables/config/config.inc.php and around line 65 find this line of code:

    $wdtMsSqlDriver = [
    'sqlsrv' => ['active' => false],
    'dblib' => ['active' => true, 'version' => '7.0'],
    'odbc' => ['active' => false, 'driver' => '{ODBC Driver 17 for SQL Server}'],
    ];
    

    and change it to look like this:

    $wdtMsSqlDriver = [
    'sqlsrv' => ['active' => true],
    'dblib' => ['active' => false, 'version' => '7.0'],
    'odbc' => ['active' => false, 'driver' => '{ODBC Driver 17 for SQL Server}'],
    ];
    

    If you have already tried this, then can you verify those drivers are actually active on the server?

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • UAG-WPEnvato replied

    Thank you so much for the quick reply. 

    I was able to enable the pdo_sqlsvr driver and then received a different error which led me to contact the hosting provoder Godaddy. 

    This was the error: 

    wpDataTables could not connect to mssql server. mssql said: There was a problem with your SQL connection - SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver 13 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712

    The WordPress site is hosted on their servers in a Linux environment. After some additional research and calls I understand the WordPress plugin/site wont communicate with MS SQL server unless the site is hosted in Windows, or, we have an option to change our hosting plan to a dedicated server (still on Linux) which opens the option to use ssh to access the linux server as root, and install the odbc driver 13 package. I need to discuss this option w the site owners. Are there other packages we'd need to install besides the odbc driver? Do you agree with the above? 

    Godaddy suggested exporting from MS SQL to CSV and then importing to Mysql, to then pull the data with wpdatatable. Do you recommend this as an alternative ? Or is it a shorter manual process to just upload a new CSV every time there is a data update? 

    New data would be available probably 3-4 times a month, and the volume of new records is low (less than 100 text records). 

    Best and thanks again for the quick reply! 

    Diana 

  •  472
    Isidora replied

    Hello Diana,

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    Alexsandar is out of office today and I will help you.

    Yes that is correct. You will need to install odbc driver 13 package or better ODBC Driver 17 for SQL Server and then you will need to use this driver in our plugin by settings true on odbc drive like this:

    $wdtMsSqlDriver = [
    'sqlsrv' => ['active' => false],
    'dblib' => ['active' => false, 'version' => '7.0'],
    'odbc' => ['active' => true, 'driver' => '{ODBC Driver 17 for SQL Server}'],
    ];
    • Godaddy suggested exporting from MS SQL to CSV and then importing to Mysql, to then pull the data with wpdatatable. Do you recommend this as an alternative ? Or is it a shorter manual process to just upload a new CSV every time there is a data update? 

    Yes you can do that, but one every update of data you will need to export those data in CSV and import in MySQL table.

    What you can check is also updating MySQL table from MS SQL. There is a lot of examples and here is one of them. 

    Also, you can check this link how to Move data from MS SQL to MySQL.

    Please note that for something like this you will need at least a basic knowledge of SQL, MySQL and MS SQL servers.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables