Einzelnen Beitrag anzeigen

OrNEC

Registriert seit: 6. Nov 2009
493 Beiträge
 
FreePascal / Lazarus
 
#1

Aktuelles Datum in die DB speichern?

  Alt 28. Feb 2013, 12:54
Datenbank: SQLite • Version: 3 • Zugriff über: SimpleDelphi-Wrappers von Tim Anderson
Hallo,

ich versuche schon seit einer Stunde das aktuelle Datum in die DB zu speichern aber es gelingt mir irgendwie nicht. Hier der Code:

Delphi-Quellcode:
    // Tabelle media füllen
    sSQL := 'INSERT INTO media(mediatitle, description, status, isbn, publicationyear, insertdate,';
    sSQL := sSQL + 'fk_place_id, fk_publisher_id, fk_author_id, fk_category_id, fk_language_id, fk_entleiher_id, edition) VALUES ("'+TitleEdit.Text+'",';
    sSQL := sSQL + '"'+ DescriptionMemo.Text +'",';
    sSQL := sSQL + '"'+ IntToStr(status) +'",';
    sSQL := sSQL + '"'+ ISBNEdit.Text +'",';
    sSQL := sSQL + '"'+ PublicationyearEdit.Text +'",';
    sSQL := sSQL + '"'+ Date('now') +'",'; // <---- hier der Fehler
    sSQL := sSQL + '"'+ IntToStr(Integer(PlaceComboBox.Items.Objects[PlaceComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(PublisherComboBox.Items.Objects[PublisherComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(AuthorComboBox.Items.Objects[AuthorComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(CategoryComboBox.Items.Objects[CategoryComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(LanguageComboBox.Items.Objects[LanguageComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(EntleiherComboBox.Items.Objects[EntleiherComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ EditionEdit.Text +'");';
Hab schon das Datum mit DateToStr konvertiert und alles mögliche versucht, aber es will nicht irgendwie. Kann mir da vllt jemand weiter helfen?

Danke!

Edit:
Die Fehlermeldung lautet: [DCC Fehler] NewMediaForm.pas(333): E2034 Zu viele Parameter

Geändert von OrNEC (28. Feb 2013 um 13:00 Uhr)
  Mit Zitat antworten Zitat