Setup Database 101??

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQLite in Delphi and C++Builder
Post Reply
P Scott
Posts: 12
Joined: Wed 21 Dec 2011 15:14
Location: USA

Setup Database 101??

Post by P Scott » Wed 21 Dec 2011 15:46

Hi,
I just need a "Hello World" app or help setting up my first table with data in it using DBXpress driver for SQLite in DXE2 Professional.
I have installed the driver and it now appears in the XE2 data Explorer window. I tried "add new connection" and see it there with a little red "x" by it. When I try to "modify connection parameters" from there, I think i need to make some entries for Server Name, database Name, User, and Password - but have no idea what to enter. I have no established connection or database at this time. I am trying to create my first simple connection and table as a LOCAL database.
When I try a simple app of my own, or the demo app supplied with the installation from Devart, I get errors:
1) SimpleDataSet.dproj from Devart demos compiling:
file not found: Exceptionlog.dcu
2) my own form with a connection, simple dataset, and table on it:
form compiles, but if I try to add a field to the table which is new and blank, I get the message "Cannot load client library: sqlite3.dll".

I will be creating a relational database with about 60 tables, all Local for now - but plan to create the database and with new tables and indexes in the DataBase Explorer of Delphi. But for now, all I need is a start on getting a basic connection and making a table in a form!
Thanks!

:) P Scott

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

Post by bork » Thu 22 Dec 2011 12:27

Hello

Unfortunately our dbExpress drivers do not support Delphi Data Explorer currently. We know about this issue and are working to resolve it. In order to design an SQLite database you can use some free and more useful tools than Delphi Data Explorer, for example, SQLite Administrator (http://sqliteadmin.orbmu2k.de/).

There are two ways to create a connection:

1. Create a connection in the design-time. In this case you should put the TSQLConnection to a form and specify a path to the SQLite database in the Database parameter. SQLite does not support user names and passwords, so you needn't define them.

2. Create a connection in the design-time. In this case you should execute the following code:

Code: Select all

begin
 SQLConnection1.DriverName := 'DevartSQLite';
 SQLConnection1.GetDriverFunc := 'getSQLDriverSQLite';
 SQLConnection1.LibraryName := 'dbexpsqlite40.dll';
 SQLConnection1.VendorLib := 'sqlite3.dll';
 SQLConnection1.Params.Values['Database'] := 'my_lite_db.s3db'; // or other path to your database
 SQLConnection1.Open;
end;
You can open the "Query" demo or remove the "Exceptionlog" file from the 'Uses' section of the "SimpleDataSet" demo (this file is left from the previous demo version). These demos demonstrate the use of dbExpress driver for SQLite.

The sqlite3.dll library is required to work with SQLite using Devart dbExpress driver for SQLite or any other SQLite tool. You can download sqlite3.dll here:  http://www.sqlite.org/download.html After you download the sqlite3.dll file, copy it to C:\Windows\System32\.

If you come up with any other questions, please contact me.

P Scott
Posts: 12
Joined: Wed 21 Dec 2011 15:14
Location: USA

Post by P Scott » Thu 22 Dec 2011 16:20

:?
Thanks much. The SQLite Administrator works nicely, so I can now connect to the DataBase and tables, and work with them.

However, I still can not set up the connection in a Delphi form. Maybe that is a question for Embarcadero? I downloaded sqLite3.dll and put it in Windows\System32 as instructed. I even added that location as a library path and tried putting the dll right in my project folder.
Trying to set up the connection at design time or putting your startup lines into code, or running the Query demo, I get the message "Cannot load sqlite3.dll". That seems odd since I have it there. There seem to be a few different dates and file sizes of that dll - I tried the one from the MySQLite web site and from the SQLite Administrator download.
Any idea what might be going on?

Scott

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

Post by bork » Fri 23 Dec 2011 11:11

Hello

Sorry, I forgot to ask you which operation system you use. Do you use a 32-bit or a 64-bit OS? Also, do you create 32-bit or 64-bit applications?

If you use a 64-bit operation system, you should copy sqlite3.dll, downloaded from http://www.sqlite.org/download.html to C:\Windows\SysWOW64\ instead of C:\Windows\System32\.

P Scott
Posts: 12
Joined: Wed 21 Dec 2011 15:14
Location: USA

Post by P Scott » Sun 25 Dec 2011 14:03

Thanks, it works!
I have Win7 OS, 64 bit but develop 32 bit apps (so far). It seems the SQLite site should include an install note with these details on downloading.
Now that I am on the way and going, any references or on-line communities for basic database development questions? The best I have found so far are the docs at the SQLite site itself.. Is it appropriate on one of the Devart forums to ask how to perform a DB task in SQLite (generally I will be wondering how to do some of the things I already have done in Paradox.)

Thanks.

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

Post by bork » Mon 26 Dec 2011 10:00

Hello

You should download sqlite3.dll before using SQLite. It is required not only for dbExpress driver, but also for any application that uses SQLite. And we suppose that anyone, who wants to use SQLite, will read some documentation about SQLite requirements. But if you have these questions, we will add this information to our Readme.html file.

If any other questions come up, please contact me.

Post Reply