Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Unidac dbf is not a valid path (https://www.delphipraxis.net/194793-unidac-dbf-not-valid-path.html)

Alfredo 7. Jan 2018 16:23

Datenbank: dbf • Version: VII • Zugriff über: Unidac

Unidac dbf is not a valid path
 
Delphi 10.2.2 und Devart 7.1.4 Trial

Code:
UniConnection := TUniconnection.Create(nil);
UniConnection.ProviderName := 'DBF';
UniConnection.SpecificOptions.Add('Direct=True');
UniConnection.Database := 'D:\Dat\anlm.dbf';
UniConnection.Connect;
Liefert die Fehlermeldung "D:\Dat\anlm.dbf is not a valid path"

Gruß
Alfred

Bernhard Geyer 7. Jan 2018 16:37

AW: Unidac dbf is not a valid path
 
ist es wirklich "D:\Dat" und nicht "D:\Data"?

Delphi.Narium 7. Jan 2018 17:08

AW: Unidac dbf is not a valid path
 
Mal 'ne kleine Fehlerprüfung einbauen?
Delphi-Quellcode:
Var
 sDBF : String;
begin
  sDBF := 'D:\Dat\anlm.dbf';
  if not FileExists(UniConnection.Database) then begin
    MessageDlg(Fortmat('Die Datei %s existiert nicht.',[sDBF]),mtError,[mbOk],0);
    // Routinen sinnvoll beenden oder
    exit;
  end;
  UniConnection := TUniconnection.Create(nil);
  UniConnection.ProviderName := 'DBF';
  UniConnection.SpecificOptions.Add('Direct=True');
  UniConnection.Database := sDBF;
  UniConnection.Connect;
  // ...

brechi 7. Jan 2018 18:21

AW: Unidac dbf is not a valid path
 
Database ist wahrscheinlich der Ordner und nicht die Datei. Die ist die Tabelle.

Bernhard Geyer 7. Jan 2018 18:27

AW: Unidac dbf is not a valid path
 
Zitat:

Zitat von brechi (Beitrag 1390430)
Database ist wahrscheinlich der Ordner und nicht die Datei. Die ist die Tabelle.

Könnte natürlich auch sein. Irgendeine dieser Dinosaurier-DBs (Dbf/Paradox) hat für jede Tabelle eine eine eigene Datei, die andere nicht.

Alfredo 7. Jan 2018 18:28

AW: Unidac dbf is not a valid path
 
File exists findet die Datei.

Werde mich bessern und zukünftig Data verwenden.

Brechi hat Recht :thumb: in Database darf nur der Ordner.

Wie kommt dann aber bei Unidac die Tabelle ins Spiel?

brechi 7. Jan 2018 18:30

AW: Unidac dbf is not a valid path
 
WMit select* from _dateiname_ bei einer query. Nutze selbst kein UniDac. Ist aber bei tdbf? oder bde? so.

Alfredo 7. Jan 2018 18:40

AW: Unidac dbf is not a valid path
 
Zitat:

Zitat von Bernhard
Könnte natürlich auch sein. Irgendeine dieser Dinosaurier-DBs (Dbf/Paradox) hat für jede Tabelle eine eine eigene Datei, die andere nicht.

Mein Dino-Programm hat 24 Jahre auf dem Buckel und erfüllt wegen dieses simplen Konzeptes immer noch seinen Zweck. :-D

Es soll mit mir in neuem Design in Rente gehen.

Alfredo 7. Jan 2018 19:06

AW: Unidac dbf is not a valid path
 
Ich bin stolz auf euch. :thumb:

UniQuery1, Datasource1, TDBGrid

und schon sind die Daten im Formular zu sehen :-D

Wenn ich es zu Fuß geschafft habe, ergänze ich das hier noch.


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:36 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz