1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Alina

Beiträge von Alina

  • Grias eich

    • Alina
    • 14. Dezember 2015 um 21:47

    @BugFix, ich lasse mich gerne bekomchen, aber dann richtig bitte. ;)
    Aber wer kocht, wäscht auch ab und das ohne Abwaschmaschine. ;)

  • Grias eich

    • Alina
    • 14. Dezember 2015 um 11:48

    ein mann dr kochen kann. wunderbar. da hat deine freundin ja mal glück.
    ich kann aber auch kochen. am liebsten etwas mit sahnesoße. hoffe ja immer noch, das ich mal einem BMI von 19 bekomme, aber ich essen und essen, aber mehr als 18 geht einfach nicht.
    .
    Bluescreen? Oh, wo hast DU den denn her. *hüpf* Lange nichts von ihm gehört. ;)

  • gelöst: Datensatz löschen

    • Alina
    • 14. Dezember 2015 um 10:10

    Also löschen tut er, aber immer den DS davor und das zeigt er auch in der MSgBox an. Habe es dann auf "+1" gestellt, bringt aber auch nichts.

    Dann mache er es nur richtig, wenn man KEIN neuen DS eingefügt hat und auch da mal ja mal nein und es folgt wirres löschen, d. h. er löscht nicht was er soll.

    Ich blicke da nicht mehr durch. :( :( :(

  • Tastatur gesucht

    • Alina
    • 14. Dezember 2015 um 04:00

    Und ich nutze eine ganze einfache "C-Board 830" Tastatur.
    DIe hält schnelle Anschläge gut durch und auch mal etwas härte Anschläge, wenn die Laune mal nicht so rosig ist.
    Ich als Linkshänderin finde die Tastatur sehr ansprechend. Aber demnächst gibt es neue Tastaturen, nur sind sich
    die Herren von der Technik noch nicht einig, da wir Kartenlesegeräte drinnen haben sollen und die nicht wissen,
    welche Tastatur am besten dafür ist und wo man dann die Karten kaufen kann. Die sind da nicht so schnell, wollen
    unbedingt in Dänemark kaufen und warten, was wir für Ansprüche und Vorstellungen haben. Ich kenn mich da nicht
    aus.

  • Grias eich

    • Alina
    • 14. Dezember 2015 um 03:44

    @peter, wieso soltle ich etwas gegen Dich verwenden? Nee, hier bin ich eine eher brave Lady, die mit der Glaskugel versucht zu helfen oder auch Hilfe zu bekommen.

  • gelöst: Datensatz löschen

    • Alina
    • 14. Dezember 2015 um 03:41

    Hallo RR04 und alle Lesenden.

    Genau das ist ja mein Problem. Mit einem festen Datensatz, wie Du es gezeigt hast mit DS 5 geht es ja und das habe ich auch hinbekommen, aber halt nicht, das es auch in der DB gelöscht wird.
    Er löscht es aus dem ListView, aber sobald man danach einen neuen DS eingibt oder die Tabelle neu startet, sind alle DS wieder da. Ich habe den Script nun so hier gepostet, wie ich ihn gerade getestet habe. Sieht wie folgt aus:

    AutoIt
    #Region    ;************ Includes ************
    #Include <SQLite.au3>
    #Include <GuiListView.au3>
    #EndRegion ;************ Includes ************
    ;Opt
    Opt("GUIOnEventMode", 0) ; Du benutzt den MsgLoop-Modus also muss hier "0" stehen oder die Zeile gleich ganz weglassen, weil "0" der Standardwert ist
    Global $hQuery, $aNames, $aRow
    ;GUI Titel
    $Buchverwaltung = GUICreate("Buchverwaltung erstellt mit AutoIt", 1121, 629, 280, 183)
    ; Titel oben Mitte
    $Label1 = GUICtrlCreateLabel("~  ~  ~  B  U  C  H  V  E  R  W  A  L  T  U  N  G   ~  ~  ~", 304, 8, 516, 28)
    GUICtrlSetFont(-1, 16, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x0000FF)
    ; ListView
    $listview = GUICtrlCreateListView("ID |Titel|Autor|Verlag|Erscheinungsdatum|Genre|Preis|Einband|ISBN|Seiten|Lagerplatz|Serie|Bestellt|Gelesen|Note|Zusatz|Information|Ausgeliehen_an|Ausgeliehen_am|Ausgeliehen_bis|LfdNr", 10, 40, 1105, 220)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    
    
    ; Hauptbereich
    $Label2 = GUICtrlCreateLabel("Titel:  ", 10, 274, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input1 = GUICtrlCreateInput("", 160, 272, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label3 = GUICtrlCreateLabel("Autor:", 10, 305, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input2 = GUICtrlCreateInput("", 160, 302, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label4 = GUICtrlCreateLabel("Verlag: ", 10, 335, 58, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input3 = GUICtrlCreateInput("", 160, 332, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label5 = GUICtrlCreateLabel("Genre: ", 10, 365, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input4 = GUICtrlCreateInput("", 160, 362, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label6 = GUICtrlCreateLabel("Erscheinungsdatum: ", 10, 395, 149, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input5 = GUICtrlCreateInput("2016.01.31", 160, 392, 100, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label7 = GUICtrlCreateLabel("Serie: ", 267, 395, 50, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input6 = GUICtrlCreateInput("", 313, 392, 208, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label8 = GUICtrlCreateLabel("Preis: ", 10, 424, 146, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input7 = GUICtrlCreateInput("", 160, 422, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label9 = GUICtrlCreateLabel("Lagerplatz: ", 267, 424, 85, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input8 = GUICtrlCreateInput("", 354, 422, 165, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label10 = GUICtrlCreateLabel("Einband: ", 10, 455, 70, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input9 = GUICtrlCreateInput("", 160, 452, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label11 = GUICtrlCreateLabel("ISBN", 10, 485, 40, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input10 = GUICtrlCreateInput("", 160, 482, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label12 = GUICtrlCreateLabel("Seiten: ", 10, 514, 57, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input11 = GUICtrlCreateInput("", 160, 512, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label13 = GUICtrlCreateLabel("ausgeliehen an: ", 624, 272, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input12 = GUICtrlCreateInput("", 760, 272, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label14 = GUICtrlCreateLabel("ausgeliehen am: ", 624, 302, 122, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input13 = GUICtrlCreateInput("", 760, 302, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label15 = GUICtrlCreateLabel("ausgeliehen bis: ", 624, 332, 121, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input14 = GUICtrlCreateInput("", 760, 334, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label16 = GUICtrlCreateLabel("Bestellt: J/N", 624, 384, 86, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input15 = GUICtrlCreateInput("", 760, 384, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label17 = GUICtrlCreateLabel("gelesen: J/N", 624, 414, 90, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input16 = GUICtrlCreateInput("", 760, 414, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    
    
    $Label18 = GUICtrlCreateLabel("Note: 1 - 6", 624, 444, 76, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input17 = GUICtrlCreateInput("", 760, 444, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label19 = GUICtrlCreateLabel("Zusatz:", 624, 474, 53, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input18 = GUICtrlCreateInput("", 760, 472, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label20 = GUICtrlCreateLabel("Information:", 896, 384, 84, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Edit1 = GUICtrlCreateEdit("AA_info", 896, 408, 217, 89)
    
    
    $Label24 = GUICtrlCreateLabel("Lfd.-Nr:", 350, 515, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input20 = GUICtrlCreateInput("", 415, 512, 105, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlSetData(-1, "")
    
    
    
    
    $Label22 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 10, 256, 1110, 17)
    $Label23 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 10, 544, 1110, 17)
    
    
    ;Suche
    $Button16 = GUICtrlCreateButton("S U C H E N", 621, 509, 132, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input19 = GUICtrlCreateInput("Suchbegriff hier eingeben", 760, 507, 347, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    ; unterer Bereich
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label26 = GUICtrlCreateLabel("Büchermenge:  ", 13, 595, 113, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input22 = GUICtrlCreateInput("", 128, 592, 81, 26) ; hier soll die ges. Bücheranzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label27 = GUICtrlCreateLabel("Ges. Seitenzahl:", 270, 596, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input23 = GUICtrlCreateInput(" ", 394, 592, 81, 26) ; hier soll die ges. Seitenzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label28 = GUICtrlCreateLabel("Ges. Buch NP:", 572, 595, 106, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlCreateInput("", 680, 592, 121, 26) ; hier soll der ges. Bücherwert eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Button20 = GUICtrlCreateButton("Speichern", 991, 592, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    ;  Ausleihbutton
    $Button17 = GUICtrlCreateButton("Ausleihen", 888, 272, 227, 25)
    ; DK 1 / 2 / 3
    $Button18 = GUICtrlCreateButton("Update", 894, 334, 99, 26)
    ; D 1 / 2
    $Button19 = GUICtrlCreateButton("Löschen", 1012, 334, 99, 25)
    ; GUI anzeigen
    GUISetState(@SW_SHOW)
    ;  !!! Datei lösche ich hier nur, damit ich sie nicht manuell löschen muss in der Übungsphase !!!
    FileDelete(@ScriptDir & "\buchverwaltung.db")
    ; DLL Pfad
    _SQLite_Startup(@ScriptDir & "\sqlite3.dll", False, 1) ; BugFix Idee, da DLL ja nicht mehr mitgeliefert wird
    ; gibt die SQL Version in die Console aus
    ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
    ; Datenbank öffnen, ggf. erstellen
    Global $g_db_Database = _SQLite_Open(@ScriptDir & "\buchverwaltung.db")
    ; Datenbanktabelle
    _SQLite_Exec($g_db_Database, "CREATE TABLE IF NOT EXISTS Buchverwaltung(ID INTEGER PRIMARY KEY AUTOINCREMENT,Titel,Autor,Verlag,Erscheinungsdatum,Genre,Preis,Einband,ISBN,Seiten,Lagerplatz,Serie,Bestellt,Gelesen,Note,Zusatz,Information,Ausgeliehen_an,Ausgeliehen_am,Ausgeliehen_bis,LfdNr);")
    ; jeweils ein Datensatz wird dazu geschrieben, Daten sind von Enno Jüders zur Verfügung gestellt.
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'13 Tage','Giambanco, Valentina','Droemer Knaur','2014.03.03','Thriller','14.99','Hardcover','9783426513996','576','R1-F2','','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Abgründe','Strobel, Arno','Loewe','2014.03.10','Thriller-J','9.95','Taschenbuch','9783785578643','240','R1-F2','','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Agent 6','Smith, Tom Rob','Goldmann','2011.09.14','Thriller','9.99','Taschenbuch','9783442546770','540','R1-F2','Leo Demidow Bd.3','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bedroht','Koppen, Hans','Heyne','2013.03.27','Thriller','14.99','Taschenbuch','9783453268012','411','R1-F2','','','J','1','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Belladonna','Slaughter, Karin','rororo','2003.03.03','Thriller','6.00','Taschenbuch','9783499239140','413','R1-F1','Grant County Bd.1','','J','1','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bis zum letzten Atemzug','Baldacci, David','Bastei Lübbe','2011.04.01','Thriller','9.99','Taschenbuch','9783404165537','574','R1-F2','King & Maxwell Bd. 4','austauschen','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bittere Wunden','Slaughter, Karin','blanvalet','2014.09.01','Thriller','19.99','Hardcover','9783764505172','576','R1-F1','Georgia Bd.4','','J','2','','','','..','..','..');")
    
    
    _ListViewFill()
    
    
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case -3
    			_Exit() ; Ende
    		Case $listview ; Sortieren v. ListView
    			_GUICtrlListView_SortItems($listview, GUICtrlGetState($listview))
    		Case $Button20 ; Speichern (erledigt)
    			_DsInset()
    		Case $Button19 ; Löschen (offen in Arbeit)
    			_DsDelete()
    		Case $Button18 ; Update  (offen)
    			_DsUpdate()
    		Case $Button16 ; Search (offen)
    			_search()
    		Case $Button17 ; Ausleihen (offen und für später gedacht, wenn ich mit SQLite besser klar komme und es besser verstehe; Idee: eine extra DB fürs ausleihen.)
    			_ausleihen()
    	EndSwitch
    WEnd
    
    
    Func _Exit() ; Datenbank schließen und down.
    	_GUICtrlListView_UnRegisterSortCallBack($listview)
    	_SQLite_Close($g_db_Database)
    	_SQLite_Shutdown()
    	Exit
    EndFunc   ;==>_Exit
    
    
    Func _ausleihen()
    	MsgBox(0,"","Noch nicht gescriptet")
    EndFunc
    
    
    Func _search()
    	MsgBox(0,"","Noch nicht gescriptet")
    EndFunc
    
    
    Func _DsUpdate()
    	MsgBox(0,"","Noch nicht gescriptet")
    EndFunc
    
    
    ; DS löschen
    Func _DsDelete()
    	$sel=_GUICtrlListView_GetSelectedIndices($Listview)
    		if $sel<>-1 then
    			_GUICtrlListView_GetItemText($Listview,$sel,0)
    			_SQLite_Exec(-1,"Delete * from Buchverwaltung where ROWID='"&$sel&"'") ; _SQLite_Exec(-1,"Delete * from Buchverwaltung where id='"&$sel&"'")
    			_GUICtrlListView_DeleteItem($Listview,$sel)
    		endif
    EndFunc
    
    
    
    
    ; Datensatz von GUI2DB
    Func _DsInset()
    	Local $aworte
    	$inputs1 = GUICtrlRead($Input1)      ; Titel
    	$inputs2 = GUICtrlRead($Input2)      ; Autor
    	$inputs3 = GUICtrlRead($Input3)      ; Verlag
    	$inputs4 = GUICtrlRead($Input4)      ; Genre
    	$inputs5 = GUICtrlRead($Input5)      ; Erscheinungsjahr
    	$inputs6 = GUICtrlRead($Input6)      ; Serie
    	$inputs7 = GUICtrlRead($Input7)      ; Preis
    	$inputs8 = GUICtrlRead($Input8)      ; Lagerplatz
    	$inputs9 = GUICtrlRead($Input9)      ; Einband
    	$inputs10 = GUICtrlRead($Input10)    ;  ISBN
    	$inputs11 = GUICtrlRead($Input11)    ; Seiten
    	$inputs12 = GUICtrlRead($Input12)    ;  Ausgeliehen an
    	$inputs13 = GUICtrlRead($Input13)    ; Ausgeliehen am
    	$inputs14 = GUICtrlRead($Input14)    ; Ausgeliehen bis
    	$inputs15 = GUICtrlRead($Input15)    ; Bestellt: J/N
    	$edits1 = GUICtrlRead($Edit1)        ; Information
    	$inputs16 = GUICtrlRead($Input16)    ; Gelesen
    	$inputs17 = GUICtrlRead($Input17)    ; Note 1-6; und 0 0 nicht gelesen
    	$inputs18 = GUICtrlRead($Input18)    ; Zusatz
    	$inputs20 = GUICtrlRead($Input20)    ; Lfd.-Nr.
    
    
    ;~ 		NULL (sprich nall)- ID, Tabelle Buchverwaltung
    	_SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL, '" & $inputs1 & "','" & $inputs2 & "','" & $inputs3 & "','" & $inputs5 & "','" & $inputs4 & "','" & $inputs7 & "','" & $inputs9 & "','" & $inputs10 & "','" & $inputs11 & "','" & $inputs8 & "','" & $inputs6 & "','" & $inputs15 & "','" & $inputs16 & "','" & $inputs17 & "','" & $inputs18 & "','" & $edits1 & "','" & $inputs12 & "','" & $inputs13 & "','" & $inputs14 & "','" & $inputs20 & "');")
    	_ListViewFill()
    EndFunc   ;==>_DsInset
    
    
    
    
    Func _ListViewFill()
    	_GUICtrlListView_DeleteAllItems($listview)
    	_SQLite_Query(-1, "SELECT ROWID,* FROM Buchverwaltung;", $hQuery)
    	While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK ; Read Out the next Row
    		GUICtrlCreateListViewItem(_ArrayToString($aRow, '|', 1, 21), $listview)
    	WEnd
    	_SQLite_QueryFinalize($hQuery)
    	_GUICtrlListView_RegisterSortCallBack($listview) ; CallBack registrieren zum sortieren
    EndFunc   ;==>_ListViewFill
    Alles anzeigen
  • gelöst: Datensatz löschen

    • Alina
    • 13. Dezember 2015 um 16:57

    @RR04, das Problem mit dem im Beitrag-4 genannten ist jedoch auch so nicht behoben.
    Es wird in der Listview gelöscht, aber nicht in der Datenbank, denn wenn ich nach dem löschen neu starte oder einen neuen DS dazu gebe, kommen alle zuvor gelöschte DS's wieder ins ListView.

  • Grias eich

    • Alina
    • 13. Dezember 2015 um 16:27

    @peter, wenn ich es mir von DIR bringen LASSE, brauch ich es nicht zu HOLEN. LOOOOOOL
    Die Kugel ist mein Lieblingsspielzeug, aber dafür bist Du noch zu klein. :rofl:

  • gelöst: Datensatz löschen

    • Alina
    • 13. Dezember 2015 um 16:24

    Hallo Kanashius.

    So in der Form hatte ich es ja überlegt, doch das Problem ist, wenn ich so einen DS lösche
    und dann einen neuen DS speichere, kommen alle DS noch einmal ins ListView und das incl.
    den gelöschtten.

  • Grias eich

    • Alina
    • 12. Dezember 2015 um 23:49

    Gerne doch Peter.

    - von einem Ort, einer Stelle, an der sich etwas befindet, her[bei]bringen, herbeischaffen
    - jemanden [schnell] herbeirufen, an einen bestimmten Ort bitten, wo er gebraucht, gewünscht wird
    - von einem bestimmten Ort abholen [und wegschaffen]
    - sich etwas geben lassen, verschaffen, von jemandem erbitte
    - (umgangssprachlich) gewinnen, erlangen, erwerben
    - (umgangssprachlich) sich etwas (Krankmachendes, Unangenehmes, Schlimmes) zuziehen

  • gelöst: Datensatz löschen

    • Alina
    • 12. Dezember 2015 um 22:57

    Moin zusammen.
    In den Zeilen 216 bis 225 möchte ich folgendes erreichen:
    Ich wähle in der Listview einen Datensatz aus. Er ist dann ja blau hinterlegt. Nun sollen, wenn ich den Datensatz ausgewählt haben und ich auf Button19 (Löschbutton) drücke, der Datensatz gelöscht und das Listview neu eingelesen werden.

    Wie bekomme ich die ID von dem Datensatz, um damit zu arbeiten???

    AutoIt
    #Region    ;************ Includes ************
    #Include <SQLite.au3>
    #Include <GuiListView.au3>
    #EndRegion ;************ Includes ************
    ;Opt
    Opt("GUIOnEventMode", 0) ; Du benutzt den MsgLoop-Modus also muss hier "0" stehen oder die Zeile gleich ganz weglassen, weil "0" der Standardwert ist
    Global $hQuery, $aNames, $aRow
    ;GUI Titel
    $Buchverwaltung = GUICreate("Buchverwaltung erstellt mit AutoIt", 1121, 629, 280, 183)
    ; Titel oben Mitte
    $Label1 = GUICtrlCreateLabel("~  ~  ~  B  U  C  H  V  E  R  W  A  L  T  U  N  G   ~  ~  ~", 304, 8, 516, 28)
    GUICtrlSetFont(-1, 16, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x0000FF)
    ; ListView
    $listview = GUICtrlCreateListView("ID |Titel|Autor|Verlag|Erscheinungsdatum|Genre|Preis|Einband|ISBN|Seiten|Lagerplatz|Serie|Bestellt|Gelesen|Note|Zusatz|Information|Ausgeliehen_an|Ausgeliehen_am|Ausgeliehen_bis|LfdNr", 10, 40, 1105, 220)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    ; Hauptbereich
    $Label2 = GUICtrlCreateLabel("Titel:  ", 10, 274, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input1 = GUICtrlCreateInput("", 160, 272, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label3 = GUICtrlCreateLabel("Autor:", 10, 305, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input2 = GUICtrlCreateInput("", 160, 302, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label4 = GUICtrlCreateLabel("Verlag: ", 10, 335, 58, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input3 = GUICtrlCreateInput("", 160, 332, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label5 = GUICtrlCreateLabel("Genre: ", 10, 365, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input4 = GUICtrlCreateInput("", 160, 362, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label6 = GUICtrlCreateLabel("Erscheinungsdatum: ", 10, 395, 149, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input5 = GUICtrlCreateInput("2016.01.31", 160, 392, 100, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label7 = GUICtrlCreateLabel("Serie: ", 267, 395, 50, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input6 = GUICtrlCreateInput("", 313, 392, 208, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label8 = GUICtrlCreateLabel("Preis: ", 10, 424, 146, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input7 = GUICtrlCreateInput("", 160, 422, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label9 = GUICtrlCreateLabel("Lagerplatz: ", 267, 424, 85, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input8 = GUICtrlCreateInput("", 354, 422, 165, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label10 = GUICtrlCreateLabel("Einband: ", 10, 455, 70, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input9 = GUICtrlCreateInput("", 160, 452, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label11 = GUICtrlCreateLabel("ISBN", 10, 485, 40, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input10 = GUICtrlCreateInput("", 160, 482, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label12 = GUICtrlCreateLabel("Seiten: ", 10, 514, 57, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input11 = GUICtrlCreateInput("", 160, 512, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label13 = GUICtrlCreateLabel("ausgeliehen an: ", 624, 272, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input12 = GUICtrlCreateInput("", 760, 272, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label14 = GUICtrlCreateLabel("ausgeliehen am: ", 624, 302, 122, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input13 = GUICtrlCreateInput("", 760, 302, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label15 = GUICtrlCreateLabel("ausgeliehen bis: ", 624, 332, 121, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input14 = GUICtrlCreateInput("", 760, 334, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label16 = GUICtrlCreateLabel("Bestellt: J/N", 624, 384, 86, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input15 = GUICtrlCreateInput("", 760, 384, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label17 = GUICtrlCreateLabel("gelesen: J/N", 624, 414, 90, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input16 = GUICtrlCreateInput("", 760, 414, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label18 = GUICtrlCreateLabel("Note: 1 - 6", 624, 444, 76, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input17 = GUICtrlCreateInput("", 760, 444, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label19 = GUICtrlCreateLabel("Zusatz:", 624, 474, 53, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input18 = GUICtrlCreateInput("", 760, 472, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label20 = GUICtrlCreateLabel("Information:", 896, 384, 84, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Edit1 = GUICtrlCreateEdit("AA_info", 896, 408, 217, 89)
    $Label24 = GUICtrlCreateLabel("Lfd.-Nr:", 350, 515, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input20 = GUICtrlCreateInput("", 415, 512, 105, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlSetData(-1, "")
    $Label22 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 10, 256, 1110, 17)
    $Label23 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 10, 544, 1110, 17)
    ;Suche
    $Button16 = GUICtrlCreateButton("S U C H E N", 621, 509, 132, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input19 = GUICtrlCreateInput("Suchbegriff hier eingeben", 760, 507, 347, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    ; unterer Bereich
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label26 = GUICtrlCreateLabel("Büchermenge:  ", 13, 595, 113, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input22 = GUICtrlCreateInput("", 128, 592, 81, 26) ; hier soll die ges. Bücheranzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label27 = GUICtrlCreateLabel("Ges. Seitenzahl:", 270, 596, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input23 = GUICtrlCreateInput(" ", 394, 592, 81, 26) ; hier soll die ges. Seitenzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label28 = GUICtrlCreateLabel("Ges. Buch NP:", 572, 595, 106, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlCreateInput("", 680, 592, 121, 26) ; hier soll der ges. Bücherwert eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Button20 = GUICtrlCreateButton("Speichern", 991, 592, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    ;  Ausleihbutton
    $Button17 = GUICtrlCreateButton("Ausleihen", 888, 272, 227, 25)
    ; DK 1 / 2 / 3
    $Button18 = GUICtrlCreateButton("Update", 894, 334, 99, 26)
    ; D 1 / 2
    $Button19 = GUICtrlCreateButton("Löschen", 1012, 334, 99, 25)
    ; GUI anzeigen
    GUISetState(@SW_SHOW)
    ;  !!! Datei lösche ich hier nur, damit ich sie nicht manuell löschen muss in der Übungsphase !!!
    FileDelete(@ScriptDir & "\buchverwaltung.db")
    ; DLL Pfad
    _SQLite_Startup(@ScriptDir & "\sqlite3.dll", False, 1) ; BugFix Idee, da DLL ja nicht mehr mitgeliefert wird
    ; gibt die SQL Version in die Console aus
    ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
    ; Datenbank öffnen, ggf. erstellen
    Global $g_db_Database = _SQLite_Open(@ScriptDir & "\buchverwaltung.db")
    ; Datenbanktabelle
    _SQLite_Exec($g_db_Database, "CREATE TABLE IF NOT EXISTS Buchverwaltung(ID INTEGER PRIMARY KEY AUTOINCREMENT,Titel,Autor,Verlag,Erscheinungsdatum,Genre,Preis,Einband,ISBN,Seiten,Lagerplatz,Serie,Bestellt,Gelesen,Note,Zusatz,Information,Ausgeliehen_an,Ausgeliehen_am,Ausgeliehen_bis,LfdNr);")
    ; jeweils ein Datensatz wird dazu geschrieben, Daten sind von Enno Jüders zur Verfügung gestellt.
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'13 Tage','Giambanco, Valentina','Droemer Knaur','2014.03.03','Thriller','14.99','Hardcover','9783426513996','576','R1-F2','','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Abgründe','Strobel, Arno','Loewe','2014.03.10','Thriller-J','9.95','Taschenbuch','9783785578643','240','R1-F2','','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Agent 6','Smith, Tom Rob','Goldmann','2011.09.14','Thriller','9.99','Taschenbuch','9783442546770','540','R1-F2','Leo Demidow Bd.3','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bedroht','Koppen, Hans','Heyne','2013.03.27','Thriller','14.99','Taschenbuch','9783453268012','411','R1-F2','','','J','1','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Belladonna','Slaughter, Karin','rororo','2003.03.03','Thriller','6.00','Taschenbuch','9783499239140','413','R1-F1','Grant County Bd.1','','J','1','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bis zum letzten Atemzug','Baldacci, David','Bastei Lübbe','2011.04.01','Thriller','9.99','Taschenbuch','9783404165537','574','R1-F2','King & Maxwell Bd. 4','austauschen','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bittere Wunden','Slaughter, Karin','blanvalet','2014.09.01','Thriller','19.99','Hardcover','9783764505172','576','R1-F1','Georgia Bd.4','','J','2','','','','..','..','..');")
    _ListViewFill()
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case -3
    			_Exit() ; Ende
    		Case $listview ; Sortieren v. ListView
    			_GUICtrlListView_SortItems($listview, GUICtrlGetState($listview))
    		Case $Button20 ; Speichern (erledigt)
    			_DsInset()
    		Case $Button19 ; Löschen (offen in Arbeit)
    			_DsDelete()
    		Case $Button18 ; Update  (offen)
    			_DsUpdate()
    		Case $Button16 ; Search (offen)
    			_search()
    		Case $Button17 ; Ausleihen (offen und für später gedacht, wenn ich mit SQLite besser klar komme und es besser verstehe; Idee: eine extra DB fürs ausleihen.)
    			_ausleihen()
    	EndSwitch
    WEnd
    Func _Exit() ; Datenbank schließen und down.
    	_GUICtrlListView_UnRegisterSortCallBack($listview)
    	_SQLite_Close($g_db_Database)
    	_SQLite_Shutdown()
    	Exit
    EndFunc   ;==>_Exit
    Func _ausleihen()
    	MsgBox(0,"","Noch nicht gescriptet")
    EndFunc
    Func _search()
    	MsgBox(0,"","Noch nicht gescriptet")
    EndFunc
    Func _DsUpdate()
    	MsgBox(0,"","Noch nicht gescriptet")
    EndFunc
    ; DS löschen
    Func _DsDelete()
    	Local $aworte
    	GUICtrlSetData($Input1,"")      ; Titel
    	GUICtrlSetData($Input2,"")      ; Autor
    	GUICtrlSetData($Input3,"")      ; Verlag
    	GUICtrlSetData($Input4,"")      ; Genre
    	GUICtrlSetData($Input5,"")      ; Erscheinungsjahr
    	GUICtrlSetData($Input6,"")      ; Serie
    	GUICtrlSetData($Input7,"")      ; Preis
    	GUICtrlSetData($Input8,"")      ; Lagerplatz
    	GUICtrlSetData($Input9,"")      ; Einband
    	GUICtrlSetData($Input10,"")     ;  ISBN
    	GUICtrlSetData($Input11,"")     ; Seiten
    	GUICtrlSetData($Input12,"")     ;  Ausgeliehen an
    	GUICtrlSetData($Input13,"")     ; Ausgeliehen am
    	GUICtrlSetData($Input14,"")     ; Ausgeliehen bis
    	GUICtrlSetData($Input15,"")     ; Bestellt: J/N
    	GUICtrlSetData($Edit1,"")       ; Information
    	GUICtrlSetData($Input16,"")     ; Gelesen
    	GUICtrlSetData($Input17,"")     ; Note 1-6; und 0 0 nicht gelesen
    	GUICtrlSetData($Input18,"")     ; Zusatz
    	GUICtrlSetData($Input20,"")     ; Lfd.-Nr.
    	_SQLite_Query(-1, "SELECT ROWID,* FROM Buchverwaltung;", $hQuery)
    	_SQLite_QuerySingleRow(-1,"SELECT id FROM Buchverwaltung WHERE id='"&$hQuery&"'",$aworte)
    		If $aworte[0] <> "" Then
    			_SQLite_Exec(-1,"DELETE FROM Buchverwaltung WHERE id='"&$hQuery&"'")
    		EndIf
    	_ListViewFill()
    EndFunc
    ; Datensatz von GUI2DB
    Func _DsInset()
    	Local $aworte
    	$inputs1 = GUICtrlRead($Input1)      ; Titel
    	$inputs2 = GUICtrlRead($Input2)      ; Autor
    	$inputs3 = GUICtrlRead($Input3)      ; Verlag
    	$inputs4 = GUICtrlRead($Input4)      ; Genre
    	$inputs5 = GUICtrlRead($Input5)      ; Erscheinungsjahr
    	$inputs6 = GUICtrlRead($Input6)      ; Serie
    	$inputs7 = GUICtrlRead($Input7)      ; Preis
    	$inputs8 = GUICtrlRead($Input8)      ; Lagerplatz
    	$inputs9 = GUICtrlRead($Input9)      ; Einband
    	$inputs10 = GUICtrlRead($Input10)    ;  ISBN
    	$inputs11 = GUICtrlRead($Input11)    ; Seiten
    	$inputs12 = GUICtrlRead($Input12)    ;  Ausgeliehen an
    	$inputs13 = GUICtrlRead($Input13)    ; Ausgeliehen am
    	$inputs14 = GUICtrlRead($Input14)    ; Ausgeliehen bis
    	$inputs15 = GUICtrlRead($Input15)    ; Bestellt: J/N
    	$edits1 = GUICtrlRead($Edit1)        ; Information
    	$inputs16 = GUICtrlRead($Input16)    ; Gelesen
    	$inputs17 = GUICtrlRead($Input17)    ; Note 1-6; und 0 0 nicht gelesen
    	$inputs18 = GUICtrlRead($Input18)    ; Zusatz
    	$inputs20 = GUICtrlRead($Input20)    ; Lfd.-Nr.
    ;~ 		NULL (sprich nall)- ID, Tabelle Buchverwaltung
    	_SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL, '" & $inputs1 & "','" & $inputs2 & "','" & $inputs3 & "','" & $inputs5 & "','" & $inputs4 & "','" & $inputs7 & "','" & $inputs9 & "','" & $inputs10 & "','" & $inputs11 & "','" & $inputs8 & "','" & $inputs6 & "','" & $inputs15 & "','" & $inputs16 & "','" & $inputs17 & "','" & $inputs18 & "','" & $edits1 & "','" & $inputs12 & "','" & $inputs13 & "','" & $inputs14 & "','" & $inputs20 & "');")
    	_ListViewFill()
    EndFunc   ;==>_DsInset
    Func _ListViewFill()
    	_GUICtrlListView_DeleteAllItems($listview)
    	_SQLite_Query(-1, "SELECT ROWID,* FROM Buchverwaltung;", $hQuery)
    	While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK ; Read Out the next Row
    		GUICtrlCreateListViewItem(_ArrayToString($aRow, '|', 1, 21), $listview)
    	WEnd
    	_SQLite_QueryFinalize($hQuery)
    	_GUICtrlListView_RegisterSortCallBack($listview) ; CallBack registrieren zum sortieren
    EndFunc   ;==>_ListViewFill
    Alles anzeigen
  • (gelöst bis hierhin) Datenausgabe in ein ListView "DB-2-ListView"

    • Alina
    • 12. Dezember 2015 um 19:03

    Aktueller Stand: Eintragen arbeitet nun fehlerfrei. Alles wird dort gespeichert wo es sein soll. Die Fehler habe ich zum Glück dann doch alle gefunden.

    AutoIt
    #Region    ;************ Includes ************
    #Include <SQLite.au3>
    #Include <GuiListView.au3>
    #EndRegion ;************ Includes ************
    ;Opt
    Opt("GUIOnEventMode", 0) ; Du benutzt den MsgLoop-Modus also muss hier "0" stehen oder die Zeile gleich ganz weglassen, weil "0" der Standardwert ist
    Global $hQuery, $aNames, $aRow
    ;GUI Titel
    $Buchverwaltung = GUICreate("Buchverwaltung erstellt mit AutoIt", 1121, 629, 280, 183)
    ; Titel oben Mitte
    $Label1 = GUICtrlCreateLabel("~  ~  ~  B  U  C  H  V  E  R  W  A  L  T  U  N  G   ~  ~  ~", 304, 8, 516, 28)
    GUICtrlSetFont(-1, 16, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x0000FF)
    ; ListView
    $listview = GUICtrlCreateListView("ID |Titel|Autor|Verlag|Erscheinungsdatum|Genre|Preis|Einband|ISBN|Seiten|Lagerplatz|Serie|Bestellt|Gelesen|Note|Zusatz|Information|Ausgeliehen_an|Ausgeliehen_am|Ausgeliehen_bis|LfdNr", 10, 40, 1105, 168)
    $List1 = GUICtrlCreateList("", 8, 40, 1105, 168)
    ;~ GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    ; Hauptbereich
    $Label2 = GUICtrlCreateLabel("Titel:  ", 10, 274, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input1 = GUICtrlCreateInput("", 160, 272, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label3 = GUICtrlCreateLabel("Autor:", 10, 305, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input2 = GUICtrlCreateInput("", 160, 302, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label4 = GUICtrlCreateLabel("Verlag: ", 10, 335, 58, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input3 = GUICtrlCreateInput("", 160, 332, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label5 = GUICtrlCreateLabel("Genre: ", 10, 365, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input4 = GUICtrlCreateInput("", 160, 362, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label6 = GUICtrlCreateLabel("Erscheinungsdatum: ", 10, 395, 149, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input5 = GUICtrlCreateInput("2016.01.31", 160, 392, 100, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label7 = GUICtrlCreateLabel("Serie: ", 267, 395, 50, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input6 = GUICtrlCreateInput("", 313, 392, 208, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label8 = GUICtrlCreateLabel("Preis: ", 10, 424, 146, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input7 = GUICtrlCreateInput("", 160, 422, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label9 = GUICtrlCreateLabel("Lagerplatz: ", 267, 424, 85, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input8 = GUICtrlCreateInput("", 354, 422, 165, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label10 = GUICtrlCreateLabel("Einband: ", 10, 455, 70, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input9 = GUICtrlCreateInput("", 160, 452, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label11 = GUICtrlCreateLabel("ISBN", 10, 485, 40, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input10 = GUICtrlCreateInput("", 160, 482, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label12 = GUICtrlCreateLabel("Seiten: ", 10, 514, 57, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input11 = GUICtrlCreateInput("", 160, 512, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label13 = GUICtrlCreateLabel("ausgeliehen an: ", 624, 272, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input12 = GUICtrlCreateInput("", 760, 272, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label14 = GUICtrlCreateLabel("ausgeliehen am: ", 624, 302, 122, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input13 = GUICtrlCreateInput("", 760, 302, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label15 = GUICtrlCreateLabel("ausgeliehen bis: ", 624, 332, 121, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input14 = GUICtrlCreateInput("", 760, 334, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label16 = GUICtrlCreateLabel("Bestellt: J/N", 624, 384, 86, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input15 = GUICtrlCreateInput("", 760, 384, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label17 = GUICtrlCreateLabel("gelesen: J/N", 624, 414, 90, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input16 = GUICtrlCreateInput("", 760, 414, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    
    
    $Label18 = GUICtrlCreateLabel("Note: 1 - 6", 624, 444, 76, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input17 = GUICtrlCreateInput("", 760, 444, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label19 = GUICtrlCreateLabel("Zusatz:", 624, 474, 53, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input18 = GUICtrlCreateInput("", 760, 472, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label20 = GUICtrlCreateLabel("Information:", 896, 384, 84, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Edit1 = GUICtrlCreateEdit("AA_info", 896, 408, 217, 89)
    
    
    $Label24 = GUICtrlCreateLabel("Lfd.-Nr:", 350, 515, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input20 = GUICtrlCreateInput("", 415, 512, 105, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlSetData(-1, "")
    
    
    
    
    $Label22 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 8, 256, 1105, 17)
    $Label23 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 8, 544, 1105, 17)
    
    
    ;Suche
    $Button16 = GUICtrlCreateButton("S U C H E N", 621, 509, 132, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input19 = GUICtrlCreateInput("Suchbegriff hier eingeben", 760, 507, 347, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    ; unterer Bereich
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Label26 = GUICtrlCreateLabel("Büchermenge:  ", 13, 595, 113, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input22 = GUICtrlCreateInput("", 128, 592, 81, 26) ; hier soll die ges. Bücheranzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label27 = GUICtrlCreateLabel("Ges. Seitenzahl:", 270, 596, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input23 = GUICtrlCreateInput(" ", 394, 592, 81, 26) ; hier soll die ges. Seitenzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Label28 = GUICtrlCreateLabel("Ges. Buch NP:", 572, 595, 106, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlCreateInput("", 680, 592, 121, 26) ; hier soll der ges. Bücherwert eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Button20 = GUICtrlCreateButton("Speichern", 991, 592, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    ;  Ausleihbutton
    $Button17 = GUICtrlCreateButton("Ausleihen", 888, 272, 227, 25)
    ; DK 1 / 2 / 3
    $Button18 = GUICtrlCreateButton("DK  1 / 2 / 3", 894, 334, 99, 26)
    ; D 1 / 2
    $Button19 = GUICtrlCreateButton("D 1 / 2", 1012, 334, 99, 25)
    ; GUI anzeigen
    GUISetState(@SW_SHOW)
    ;  !!! Datei lösche ich hier nur, damit ich sie nicht manuell löschen muss in der Übungsphase !!!
    FileDelete(@ScriptDir & "\buchverwaltung.db")
    ; DLL Pfad
    _SQLite_Startup(@ScriptDir & "\sqlite3.dll", False, 1) ; BugFix Idee, da DLL ja nicht mehr mitgeliefert wird
    ; gibt die SQL Version in die Console aus
    ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
    ; Datenbank öffnen, ggf. erstellen
    Global $g_db_Database = _SQLite_Open(@ScriptDir & "\buchverwaltung.db")
    ; Datenbanktabelle
    _SQLite_Exec($g_db_Database, "CREATE TABLE IF NOT EXISTS Buchverwaltung(ID INTEGER PRIMARY KEY AUTOINCREMENT,Titel,Autor,Verlag,Erscheinungsdatum,Genre,Preis,Einband,ISBN,Seiten,Lagerplatz,Serie,Bestellt,Gelesen,Note,Zusatz,Information,Ausgeliehen_an,Ausgeliehen_am,Ausgeliehen_bis,LfdNr);")
    ; jeweils ein Datensatz wird dazu geschrieben, Daten sind von Enno Jüders zur Verfügung gestellt.
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'13 Tage','Giambanco, Valentina','Droemer Knaur','2014.03.03','Thriller','14.99','Hardcover','9783426513996','576','R1-F2','','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Abgründe','Strobel, Arno','Loewe','2014.03.10','Thriller-J','9.95','Taschenbuch','9783785578643','240','R1-F2','','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Agent 6','Smith, Tom Rob','Goldmann','2011.09.14','Thriller','9.99','Taschenbuch','9783442546770','540','R1-F2','Leo Demidow Bd.3','','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bedroht','Koppen, Hans','Heyne','2013.03.27','Thriller','14.99','Taschenbuch','9783453268012','411','R1-F2','','','J','1','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Belladonna','Slaughter, Karin','rororo','2003.03.03','Thriller','6.00','Taschenbuch','9783499239140','413','R1-F1','Grant County Bd.1','','J','1','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bis zum letzten Atemzug','Baldacci, David','Bastei Lübbe','2011.04.01','Thriller','9.99','Taschenbuch','9783404165537','574','R1-F2','King & Maxwell Bd. 4','austauschen','N','','','','','..','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL,'Bittere Wunden','Slaughter, Karin','blanvalet','2014.09.01','Thriller','19.99','Hardcover','9783764505172','576','R1-F1','Georgia Bd.4','','J','2','','','','..','..','..');")
    
    
    _ListViewFill()
    
    
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case -3
    			_Exit() ;###
    		Case $listview
    			_GUICtrlListView_SortItems($listview, GUICtrlGetState($listview)) ; hier wird das Listview sortiert
    		Case $Button20 ; Speichern
    			_DsInset()
    	EndSwitch
    WEnd
    
    
    
    
    Func _Exit() ; Datenbank schließen und down.
    	_GUICtrlListView_UnRegisterSortCallBack($listview)
    	_SQLite_Close($g_db_Database)
    	_SQLite_Shutdown()
    	Exit
    EndFunc   ;==>_Exit
    
    
    ; Datensatz von GUI2DB
    Func _DsInset()
    	Local $aworte
    	$inputs1 = GUICtrlRead($Input1)      ; Titel
    	$inputs2 = GUICtrlRead($Input2)      ; Autor
    	$inputs3 = GUICtrlRead($Input3)      ; Verlag
    	$inputs4 = GUICtrlRead($Input4)      ; Genre
    	$inputs5 = GUICtrlRead($Input5)      ; Erscheinungsjahr
    	$inputs6 = GUICtrlRead($Input6)      ; Serie
    	$inputs7 = GUICtrlRead($Input7)      ; Preis
    	$inputs8 = GUICtrlRead($Input8)      ; Lagerplatz
    	$inputs9 = GUICtrlRead($Input9)      ; Einband
    	$inputs10 = GUICtrlRead($Input10) ;  ISBN
    	$inputs11 = GUICtrlRead($Input11) ; Seiten
    	$inputs12 = GUICtrlRead($Input12) ;  Ausgeliehen an  
    	$inputs13 = GUICtrlRead($Input13) ; Ausgeliehen am
    	$inputs14 = GUICtrlRead($Input14) ; Ausgeliehen bis
    	$inputs15 = GUICtrlRead($Input15) ; Bestellt: J/N
    	$edits1 = GUICtrlRead($Edit1)          ; Information
    	$inputs16 = GUICtrlRead($Input16) ; Gelesen
    	$inputs17 = GUICtrlRead($Input17) ; Note 1-6; und 0 0 nicht gelesen
    	$inputs18 = GUICtrlRead($Input18) ; Zusatz
    	$inputs20 = GUICtrlRead($Input20) ; Lfd.-Nr.
    ;~ 		NULL (sprich nall)- ID, Tabelle Buchverwaltung
    	_SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES(NULL, '" & $inputs1 & "','" & $inputs2 & "','" & $inputs3 & "','" & $inputs5 & "','" & $inputs4 & "','" & $inputs7 & "','" & $inputs9 & "','" & $inputs10 & "','" & $inputs11 & "','" & $inputs8 & "','" & $inputs6 & "','" & $inputs15 & "','" & $inputs16 & "','" & $inputs17 & "','" & $inputs18 & "','" & $edits1 & "','" & $inputs12 & "','" & $inputs13 & "','" & $inputs14 & "','" & $inputs20 & "');")
    	_ListViewFill()
    EndFunc   ;==>_DsInset
    
    
    
    
    Func _ListViewFill()
    	_GUICtrlListView_DeleteAllItems($listview)
    	_SQLite_Query(-1, "SELECT ROWID,* FROM Buchverwaltung;", $hQuery)
    	While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK ; Read Out the next Row
    		GUICtrlCreateListViewItem(_ArrayToString($aRow, '|', 1, 21), $listview)
    	WEnd
    	_SQLite_QueryFinalize($hQuery)
    	_GUICtrlListView_RegisterSortCallBack($listview) ; CallBack registrieren zum sortieren
    EndFunc   ;==>_ListViewFill
    Alles anzeigen

    Nun muss "nurnoch" ein UPDATE und ein DELETE für die Datensatz bearbeitung bzw. -löschung gescriptet werden. Danach dann alle Bücher eingeben odr ich mache eine Importfunktion.

  • (gelöst bis hierhin) Datenausgabe in ein ListView "DB-2-ListView"

    • Alina
    • 12. Dezember 2015 um 15:35

    Moin Moin ihr beiden.

    Ich werde erst einmal mit dem von RR weiter arbeiten, wobei ich das andere im Auge behalten werde. Mehr dazu steht ja oben.

    Danke Euch beiden erst einmal und ich bleibe am Ball. Dieses Wochenende mal sehen wie weit ich komme. Bischen möchte ich ja auch bei dem Wetter auf der Strandanlage spazieren gehen. Solange es nicht regnet und nur gut windig ist, stört es mich nicht. Ich bin ein Küstenkind. ;)

  • Polizei: Ihr Kind lernt programmieren? Es könnte kriminell sein!

    • Alina
    • 12. Dezember 2015 um 14:17

    Andy?
    Kann man auf Deinem Router nicht einstellen, wer rein darf und wer nicht? Gibt doch die Einstellung, wo die MAC gefiltert wird. Okay, bei nden Kids heute sicherlich auch keine Hürde, aber so bist Du doch auf der sichereren Seite.

  • Grias eich

    • Alina
    • 12. Dezember 2015 um 03:51

    Kanashius: selbst ist der Mann.

  • Werte aus SQLite in eine ListView Tabelle integrieren

    • Alina
    • 12. Dezember 2015 um 03:48

    Sorry orphi. Frau ist müde gewesen. ;)

  • Überwachen wann neue bestimmt Seite im Internet Explorer aufgerufen wird

    • Alina
    • 11. Dezember 2015 um 16:40

    Du schreibst doch: "Mein Skript erkennt es". Was ist dieses ES denn??? Wie soll ich mir dieses ES vorstellen? Bin ich zu doof das zu verstehen? Woher weißt Du, das Dein Script etwas, nämlich dieses uminöse ES, erkennt?

  • Überwachen wann neue bestimmt Seite im Internet Explorer aufgerufen wird

    • Alina
    • 11. Dezember 2015 um 16:23

    Was erkennt Dein Script? Wie sieht dieses aus was erkannt wird? Ist es eine Textdatei oder *.log?

    ANGENOMMEN es ist eine Textdatei und ANGENOMMEN jeder Eintrag in ANGENOMMEN es ist eine Logdatei.txt oder *.log, ein Eintrag mit einem Datum, dann könntest Du immer das Datum vom letzten Eintrag überprüfen und darauf reagieren, also wie in Deinem Fall ein anderes Programm starten.

    Aber das ist nun mal: :Glaskugel: und X-Mas-Gedanken :weih:

  • Grias eich

    • Alina
    • 11. Dezember 2015 um 16:16

    @peter, bei Lidl gibt es Pizza im Angebot. 3 Stück und brauchst nur holen und in Ofen schieben.

  • (gelöst bis hierhin) Datenausgabe in ein ListView "DB-2-ListView"

    • Alina
    • 11. Dezember 2015 um 16:11

    Fehler habe ich soweit ich konnte nun beseitigt. Ergebnis ist aber niocht das er einen Datzsatz nun speichert. :(

    AutoIt
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <SQLite.au3>
    #include <SQLite.dll.au3>
    #include <GuiListView.au3>
    ;Opt
    Opt("GUIOnEventMode", 0) ; Du benutzt den MsgLoop-Modus also muss hier "0" stehen oder die Zeile gleich ganz weglassen, weil "0" der Standardwert ist
    
    
    ;GUI Titel
    $Buchverwaltung = GUICreate("Buchverwaltung erstellt mit AutoIt", 1121, 629, 280, 183)
    
    
    ; Titel oben Mitte
    $Label1 = GUICtrlCreateLabel("~  ~  ~  B  U  C  H  V  E  R  W  A  L  T  U  N  G   ~  ~  ~", 304, 8, 516, 28)
    GUICtrlSetFont(-1, 16, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x0000FF)
    
    
    ; ListView
    $listview = GUICtrlCreateListView("ID |Titel|Autor|Verlag|Erscheinungsdatum|Genre|Preis|Einband|ISBN|Seiten|Lagerplatz|Serie|Bestellt|Gelesen|Note|Zusatz|Information|Ausgeliehen_an|Ausgeliehen_am|Ausgeliehen_bis", 10,40,1105,168)
    
    
     $List1 = GUICtrlCreateList("", 8, 40, 1105, 168)
    ;~ GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    
    
    ; Hauptbereich
    $Label2 = GUICtrlCreateLabel("Titel:  ", 10, 274, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input1 = GUICtrlCreateInput("", 160, 272, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label3 = GUICtrlCreateLabel("Autor:", 10, 305, 45, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input2 = GUICtrlCreateInput("", 160, 302, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label4 = GUICtrlCreateLabel("Verlag: ", 10, 335, 58, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input3 = GUICtrlCreateInput("", 160, 332, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label5 = GUICtrlCreateLabel("Genre: ", 10, 365, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input4 = GUICtrlCreateInput("", 160, 362, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label6 = GUICtrlCreateLabel("Erscheinungsdatum: ", 10, 395, 149, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input5 = GUICtrlCreateInput("YYYYMMDD", 160, 392, 100, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label7 = GUICtrlCreateLabel("Serie: ", 267, 395, 50, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input6 = GUICtrlCreateInput("", 313, 392, 208, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label8 = GUICtrlCreateLabel("Preis: ", 10, 424, 146, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input7 = GUICtrlCreateInput("", 160, 422, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label9 = GUICtrlCreateLabel("Lagerplatz: ", 267, 424, 85, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input8 = GUICtrlCreateInput("", 354, 422, 165, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label10 = GUICtrlCreateLabel("Einband: ", 10, 455, 70, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input9 = GUICtrlCreateInput("", 160, 452, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label11 = GUICtrlCreateLabel("ISBN", 10, 485, 40, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input10 = GUICtrlCreateInput("", 160, 482, 361, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label12 = GUICtrlCreateLabel("Seiten: ", 10, 514, 57, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input11 = GUICtrlCreateInput("", 160, 512, 81, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label13 = GUICtrlCreateLabel("ausgeliehen an: ", 624, 272, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input12 = GUICtrlCreateInput("", 760, 272, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label14 = GUICtrlCreateLabel("ausgeliehen am: ", 624, 302, 122, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input13 = GUICtrlCreateInput("", 760, 302, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label15 = GUICtrlCreateLabel("ausgeliehen bis: ", 624, 332, 121, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input14 = GUICtrlCreateInput("", 760, 334, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label16 = GUICtrlCreateLabel("Bestellt: J/N", 624, 384, 86, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input15 = GUICtrlCreateInput("", 760, 384, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label17 = GUICtrlCreateLabel("gelesen: J/N", 624, 414, 90, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input16 = GUICtrlCreateInput("", 760, 414, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label18 = GUICtrlCreateLabel("Note: 1 - 6", 624, 444, 76, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input17 = GUICtrlCreateInput("", 760, 444, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label19 = GUICtrlCreateLabel("Zusatz:", 624, 474, 53, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input18 = GUICtrlCreateInput("", 760, 472, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label20 = GUICtrlCreateLabel("Information:", 896, 384, 84, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Edit1 = GUICtrlCreateEdit("", 896, 408, 217, 89)
    
    
    $Label22 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 8, 256, 1105, 17)
    $Label23 = GUICtrlCreateLabel("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", 8, 544, 1105, 17)
    
    
    $Button16 = GUICtrlCreateButton("S U C H E N", 621, 509, 132, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Input19 = GUICtrlCreateInput("Suchbegriff hier eingeben", 760, 507, 347, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label24 = GUICtrlCreateLabel("Lfd.-Nr:", 350, 515, 55, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input20 = GUICtrlCreateInput("", 415, 512, 105, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlSetData(-1, "000002")
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    
    
    ; unterer Bereich
    $Label26 = GUICtrlCreateLabel("Büchermenge:  ", 13, 595, 113, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input22 = GUICtrlCreateInput("", 128, 592, 81, 26) ; hier soll die ges. Bücheranzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label27 = GUICtrlCreateLabel("Ges. Seitenzahl:", 270, 596, 117, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Input23 = GUICtrlCreateInput(" ", 394, 592, 81, 26) ; hier soll die ges. Seitenzahl eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    
    
    $Label28 = GUICtrlCreateLabel("Ges. Buch NP:", 572, 595, 106, 22)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    GUICtrlCreateInput("", 680, 592, 121, 26) ; hier soll der ges. Bücherwert eingefügt werden und nicht veränderbar durch Anwender
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    $Button20 = GUICtrlCreateButton("Speichern", 991, 592, 121, 26)
    GUICtrlSetFont(-1, 12, 400, 0, "Arial")
    ;  Ausleihbutton
    $Button17 = GUICtrlCreateButton("Ausleihen", 888, 272, 227, 25)
    
    
    ; DK 1 / 2 / 3
    $Button18 = GUICtrlCreateButton("DK  1 / 2 / 3", 894, 334, 99, 26)
    ; D 1 / 2
    $Button19 = GUICtrlCreateButton("D 1 / 2", 1012, 334, 99, 25)
    
    
    ; GUI anzeigen
    GUISetState(@SW_SHOW)
    
    
    ;  !!! Datei lösche ich hier nur, damit ich sie nicht manuell löschen muss in der Übungsphase !!!
    ; FileDelete(@ScriptDir & "\buchverwaltung.db")
    
    
    ; DLL Pfad
    _SQLite_Startup(@ScriptDir & "\sqlite3.dll", False, 1) ; BugFix Idee, da DLL ja nicht mehr mitgeliefert wird
    
    
    ; gibt die SQL Version in die Console aus
    ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
    
    
    ; Datenbank öffnen, ggf. erstellen
    Global $g_db_Database = _SQLite_Open(@ScriptDir & "\buchverwaltung.db")
    
    
    ; Datenbanktabelle
    _SQLite_Exec($g_db_Database, "CREATE TABLE IF NOT EXISTS Buchverwaltung(ID INTEGER PRIMARY KEY AUTOINCREMENT,Titel,Autor,Verlag,Erscheinungsdatum,Genre,Preis,Einband,ISBN,Seiten,Lagerplatz, Serie,Bestellt,Gelesen,Note,Zusatz,Information,Ausgeliehen_an,Ausgeliehen_am,Ausgeliehen_bis);")
    
    
    #cs
    ; jeweils ein Datensatz wird dazu geschrieben, Daten sind von Enno Jüders zur Verfügung gestellt.
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('1','13 Tage','Giambanco, Valentina','Droemer Knaur','2014.03.03','Thriller','14.99','Hardcover','9783426513996','576','R1-F2','','','N','','','','','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('2','Abgründe','Strobel, Arno','Loewe','2014.03.10','Thriller-J','9.95','Taschenbuch','9783785578643','240','R1-F2','','','N','','','','','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('3','Agent 6','Smith, Tom Rob','Goldmann','2011.09.14','Thriller','9.99','Taschenbuch','9783442546770','540','R1-F2','Leo Demidow Bd.3','','N','','','','','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('4','Bedroht','Koppen, Hans','Heyne','2013.03.27','Thriller','14.99','Taschenbuch','9783453268012','411','R1-F2','','','J','1','','','','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('5','Belladonna','Slaughter, Karin','rororo','2003.03.03','Thriller','6.00','Taschenbuch','9783499239140','413','R1-F1','Grant County Bd.1','','J','1','','','','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('6','Bis zum letzten Atemzug','Baldacci, David','Bastei Lübbe','2011.04.01','Thriller','9.99','Taschenbuch','9783404165537','574','R1-F2','King & Maxwell Bd. 4','austauschen','N','','','','','..','..');")
    _SQLite_Exec(-1, "INSERT INTO Buchverwaltung VALUES('7','Bittere Wunden','Slaughter, Karin','blanvalet','2014.09.01','Thriller','19.99','Hardcover','9783764505172','576','R1-F1','Georgia Bd.4','','J','2','','','','..','..');")
    #ce
    
    
    
    
    Global $hQuery, $aNames, $aRow
    _SQLite_Query(-1, "SELECT ROWID,* FROM Buchverwaltung;", $hQuery)
    While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK ; Read Out the next Row
    	GUICtrlCreateListViewItem(_ArrayToString($aRow, '|', 1, 17), $listview)
    WEnd
    _SQLite_QueryFinalize($hQuery)
    _GUICtrlListView_RegisterSortCallBack($listview) ; CallBack registrieren zum sortieren
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case $GUI_EVENT_CLOSE
    			Exit
    		Case $listview
    			_GUICtrlListView_SortItems($listview, GUICtrlGetState($listview)) ; hier wird das Listview sortiert
    		Case $Button20
    			$ID =_SQLite_TotalChanges()
    			_ds_plus($id)
    	EndSwitch
    WEnd
    
    
    Func _Exit() ; Datenbank schließen und down.
    	_GUICtrlListView_UnRegisterSortCallBack($listview)
    	_SQLite_Close($g_db_Database)
    	_SQLite_Shutdown()
    EndFunc
    
    
    
    
    ; Datensatz von GUI2DB
    Func _ds_plus($id)
    	Local $aworte
    	$inputs1 = GUICtrlRead($Input1) ; Titel
    	$inputs2 = GUICtrlRead($Input2) ; Autor
    	$inputs3 = GUICtrlRead($Input3) ; Verlag
    	$inputs5 = GUICtrlRead($Input5) ; Erscheinungsdatum
    	$inputs4 = GUICtrlRead($Input4) ; Genre
    	$inputs7 = GUICtrlRead($Input7) ; Preis
    	$inputs9 = GUICtrlRead($Input9) ; Einband
    	$inputs10 = GUICtrlRead($Input10) ; ISBN
    	$inputs11 = GUICtrlRead($Input11) ; Seiten
    	$inputs8= GUICtrlRead($Input8) ; Lagerplatz
    	$inputs6 = GUICtrlRead($Input6) ; Serie
    	$inputs15 = GUICtrlRead($Input15) ; Bestellt
    	$inputs16 = GUICtrlRead($Input16) ; Gelesen
    	$inputs17 = GUICtrlRead($Input17) ; Note
    	$inputs18 = GUICtrlRead($Input18) ; Zusatz
    	$edits1 = GUICtrlRead($Edit1) ; Information  <------- ???
    	$inputs12 = GUICtrlRead($Input12) ; Ausgeliehen_an
    	$inputs13 = GUICtrlRead($Input13) ; Ausgeliehen_am
    	$inputs14 = GUICtrlRead($Input14) ; Ausgeliehen_bis
    
    
    _SQLite_QuerySingleRow(-1,"SELECT id FROM Buchverwaltung WHERE id='"&$id&"'",$aworte)
    	If $aworte[0] <> "" Then
    		_SQLite_Exec(-1,"UPDATE datas SET Titel='"&$inputs1&"', Autor='"&$inputs2&"',Verlag='"&$inputs3&"', Erscheinungsdatum='"&$inputs5&"', Genre='"&$inputs4&"',Preis='"&$inputs7&"',Einband='"&$inputs9&"',ISBN='"&$inputs10&"',Seiten='"&$inputs11&"',Lagerplatz='"&$inputs8&"',Serie='"&$inputs6&"',Bestellt='"&$inputs15&"',Gelesen='"&$inputs16&"',Note='"&$inputs17&"',Zusatz='"&$inputs18&"',	Information='"&$edits1&"',Ausgeliehen_an='"&$inputs12&"',Ausgeliehen_am='"&$inputs13&"',Ausgeliehen_bis='"&$inputs14&"' WHERE id='"&$id&"'")
    	Else
    		_SQLite_Exec(-1,"INSERT INTO datas (ID,Titel,Autor,Verlag,Erscheinungsdatum,Genre,Preis,Einband,ISBN,Seiten,Lagerplatz,Serie,Bestellt,Gelesen,Note,Zusatz,Information,Ausgeliehen_an,Ausgeliehen_am,Ausgeliehen_bis) VALUES ('"&$id&"','"&$inputs1&"','"&$inputs2&"','"&$inputs3&"','"&$inputs4&"','"&$inputs5&"','"&$inputs4&"','"&$inputs7&"','"&$inputs9&"','"&$inputs10&"','"&$inputs11&"','"&$inputs8&"','"&$inputs6&"','"&$inputs15&"','"&$inputs16&"','"&$inputs17&"','"&$inputs18&"','"&$edits1&"','"&$inputs12&"','"&$inputs13&"','"&$inputs14&"');")
    	EndIf
    	_GUICtrlListView_SortItems($listview, GUICtrlGetState($listview))
    EndFunc
    Alles anzeigen

    Kanashius: Das werde ich auf meine "Ändernliste" stellen. Danke. Aber immer erst eines. Wenn ich alles am Laufen habe wird reduziert, aber erst einmal muss ich durchblicken und daran hapert es noch. :( Button 20 halt.

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™