SQLite table insert, edit problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
brzda
Posts: 5
Joined: Mon 18 Jul 2011 13:52

SQLite table insert, edit problem

Post by brzda » Mon 18 Jul 2011 14:49

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)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 18 Jul 2011 15:24

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.

brzda
Posts: 5
Joined: Mon 18 Jul 2011 13:52

Post by brzda » Tue 19 Jul 2011 05:54

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;

brzda
Posts: 5
Joined: Mon 18 Jul 2011 13:52

Post by brzda » Tue 19 Jul 2011 06:15

appendix:
Unidac version 3.60.0.15, sqlite3.dll

brzda
Posts: 5
Joined: Mon 18 Jul 2011 13:52

SQLite table insert, edit problem

Post by brzda » Tue 19 Jul 2011 06:36

Now I have notified, that the dot character in the table name causes the problem

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 19 Jul 2011 06:49

Hello,

Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.

brzda
Posts: 5
Joined: Mon 18 Jul 2011 13:52

Post by brzda » Tue 19 Jul 2011 11:02

thank you

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 07 Sep 2011 13:14

Hello,

We have fixed the problem.
This fix will be included in the next build.
The next build will be available next week.

Post Reply