Page 1 of 1

database record problem for delphi 7

Posted: 05.05.2007, 10:29
by capella
my problem is database record problem , query is running but record is not running program compiled then program is opening but when I click the record button Program give me error this error

Image

I am using mysql 4.1
how can I solve my problem?? Please help me...

Posted: 05.05.2007, 21:45
by mdaems
Can you tell us more about the query that is failing? This is a query syntax error. So did Zeoslib itself generate the wrong query or have you written the query yourself in the query component's sql property?

First thing you could do is writing a log of what's actually sent to the server by dropping a ZSqlMonitor component in your form and logging all data to a file. Just specify a filename, set autosave and active to true and that should do the trick. Then you can try to find out why mysql doesn't accept the query sent. Forgot some quotes? Bad function used? ...

Mark

Posted: 07.05.2007, 13:19
by capella
you are to be right....
error page name is zdbcmysqlutils..this page has got many writing ...these are

}
procedure CheckMySQLError(PlainDriver: IZMySQLPlainDriver;
Handle: PZMySQLConnect; LogCategory: TZLoggingCategory; LogMessage: string);
var
ErrorMessage: string;
ErrorCode: Integer;
begin
ErrorMessage := Trim(StrPas(PlainDriver.GetLastError(Handle)));
ErrorCode := PlainDriver.GetLastErrorCode(Handle);
if (ErrorCode <> 0) and (ErrorMessage <> '') then
begin
DriverManager.LogError(LogCategory, PlainDriver.GetProtocol, LogMessage,
ErrorCode, ErrorMessage);
raise EZSQLException.CreateWithCode(ErrorCode,
Format(SSQLError1, [ErrorMessage]));
end;
end;

end

Posted: 08.05.2007, 00:53
by mdaems
Yes, That's where your program stops.
I wanted to know what's sent to the server, however. That's why yu have to make a trace using the TZSQLMonitor component.

Mark

Posted: 10.05.2007, 07:06
by zippo
What's the exact SQL sentence that you are trying to execute?