Upgrading to Editor 1.8.0

Upgrading to Editor 1.8.0

James12345James12345 Posts: 14Questions: 5Answers: 0

I am trying to upgrade from 1.7.4 to 1.8.0 using the PHP version. I am using IIS 10 and MS SQL server. I am removing my current Editor php folder and copying in the new folder copying the files and the newly structured folders as per the instructions. Once completed i am updating the config.php as normal. As far as I understand as per other versions that should be it, however I am receiving a popup message:

"{"error":"An error occurred while connecting to the database 'DB'. The error reported by the server was: SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. "}"

and a message in the PHP error log

"PHP Fatal error: Uncaught Exception: Unknown database driver type. Must be one of Mysql, Oracle, Postgres, Sqlite, Sqlserver, Db2, Firebird in D :\wwwroot\Web\php\Database.php:56
Stack trace:

__construct(Array)">__construct(Array)" href="#0-D-:\wwwroot\Web\php\Bootstrap.php(53):-DataTables\Database->__construct(Array)">0 D :\wwwroot\Web\php\Bootstrap.php(53): DataTables\Database->__construct(Array)

1 D :\wwwroot\Web\php\DataTables.php(33): require('D :\wwwroot\web...')

2 D :\wwwroot\Web\inc\Report_edit.php(13): include('D :\wwwroot\web...')

3 {main}

thrown in D :\wwwroot\Web\php\Database.php on line 56"

In the config.php file i am specifying "type" => "Sqlserver" ( i have tried different case)

I have also tried creating an instance from Generator but that appears to generate both 1.7.4 and 1.8.0 at the same time. Any assistance would be very much appreciated.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Odd about Generator - I'll look into that, thanks!

    Regarding the issue you are seeing - in the Bootstrap.php file, add print_r( $sql_details ); and then have a look at the response to the Ajax request in your browser's network inspector. DataTables will give you a JSON warning, but that's okay, just ignore that for debugging.

    What does the array print as please (obfuscate your connection string if its a production one!)?

    Allan

  • James12345James12345 Posts: 14Questions: 5Answers: 0

    Allan, please see response below. I also tried it with 1.7.4 and it returned the same array values.

    Array
    (
    [type] => Sqlserver
    [user] =>
    [pass] =>
    [host] => hostname
    [port] => 1433
    [db] => DBname
    [dsn] =>
    [pdoAttr] => Array
    (
    )

    )
    {"error":"An error occurred while connecting to the database 'DBname'. The error reported by the server was: SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87]. "}

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi James,

    Thanks - I'm sorry I don't have an immediate answer for you here! In the Database/Driver/SqlserverQuery.php file, on line 59 It builds the connection string.

    Could you, just before that (e.g. a new line just after line 57) use:

    echo "sqlsrv:Server={$host}{$port};Database={$db}".self::dsnPostfix( $dsn )
    

    and let me know the result please?

    Thanks,
    Allan

  • James12345James12345 Posts: 14Questions: 5Answers: 0

    Thanks Allan,
    After making the change as above, it let me see the connection and I noticed that 1.8.0 was using a full colon to separate the server name and port number. I changed it to a comma as per 1.7.4 and it is now working.

    To confirm I changed: SqlserverQuery.php line 50
    from
    $port = ":{$port}";
    to
    $port = ",{$port}";

    Many Thanks

    James

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Gah - thank you! Fix committed for 1.8.1 which won't be too far away to tidy up a few things like this.

    Regards,
    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Fix is committed here.

    Allan

This discussion has been closed.