Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 12:53 
Hallo !

Ich habe viele Datenbanken und die sollen in einer ComboBox angezeigt werden und man sollte sie auswählen können,wie mache ich das ???
und geht das mit einer ComboBox

Titel lt. Richtlinien geändert. Marc
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 12:54 
`der name der datenbank soll angezeit werden
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 18.07.02 12:55 
Weißt Du nicht wie man Einträge in die ComboBox hinzufügt? So z. b.:
ausblenden Quelltext
1:
ComboBox1.Items.Add ('Datenbank1');					


Gruß
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 13:01 
das wusste ich nicht,aber ich will ja noch das er alle Datenbanken anzeigt die ich erstellt habe !
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 18.07.02 13:05 
Wo liegen denn die Datenbanken und wie kann man diese finden? Also heißen die z. b. alle ".db" oder so?
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 18.07.02 13:18 
Hallo Jagg,

lies dir bitte mal das durch und stell deine Fragen bitte etwas präziser.

zB.: Wie kann ich alle *.DB Dateien auf meiner Platte in einer combobox auswählen oder
Wie kann ich alee Datenbanken für die ich ein Alias habe in einer combobox auswählen


Gruß

Wolfgang
[/url]
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 13:50 
Also,die Datenbanken liegen alle im Verzeichnis "C:\Nguyen\Sonstige\Maling Service\Datenbank\" und das sind alle "dbf"


Jagg !
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 18.07.02 13:55 
Sieh mal in der Hilfe unter Findfirst, findnext (sogar mit Beispiel)
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 13:56 
ok
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 14:37 
ich habe keine ahnung wie das mit findfirst und findnext geht,ich blick da gar nicht durch !

Kann mir da jemand helfen ???
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 18.07.02 14:41 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
var

  SearchRec: TSearchRec;
procedure TForm1.SearchClick(Sender: TObject);
begin
  FindFirst('c:\Program Files\delphi4\bin\*.*', faAnyFile, SearchRec);
  Label1.Caption := SearchRec.Name + ' is ' + IntToStr(SearchRec.Size) + ' bytes in size';
end;
procedure TForm1.AgainClick(Sender: TObject);
begin
  if (FindNext(SearchRec) = 0)
        Label1.Caption := SearchRec.Name + ' is ' + IntToStr(SearchRec.Size) + ' bytes in size';

  else
    FindClose(SearchRec);
end;


Das ist das Beispiel aus der Hilfe. Hast du das mal compiliert und dir angesehen?

Gruß

Wolfgang
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 14:45 
gib mir mal die syntax von findfirst und findnext,vllt versteh ich es dann besser !
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 18.07.02 14:49 
Findfirst im editor eingeben F1 drücken und dann kommt folgendes:

function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;

....
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 14:53 
gib mir mal bitte so ein Beispiel ! *bidde*

Pfad = C:\Nguyen
Dateien *.dbf !

Danke !

Jagg !
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 18.07.02 14:55 
FindFirst('C:\Nguyen\*.dbf', faAnyFile, SearchRec);
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 14:59 
und wie mache ich das er jetzt in deie ComboBox schreibt ???

ComboBox := FindFirst('C:\Nguyen\*.dbf', faAnyFile, SearchRec); ???

SO ind etwa ???

Jagg !
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 18.07.02 15:05 
Jagg hat folgendes geschrieben:
SO ind etwa ???!
Nein! Nimm das Beispiel das Wolfgang (das aus der Delphi-Hilfe) und versuch es in einem neuen Projekt zu kompileren. Dann starte das Programm und versuch zu verstehen was der Code macht. Dann bau den Code so um das die Datenbanken in dem Label anzeigt werden. Im nächsten Schritt versuchst Du dann das das Suchergebnis nicht im Label sondern in einer Combobox landet. Dann hast Du einen gute Ausgangsposition um den Code in Deine Anwendung einzubauen.

Gruß
TINO
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 15:26 
so,ich habe das jetzt mit der ComboBox aber er zeigt mir immer nur eine dbf datei an,ich will aber das er alle anzeigt und das man dann mit einem klick auf dem pfeil es auswählen kann
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 18.07.02 15:31 
Ich benutze TComboBox oder muss ich DBComboBox oder doch DBLookupComboBox nehemen !
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 18.07.02 15:31 
Hast du das gemacht wie Tino geschrieben hat? NEIN! Du kannst das 1. nicht in der Zeit geschaft haben und 2. hast du bestimmt keine while-Scheife und findnext benutzt.


WW