[SOLVED] Sqldb viewing my views lazarus / 31-LCL ---------------------------------------------------------------------- goldenfox · 2012-04-25 03:12 Hi folks. using the following select statements using SqlDb in SQLite3 Quotequery.SQL.Text := 'SELECT * FROM MyCustomView';Quotequery.SQL.Text := 'SELECT * FROM [MyCustomView]'; results in EDatabaseError : no such table MyCustomView How do we access our views in sqldb? Thanks a bunch. ---------------------------------------------------------------------- ludob · 2012-04-25 08:27 This works for me (lazarus 1.1, fpc 2.7.1, sqlite3.dll 3.7.6): Code: [Select]  DeleteFileUTF8(SQLite3Connection1.DatabaseName);   SQLite3Connection1.Connected:=true;   SQLQuery1.SQL.Text:='create table test (id integer, name varchar(45))';   SQLQuery1.ExecSQL;   SQLQuery1.SQL.Text:='insert into test values (1,"aaa")';   SQLQuery1.ExecSQL;   SQLQuery1.SQL.Text:='create view MyCustomView as select * from test';   SQLQuery1.ExecSQL;   SQLQuery1.SQL.Text:='select * from MyCustomView';   SQLQuery1.Open; What version of fpc and sqlite are you using? To display the sqlite version used do: Code: [Select]uses ...,sqlite3dyn; ...   SQLite3Connection1.Connected:=true;   ShowMessage(sqlite3_version); ---------------------------------------------------------------------- goldenfox · 2012-04-25 14:15 Thanks ludob. I tested your sample and it's working fine using the following version of sqlite and fpc sqlite3.dll 3.7.11, fpc 2.7.1, lazarus 1.1 There was a glitch in my custom views. After I renamed 'SystemDate' to 'test' and vice versa it now works. =) Thanks for giving me a hint.