Okay
  Public Ticket #3748641
Assistance on Connecting MSSQL from Azure i have server link, user name and pwd. Assist me on the step by step process pls
Closed

Comments

  • Dhiraj started the conversation

    I aim to create a Website for our customers where based on their login and affiliated company, I want the dashboard to filter the data to show table rows relevant to them, and the charts also need to reflect using this data from MS SQL (azure cloud DB i have server link, username, pwd and can connect to the DB through ssms.

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

    please guide me on how i can setup a driver (on my WP website?) to setup connection with this DB

  •  1,846
    Miloš replied

    Hello,

    We will advise you on all the relevant details, when it comes to troubleshooting of MS SQL External DB connection.

    In this case, looking from your error - that means that your WP Hosting server does not have the right driver installed, which is needed to make that remote DB connection.

    Here are more details.

     

    First, please check if you have the following drivers installed on your WordPress Hosting server, and activated :

    3838527468.png

    These drivers need to be installed and activated on the server where your WordPress website is. 

    After you install and activate those drivers, it should work fine.

    If you're not sure how to install the drivers, please reach out to your hosting provider.

    The server to which wpDataTables is connecting has its own method of establishing the connection, and we're using PHPs logic of connecting to separate connections. 

    -

    Then, when you have these installed, you need to contact the support of your remote server and ask them for instructions and details what is needed to be input in order to connect,

    such as connection name, host, port, user, password, etc;

    In the end, try to Test the DB Connection in our Plugin, and see if you get any errors.

    -

    If there are errors your server returns, those are returned by the server, 

    and only displayed by wpDataTables -

     there is no additional log within wpDataTables that would distinctively show you what's behind the error.

    I hope this helps.

    I searched a bit more online for general MSSQL Drivers to try and determine what should be installed on your WP Hosting Server, and i found this Post from Stack Overflow, where a User posted a Screenshot of all the Drivers he had to enable.

    He specifically highlighted these two, the "sqlsrv" and "pdo_sqlsrv".

    1187422456.png

    Can you please check again with your WordPress Hosting Provider, do they have those two Drivers installed and activated?

    -

    I additionally searched online and I found another User who is using MSSQL had the same error as you did;

    SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746

    please check this Post, they say they found  way to fix it.

    -

     

    And finally, there is one more step you can do, it can be useful.  Here is what one User did to bypass an SSL issue he had for MSSQL and our Plugin :

    "I was able to solve the connection issue and bypass the SSL by modifying the connection string to SQL Server in .../wpdatatables/source/class.connection.php.(for the SQL Server driver) and adding no encryption and trusting server certificates (TrustServerCertificate = true; Encrypt = false).

    .......

    switch ($vendor) {
                case (self::$MSSQL):
                    if (isset($driver) && $driver == 'sqlsrv') {
                        return new PDOSql($vendor, "$driver:Server=$host,$port;Database=$database; TrustServerCertificate=True; Encrypt=false", $user, $password);
                    }

    .............. "

    I hope that helps.

     

     

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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