[ Is it possible to use "Alter Table Add column....." on run time ] lazarus / 16-Databases ---------------------------------------------------------------------- bleung · 2013-02-22 15:56 I am working on a project, which uses Lazarus with MS Access thru ODBC.  I need to alter the table for adding columns (number of columns adding will be depending on the number of rule files existing) at the run time.  I have tried to use "Alter table add column......." for doing that; but I got the error as ".....Cannot open a non-select statement....". I have searched many website but cannot really find the details of the usage for the SQL command "Alter Table...Add Column....".  I have doubt that can I use "Alter Table ... Add Column..." SQL command while the RUN TIME? Thanks Lazarus 1.0.6, fpc 2.6.0, Win 7 64bit ---------------------------------------------------------------------- paweld · 2013-02-22 16:20 Use TSQLScript ---------------------------------------------------------------------- BigChimp · 2013-02-23 07:30 Good suggestion by pawel. Another thing: you are probably opening the query with the alter table statement. Don't. Execute it (ExecSQL method), see. e.g. http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery#General Also/for background, see the new FPC 2.6.2 documentation on sqldb http://sourceforge.net/projects/freepascal/files/Documentation/2.6.2/d oc-pdf.zip/download