Autor Beitrag
Cube85
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50



BeitragVerfasst: So 19.06.05 16:44 
Hy Leute! ist wirklich dringend, hab ein Problem:

Ich arbeite mit Delphi und einer MySQL-Datenbank.
Auf dem Delphiformular benutze ich einen DateTimePicker, um ein bestimmtes Datum und eine Zeit festzulegen.
Wenn ich nun diese DateTime in die MySQL-Datenbank speichern will mach ich das so:

Ich nehme meine Query, lege den SQL-Text fest UPDATE ... SET ... WHERE ...
und muss dort bei meinem Timestamp-Feld die DateTime des Pickers reinbekommen!
Hab mir ne eigene Funktion geschrieben, die das DateTime in eine Art Timestamp-STRING umwandelt, sodas ich ihn in den SQL-Text schreiben kann, funktioniert aber nicht !!! Wie kann ich die Datetime in ein Timestamp-feld speichern ? Is sehr wichtig und dringend !!! Plz helft mir !
Stevie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 85

Windows 7
Delphi XE Professional
BeitragVerfasst: Mo 20.06.05 12:20 
Hi,

du kannst das folgendermaßen machen (ich habs mit Zeos probiert, müsste aber mit anderen Kompos analog gehen):
ausblenden Delphi-Quelltext
1:
2:
3:
Query.SQL.Text := 'UPDATE MyTable SET MyTimeStamp = :MyTimeStamp WHERE ...';
Query.ParamByName('MyTimeStamp').Value := MyDateTimePicker.DateTime;
Query.ExecSQL;

MfG
Stevie

_________________
“Simplicity, carried to the extreme, becomes elegance.” Jon Franklin
Cube85 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50



BeitragVerfasst: Mi 20.07.05 15:01 
Danke habs hinbekommen !