AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi TmysqlQuery

Ein Thema von question · begonnen am 3. Sep 2013 · letzter Beitrag vom 5. Sep 2013
Antwort Antwort
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 08:43
I have tried as you suggested even i have also tried by changing the name of the date field
Code:
insert into TableAdd
  (`Name`, `Address`, `Phone`, `Emial`, `Date`)
values
  (:Name, :Address, :Phone, :Emial, :Date)
but still have the same error, by the way,how can i check System.DateTime value and MySql.Data.Types.MySqlDate, maybe the datetime of the system and the mysqlDate is not matching, its just my idea,what do you think?
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.656 Beiträge
 
Delphi 12 Athens
 
#2

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 08:49
SQL-Parameters are usually parsed automatically. Maybe your field is a timestamp instead of a Date/DateTime? It is hard to find a solution when you don' t know either the table structure nor the Delphi-code used to execute your queries.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#3

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 09:08
the field 'Date' is a DateTime field,
  Mit Zitat antworten Zitat
Lemmy

Registriert seit: 8. Jun 2002
Ort: Berglen
2.395 Beiträge
 
Delphi 10.4 Sydney
 
#4

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 09:19
Hi,

please try this one:

  xxx.ParamByName('Date').AsString := FormatDateTim('yyyy-mm-dd', YourDateValue);
cu
  Mit Zitat antworten Zitat
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#5

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 09:36
the querystring is done by using dfm with field and parameter
how can i use
Code:
xxx.ParamByName('Date').AsString := FormatDateTim('yyyy-mm-dd', YourDateValue);
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.656 Beiträge
 
Delphi 12 Athens
 
#6

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 09:37
You have to fill the parameters with values before you execute your statement. Didn' t you do this?
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Benutzerbild von baumina
baumina

Registriert seit: 5. Mai 2008
Ort: Oberschwaben
1.275 Beiträge
 
Delphi 11 Alexandria
 
#7

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 09:43
Please check while debugging Tmysqlquery.Text. This is the SQL statement passed to MySQL.
Hinter dir gehts abwärts und vor dir steil bergauf ! (Wolfgang Ambros)
  Mit Zitat antworten Zitat
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#8

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 15:03
Hi,
i have debug the application and i have found that, the system date format is: 2013-09-04(yy-mm-dd) but the database query dateformat shows the: 04-09-2013(dd-mm-yy)
how to make it similar formate?
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.656 Beiträge
 
Delphi 12 Athens
 
#9

AW: Delphi TmysqlQuery

  Alt 4. Sep 2013, 15:14
You can try using FormatDateTime.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:04 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz