Thanks a lot, its works
On 26 Sep 2014 19:09, "Rik van Kekem" <[email protected]> wrote:
> Izac Kruger wrote:
>
>> if I clicked on the second button who is to
>> removed all the data on the fields, then after refield again the
>> information and clicked on the INSERT button, I received a funny
>> message: SQLQeuryLite: Cannot open a non-select statement.
>>
> ...
>
> else begin
>> //DB connections.
>> if DataModuleConn.SQLTransSQLite.Active=False then
>> begin
>> DataModuleConn.SQLite3Conn.Connected:=True;
>> DataModuleConn.SQLTransSQLite.Active:=True;
>> DataModuleConn.SQLQuerySQLite.Active:=True;
>>
>> DataModuleConn.SQLQuerySQLite.SQL.Text:='INSERT INTO
>> loginConnection (hostname, hostip, dbname, username, password) VALUES ('
>> +':getHOSTNAME,
>>
> You have a line DataModuleConn.SQLQuerySQLite.Active:=True;
> Why?
> This is usually for opening a dataset with a SELECT-statement.
> If your SQL is still the INSERT-statement from the previous insert an
> Active:=True will give you that error.
>
> Actually you should make sure the SQLQuerySQLite is NOT active before
> changing the SQL.Text. So if you change that line as follows it should work:
> DataModuleConn.SQLQuerySQLite.Active:=False;
> // ^-- always make sure Active is false before setting SQL.Text
>
>
> --
> _______________________________________________
> Lazarus mailing list
> [email protected]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus