Einzelnen Beitrag anzeigen

Benutzerbild von alphaflight83
alphaflight83

Registriert seit: 5. Jun 2008
Ort: Würzburg
147 Beiträge
 
Delphi 10.4 Sydney
 
#11

Re: SQL Abfrage auf Access .mdb

  Alt 6. Aug 2008, 10:40
Ich hoffe doch, wird halt zur Laufzeit definiert, so dass das Programm verschoben werden kann.

Delphi-Quellcode:

DB_Path := ExtractFilePath(ParamStr(0)) + 'DATA';

ADOConnectionStringStandard := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + DB_Path +
                                 '\Database.mdb;Persist Security Info=False';

(* ADOTableClients: Definition of 'ConnectionString' and 'Table' *)
with ADOTableClients do begin
  try
    ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + DB_Path +
                        '\Database.mdb;Persist Security Info=False';
    TableName := 'Clients';
    Active := True;
  except
   ShowMessage('The database Database.mdb could not be found in the current directory '
                + #10#13 + DB_Path)
  end;
end;

ADOQueryClients. ConnectionString := ADOConnectionStringStandard;
Datasource von ADOQueryClients ist DataSourceClients, die per DataSet wiederum auf ADOTableClients verweist.

Ich suche ja schon ne Weile, von daher kann es fast nur ein kleiner oder besonders dämlicher Fehler sein,
der mir nicht auffällt.
Make me a sandwich! - What? Make it yourself. - Sudo make me a sandwich! - Okay
  Mit Zitat antworten Zitat