Page 1 of 1
SQLite table insert, edit problem
Posted: Mon 18 Jul 2011 14:49
by brzda
Hello,
when a SQLite table is created with quotes ( create table "aaa" (field1 varchar(30) ....... ), there is problem whenever I want edit fields. After post record an error message is shown 'near ".":syntax error '
After change table name to without quotes, all works ok.
Please do you know any solution ? (sorry for bad english)
Posted: Mon 18 Jul 2011 15:24
by AlexP
Hello,
I cannot reproduce the problem.
Please try to execute the following code:
Code: Select all
var
UniConnection: TUniConnection;
UniQuery: TUniQuery;
begin
UniConnection := TUniConnection.Create(nil);
UniConnection.ProviderName := 'SQLite';
UniConnection.Database := ' ';
UniConnection.LoginPrompt := false;
UniConnection.Connect;
UniConnection.ExecSQL('CREATE TABLE IF NOT EXISTS "aaa" (field1 VARCHAR(30)) ',[]);
UniQuery := TUniQuery.Create(nil);
UniQuery.Connection := UniConnection;
UniQuery.SQL.Text := 'Select field1 from "aaa"';// or UniQuery.SQL.Text := 'Select field1 from aaa';
UniQuery.Open;
UniQuery.Append;
UniQuery.FieldByName('field1').AsString := 'test';
UniQuery.Post;
if the problem doesn't arise, please modify the code to reproduce the problem, and send it me.
Also please specify the exact version of UniDAC and SQLite.
Posted: Tue 19 Jul 2011 05:54
by brzda
Hi Alex,
thank you for answer. Please use another table name (see code). I got that table by another application. Although table name is not standard, in sqlite managers it works properly
UniConnection := TUniConnection.Create(nil);
UniConnection.ProviderName := 'SQLite';
UniConnection.Database := ' ';
UniConnection.LoginPrompt := false;
UniConnection.Connect;
UniConnection.ExecSQL('CREATE TABLE IF NOT EXISTS "TCP-IP_6.0" (field1 VARCHAR(30)) ',[]);
UniQuery := TUniQuery.Create(nil);
UniQuery.Connection := UniConnection;
UniQuery.SQL.Text := 'Select field1 from "TCP-IP_6.0"';// or UniQuery.SQL.Text := 'Select field1 from aaa';
UniQuery.Open;
UniQuery.Append;
UniQuery.FieldByName('field1').AsString := 'test';
UniQuery.Post;
Posted: Tue 19 Jul 2011 06:15
by brzda
appendix:
Unidac version 3.60.0.15, sqlite3.dll
SQLite table insert, edit problem
Posted: Tue 19 Jul 2011 06:36
by brzda
Now I have notified, that the dot character in the table name causes the problem
Posted: Tue 19 Jul 2011 06:49
by AlexP
Hello,
Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.
Posted: Tue 19 Jul 2011 11:02
by brzda
thank you
Posted: Wed 07 Sep 2011 13:14
by AlexP
Hello,
We have fixed the problem.
This fix will be included in the next build.
The next build will be available next week.