creating tables in sqlite at design time

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

creating tables in sqlite at design time

Post by sandy771 » Tue 18 May 2010 15:02

Not sure if I am missing something here.

I have connected a MyConnection to sqlite3.dll I now want to craete three tables and connect a unitable to them - I can add the relevant fields to the table and have added "SELECT * FROM Decon" to the tables properties but when I trya nd make the table active I get an error table does not exist. What am I doing wrong?

Once I have craeted and populated my table I will want to save it as an sqlite.db file - how do I go about this?

Thanks.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Wed 19 May 2010 09:59

Hello

As I understand you don't have tables in the your database. At first you should execute a query to create tables. And after executing this query only you can attach TUniTable or TUniQuery to these tables.

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Post by sandy771 » Wed 19 May 2010 10:03

Thanks Bork

I had worked that out - I was just being dull.

However I have another question - I will want to load and save sqlite database files as .db files. Is there a method to do this in uniDac?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 20 May 2010 09:20

To connect to SQLite database you should add TUniConnection and TSQLiteUniProvider to your application. Also you should set the ProviderName property to "SQLite" and the Database property to the path to your .db file. After these actions you can open SQLite database by calling the Open method or setting the Connected property to True.

Post Reply