Open Access file on linux

0

By connection, how do I change my DSN?

one of the cases in my connection class that opens file in access

case "fatura" :
            $strHost = "";
            $strUser = "";
            $strPass = "";
            $strBase = "";
            $strType = "";
         $strDSN  = "odbc:DRIVER={Microsoft Access Driver (*.mdb)};charset=iso-8859-1; DBQ={$strArquivo}; Uid=; Pwd=;";
        //$strDSN  = "odbc:DRIVER=Driver{Easysoft ODBC-ACCESS};charset=iso-8859-1; DBQ={$strArquivo}; Uid=; Pwd=;";
            break;

I tried to change the DSN to receive the Easysoft ODBC-ACCESS driver because what I researched in linux does not open odbc files, but in the first moment without success, what could it be ?? or what is missing

The message that displays is:

"RepositorioException: Nao foi possivel conectar ao banco de dados: SQLSTATE[01000] SQLDriverConnect: 0 [unixODBC][Driver Manager]Can't open lib 'Microsoft Access Driver (*.mdb)' : file not found","location":""}
    
asked by anonymous 29.08.2018 / 15:50

1 answer

2

I think the message makes it clear that it is "file not found":

  

SQLSTATE [01000] SQLDriverConnect: 0 [unixODBC] [Driver Manager] Can not open lib 'Microsoft Access Driver (* .mdb): file not found

It is probably a case-sensitive issue on Linux and Unix-based systems (such as Mac OSX), if you put something like this:

 $strArquivo = 'Arquivo.mdb';

And in the folder it is like arquivo.mdb , it will not work. In Windows it is case-INsensitive, ie in Windows arquivo.mdb is equal to Arquivo.mdb (not something connected to PHP is a question of operating system).

Read this: PHP on linux or windows

Another problem may simply be that it is pointing to an invalid path.

    
29.08.2018 / 19:21