hallo! hab ein kleines Problem. Wir haben in unserer Firma Artikel und Fotos. Leider hat noch nicht jeder Artikel ein Foto.
Die Namen sind Identisch. Also das Foto heißt wie der Artikel + jpg.
Ich hab alle Artikel von der Datenbank in eine Listbox hineingegeben. Die Fotos sind in einer Filebox.
Bsp.
Lst_Artikel: Spule_666.jpg <--- Listbox
Fil_Datei: Spule_666.jpg <--- Filebox
Jetzt möchte ich abfragen, welche Artikel in der Listbox noch kein Foto von der Filebox hat und diese dann in eine weitere listbox anzeigen.
leider sitz ich jetzt schon seit 2 std. dabei und mir fällt noch immer keine Lösung ein.
Wisst ihr zufällig wie ich das abfragen kann? Bei mir raucht schon der Kopf......
Code:
Public objWI As New ADODB.Connection
Public rsTemp As New ADODB.Recordset
Public SQL As String
Public pic As String
Private Sub dirverzeichnis_Change()
fildatei.Path = dirverzeichnis.Path
End Sub
Private Sub drvlaufwerk_Change()
dirverzeichnis.Path = drvlaufwerk.Drive
End Sub
Private Sub Form_Load()
Set objWI = New ADODB.Connection
With objWI
.Provider = "xxxxxx"
.Properties("Data Source") = "xxxxx"
.Properties("Initial Catalog") = "xxxxx"
.Properties("User ID") = "xxxx"
.Properties("Password") = "xxxx"
.ConnectionTimeout = 0
.CommandTimeout = 0
.Open
End With
SQL = "Select artikel from stammdaten order by artikel"
rsTemp.Open SQL, objWI, adOpenKeyset, adLockReadOnly
rsTemp.MoveFirst
lst_artikel.Clear
Do While Not rsTemp.EOF
pic = Trim(rsTemp!artikel) & ".jpg"
pic = Replace(pic, "/", "_")
lst_artikel.AddItem pic
rsTemp.MoveNext
Loop
rsTemp.Close
End Sub
Die Namen sind Identisch. Also das Foto heißt wie der Artikel + jpg.
Ich hab alle Artikel von der Datenbank in eine Listbox hineingegeben. Die Fotos sind in einer Filebox.
Bsp.
Lst_Artikel: Spule_666.jpg <--- Listbox
Fil_Datei: Spule_666.jpg <--- Filebox
Jetzt möchte ich abfragen, welche Artikel in der Listbox noch kein Foto von der Filebox hat und diese dann in eine weitere listbox anzeigen.
leider sitz ich jetzt schon seit 2 std. dabei und mir fällt noch immer keine Lösung ein.
Wisst ihr zufällig wie ich das abfragen kann? Bei mir raucht schon der Kopf......
Code:
Public objWI As New ADODB.Connection
Public rsTemp As New ADODB.Recordset
Public SQL As String
Public pic As String
Private Sub dirverzeichnis_Change()
fildatei.Path = dirverzeichnis.Path
End Sub
Private Sub drvlaufwerk_Change()
dirverzeichnis.Path = drvlaufwerk.Drive
End Sub
Private Sub Form_Load()
Set objWI = New ADODB.Connection
With objWI
.Provider = "xxxxxx"
.Properties("Data Source") = "xxxxx"
.Properties("Initial Catalog") = "xxxxx"
.Properties("User ID") = "xxxx"
.Properties("Password") = "xxxx"
.ConnectionTimeout = 0
.CommandTimeout = 0
.Open
End With
SQL = "Select artikel from stammdaten order by artikel"
rsTemp.Open SQL, objWI, adOpenKeyset, adLockReadOnly
rsTemp.MoveFirst
lst_artikel.Clear
Do While Not rsTemp.EOF
pic = Trim(rsTemp!artikel) & ".jpg"
pic = Replace(pic, "/", "_")
lst_artikel.AddItem pic
rsTemp.MoveNext
Loop
rsTemp.Close
End Sub