K
Killhuha
In der Schule sollten wir erst eine VB Datenbank erstellen, was ich inzwischen auch hinter mir habe, nur aber sollen wir das Programm so umschreiben, dass wir die gespeicherten Daten nach bestimmten Regeln sortieren können, z.B. alphabetisch.
Zwar habe ich schon danach gesucht, doch bisher nichts hilfreiches gefunden. Es würde mich freuen, wenn ihr mir etwas mehr helfen könntet.
Denn Code hänge ich unten an.
thx Killhuha
Zwar habe ich schon danach gesucht, doch bisher nichts hilfreiches gefunden. Es würde mich freuen, wenn ihr mir etwas mehr helfen könntet.
Denn Code hänge ich unten an.
thx Killhuha
Code:
Private Sub Command1_Click()
List1.Clear
List2.Clear
List3.Clear
List4.Clear
List5.Clear
List6.Clear
End Sub
Private Sub Command2_Click()
Path = "H:\Vorname.txt"
Open Path For Input As #1
Do Until EOF(1)
Input #1, Data
List1.AddItem Data
Loop
Close #1
Path = "H:\Nachname.txt"
Open Path For Input As #2
Do Until EOF(2)
Input #2, Data
List2.AddItem Data
Loop
Close #2
Path = "H:\Adresse.txt"
Open Path For Input As #3
Do Until EOF(3)
Input #3, Data
List3.AddItem Data
Loop
Close #3
Path = "H:\Postleitzahl.txt"
Open Path For Input As #4
Do Until EOF(4)
Input #4, Data
List4.AddItem Data
Loop
Close #4
Path = "H:\Ort.txt"
Open Path For Input As #5
Do Until EOF(5)
Input #5, Data
List5.AddItem Data
Loop
Close #5
Path = "H:\Land.txt"
Open Path For Input As #6
Do Until EOF(6)
Input #6, Data
List6.AddItem Data
Loop
Close #6
End Sub
Private Sub Eintragen_Click()
List1.AddItem (Vorname.Text)
List2.AddItem (Nachname.Text)
List3.AddItem (Adresse.Text)
List4.AddItem (Postleitzahl.Text)
List5.AddItem (Ort.Text)
List6.AddItem (Land.Text)
Vorname.Text = Empty
Nachname.Text = Empty
Adresse.Text = Empty
Postleitzahl.Text = Empty
Ort.Text = Empty
Land.Text = Empty
End Sub
Private Sub End_Click()
End
End Sub
Private Sub Speichern_Click()
Path = "H:\Vorname.txt"
Open Path For Output As #1
Close #1
nn = 0
Do Until nn = List1.ListCount
Data = List1.List(nn)
Open Path For Append As #1
Write #1, Data
Close #1
nn = nn + 1
Loop
Path = "H:\Nachname.txt"
Open Path For Output As #1
Close #1
vn = 0
Do Until vn = List2.ListCount
Data = List2.List(vn)
Open Path For Append As #1
Write #1, Data
Close #1
vn = vn + 1
Loop
Path = "H:\Adresse.txt"
Open Path For Output As #1
Close #1
wo = 0
Do Until wo = List3.ListCount
Data = List3.List(wo)
Open Path For Append As #1
Write #1, Data
Close #1
wo = wo + 1
Loop
Path = "H:\Postleitzahl.txt"
Open Path For Output As #1
Close #1
l = 0
Do Until l = List4.ListCount
Data = List4.List(l)
Open Path For Append As #1
Write #1, Data
Close #1
l = l + 1
Loop
Path = "H:\Ort.txt"
Open Path For Output As #1
Close #1
zz = 0
Do Until zz = List5.ListCount
Data = List5.List(zz)
Open Path For Append As #1
Write #1, Data
Close #1
zz = zz + 1
Loop
Path = "H:\Land.txt"
Open Path For Output As #1
Close #1
xx = 0
Do Until xx = List6.ListCount
Data = List6.List(xx)
Open Path For Append As #1
Write #1, Data
Close #1
xx = xx + 1
Loop
End Sub