Einzelnen Beitrag anzeigen

OrNEC

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

AW: Bilder in die DB speichern?

  Alt 1. Mär 2013, 20:49
Ich hab ja meine Methode wo ich nicht weiß wie ich ein FileStream übergebe. sSQL ist ein String.

Delphi-Quellcode:
    // Tabelle media füllen
    sSQL := 'INSERT INTO media(medianr, mediatitle, description, status, isbn, publicationyear, insertdate, movedatetime, picture, ';
    sSQL := sSQL + 'fk_publisher_id, fk_place_id, fk_category_id, fk_language_id,';
    sSQL := sSQL + 'fk_author_id, fk_entleiher_id, edition) VALUES ("'+ IntToStr(varmedianr) +'",';
    sSQL := sSQL + '"'+ TitleEdit.Text +'",';
    sSQL := sSQL + '"'+ DescriptionMemo.Text +'",';
    sSQL := sSQL + '"'+ IntToStr(varstatus) +'",';
    sSQL := sSQL + '"'+ ISBNEdit.Text +'",';
    sSQL := sSQL + '"'+ PublicationyearEdit.Text +'",';
    sSQL := sSQL + '"'+ FormatDateTime('dd.mm.yyyy', Now) +'",';
    sSQL := sSQL + '"'+ varmovedatetime +'",';
    sSQL := sSQL + '"'+ fs +'",'; // <---- hier muss FileStream rein, aber wie?
    sSQL := sSQL + '"'+ IntToStr(Integer(PublisherComboBox.Items.Objects[PublisherComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(PlaceComboBox.Items.Objects[PlaceComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(CategoryComboBox.Items.Objects[CategoryComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(LanguageComboBox.Items.Objects[LanguageComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(AuthorComboBox.Items.Objects[AuthorComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ IntToStr(Integer(EntleiherComboBox.Items.Objects[EntleiherComboBox.ItemIndex])) +'",';
    sSQL := sSQL + '"'+ EditionEdit.Text +'");';
  Mit Zitat antworten Zitat