TSQLQuery.SQL.Text Lost lazarus / 16-Databases ---------------------------------------------------------------------- MainMeat · 2008-10-30 12:21 Hi everyone, I have a problem (for the first time) executing a query on a MySQL database. Basically, I have the following simple code: //...... MySQLConn.HostName := '127.0.0.1'; MySQLConn.UserName := 'root'; MySQLConn.Password := ''; MySQLConn.DatabaseName := 'mysql'; MySQL.Transaction := sqlTrans; sqlTrans.Database := MySQLConn; sqlQuery.Database := MySQLConn; sqlQuery.Transaction := sqlTrans; MySQL.open // <--- Successfull sqlQuery.SQL.Text := 'show databases'; Writeln(sqlQuery.SQL.Text) // <--- Text displayed, but seems to have a extra line when writing values to the screen, or at end sqlQuery.Open; // <--- exception, see below //...... Error Executing Query: You have and error in you SQL syntax: check the manual that corresponds to your MYSQL server version for the right syntax to use near '' at line 1 Other queries that is executed using the SQL.ExecSQL also does not execute. Any idea what I am doing wrong. I am currently using FPC 2.2.0 and Lazarus 0.9.24. Could this be related to the libmysql file being used? Thanks for any advice! ---------------------------------------------------------------------- MainMeat · 2008-10-31 04:49 I have done some more testing in Windows using FPC 2.2.2 and Lazarus 0.9.26, and this code executes without an issue. Seems the problem is in Linux and I will install the latest versions of Lazarus on a Linux Platform and see if this resolves this issue. Will keep everyone updated once resolved...