Registriert seit: 6. Nov 2009
493 Beiträge
FreePascal / Lazarus
|
AW: Aktuelles Datum in die DB speichern?
28. Feb 2013, 16:32
Meinst du das geht irgendwie nicht anders?
Arbeite inzwischen mit Params, aber das hilft auch nicht.
Delphi-Quellcode:
// Tabelle media füllen
sSQL := ' INSERT INTO media(mediatitle, description, status, isbn, edition, publicationyear, insertdate,';
sSQL := sSQL + ' fk_publisher_id, fk_place_id, fk_category_id, fk_language_id,';
sSQL := sSQL + ' fk_author_id, fk_entleiher_id) VALUES (:mediatitle, :description, :status, :isbn, :edition, :publicationyear, :insertdate, :fk_publisher_id, :fk_place_id, :fk_category_id, :fk_language_id, :fk_author_id, :fk_entleiher_id);';
db.AddParamText(' :mediatitle', TitleEdit.Text);
db.AddParamText(' :description', DescriptionMemo.Text);
db.AddParamInt(' :status', status);
db.AddParamText(' :isbn', ISBNEdit.Text);
db.AddParamInt(' :edition', varedition);
db.AddParamInt(' :publicationyear', varpublicationyear);
db.AddParamText(' :insertdate', Date("now")); // <--- hier immer noch der Fehler
db.AddParamInt(' :fk_publisher_id', Integer(PublisherComboBox.Items.Objects[PublisherComboBox.ItemIndex]));
db.AddParamInt(' :fk_place_id', Integer(PlaceComboBox.Items.Objects[PlaceComboBox.ItemIndex]));
db.AddParamInt(' :fk_category_id', Integer(CategoryComboBox.Items.Objects[CategoryComboBox.ItemIndex]));
db.AddParamInt(' :fk_language_id', Integer(LanguageComboBox.Items.Objects[LanguageComboBox.ItemIndex]));
db.AddParamInt(' :fk_author_id', Integer(AuthorComboBox.Items.Objects[AuthorComboBox.ItemIndex]));
db.AddParamInt(' :fk_entleiher_id', Integer(EntleiherComboBox.Items.Objects[EntleiherComboBox.ItemIndex]));
|
|
Zitat
|