SQLite table insert, edit problem
SQLite table insert, edit problem
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)
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)
Hello,
I cannot reproduce the problem.
Please try to execute the following code:
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.
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.
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;
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;
SQLite table insert, edit problem
Now I have notified, that the dot character in the table name causes the problem