Bug #5395 | MyODBC ver.3.51 bug: #1026 | ||
---|---|---|---|
Submitted: | 3 Sep 2004 18:03 | Modified: | 4 Jun 2005 6:45 |
Reporter: | Andres Sanchez | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 3.51 | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[3 Sep 2004 18:03]
Andres Sanchez
[3 Sep 2004 18:43]
Andres Sanchez
Im sorry, I forgot that Before comment was related to MySQL database and MyODBC connector ver. 3.51 over win Xp
[8 Dec 2004 15:58]
Mathieu Tremblay
You just have to transform the Date into String before posting the query like this var FormatSettings: TFormatSettings; GetLocaleFormatSettings(LOCALE_USER_DEFAULT, FormatSettings); FormatSettings.DateSeparator := '-'; FormatSettings.longDateFormat:='d mmmm yyyy'; Query.Add( 'INSERT INTO FECHAS(NOINS, LASTREAD.DATETIME) VALUES (:ni, :ul)'); with Query do begin params[0].AsString := 'pepito' params[1].AsString := DateTimeToStr(Now - 1, FormatSettings); execSQL; end;
[3 Jun 2005 16:33]
KAZANCI ibrahim
i'm using delphi 5, mysql 4.1.10a i have same similiar error. i'm trying to port my delphi+mssql application to delphi+mysql. i can't send any datetime parameter to any TQuery component in delphi. i'm using delphi 5 and suggested Tformatstring is not defined in this version. i cant solve problem. i used it with other mysql 4 versions. there is no difference. this is an example: qryMesaj.Close; qryMesaj.SQL.Clear; qryMesaj.SQL.Add('SELECT * FROM Messages'); qryMesaj.SQL.Add('WHERE Date <=:QDate'); qryMesaj.ParamByName('QDate').AsDateTime := Date; //--> error here qryMesaj.Open; same query working good with mssql. i'm reading about myodbc & datetime parameter problem on forums a lot but there is not a real solution.