Read MDB in Linux lazarus / 16-Databases ---------------------------------------------------------------------- SymbolicFrank · 2023-03-15 12:41 Is there an up-to-date description on how to read an .MDB database in Linux (Ubuntu 22)? I found and installed odbc-mdbtools and unixodbc. According to odbcinst I have the following driver installed: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ cat /etc/odbcinst.ini[MDBTools]Description=MDBTools DriverDriver=libmdbodbc.soSetup=libmdbodbc.soFileUsage=1UsageCount=1 But I don't understand how to configure a TODBCConnection with that. ---------------------------------------------------------------------- Zvoni · 2023-03-15 14:37 Aircode Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i MyODBCConnection.Driver:='MDBTools Driver';//Set Transaction etc.MyODBCConnection.Open; ---------------------------------------------------------------------- SymbolicFrank · 2023-03-15 15:14 Quote from: Zvoni on March 15, 2023, 03:37:37 pmAircode Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i MyODBCConnection.Driver:='MDBTools Driver';//Set Transaction etc.MyODBCConnection.Open;  I tried that (filled in the properties in the Object inspector): Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Could not connect with connection string "DSN=/var/lib/postgresql/data/Bucket/DB.MDB;DRIVER=MDBTools Driver;". ODBC error details: LastReturnCode: SQL_ERROR; Record 1: SqlState: IM012; NativeError: 0; Message: [unixODBC][Driver Manager]DRIVER keyword syntax error;  But the syntax of those connection strings isn't very strict, it sems. ---------------------------------------------------------------------- Zvoni · 2023-03-15 16:45 The DSN points to Postgres?????? What about constructing your own connection-string, and not use something built in the background from those properties? There is something wrong. I‘d expect curly brackets around the driver name in the connection string ---------------------------------------------------------------------- SymbolicFrank · 2023-03-15 16:54 That location is just a shared volume. Yes, it does look strange, but it is what FPC makes of it. I'll experiment. ---------------------------------------------------------------------- Zvoni · 2023-03-16 08:03 According to this: https://www.connectionstrings.com/access/ (scroll down to last third of the page) the Connection String should look like something Driver={MDBTools Driver};Dbq=/var/lib/postgresql/data/Bucket/DB.MDB; ---------------------------------------------------------------------- SymbolicFrank · 2023-03-16 10:50 I figured it out. This is my TSpecialConnector: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TSpecialConnector = class(TSQLConnector)  protected    procedure DoInternalConnect; override;  end; function CreateSQLConnection(ThisDatabaseLocation: string = '';  ThisType: DatabaseType = dtSQLite; ThisUser: string = ''; ThisPass: string = ''):  TSpecialConnector; implementation procedure TSpecialConnector.DoInternalConnect;begin  if ConnectorType = 'SQLite3' then TSQLite3Connection(Proxy).OpenFlags :=    [sofReadWrite, sofCreate, sofFullMutex, sofSharedCache];   inherited DoInternalConnect;end; function CreateSQLConnection(ThisDatabaseLocation: string;  ThisType: DatabaseType; ThisUser: string; ThisPass: string): TSpecialConnector;begin  Result := TSpecialConnector.Create(nil);  Result.KeepConnection := False;   case ThisType of    dtSQLite:    begin      Result.ConnectorType := 'SQLite3';      if Empty(ThisDatabaseLocation) then        Result.DatabaseName := DefaultDatabase      else Result.DatabaseName := ThisDatabaseLocation;      Result.Params.Add('foreign_keys=ON');      Result.Params.Add('journal_mode=WAL');    end;    dtMSSQL:    begin    Result.ConnectorType := 'MSSQLServer';      if Empty(ThisDatabaseLocation) then        Result.HostName := 'localhost'      else Result.HostName := ThisDatabaseLocation;      Result.DatabaseName := 'DefaultDatabase';    end;    dtPostgreSQL:    begin      Result.ConnectorType := 'PostgreSQL';      if Empty(ThisDatabaseLocation) then      begin        Result.HostName := 'localhost';        Result.DatabaseName := DefaultDatabaseName;      end      else Result.HostName := ThisDatabaseLocation;    end;    dtODBC:    begin      Result.ConnectorType := 'ODBC';      {$IFDEF UNIX}      Result.Params.Add('DRIVER=MDBTools');      {$ELSE}      Result.Params.Add('DRIVER=Microsoft Access Driver (*.mdb, *.accdb)');      {$ENDIF}      Result.Params.Add('DBQ=' + ThisDatabaseLocation);  end;  else  end;   Result.UserName := ThisUser;  Result.Password := ThisPass;   Result.Transaction := TSQLTransaction.Create(Result);end;