Search found 12 matches

by P Scott
Wed 24 Jul 2013 13:38
Forum: dbExpress driver for SQLite
Topic: Connecting in Direct Mode
Replies: 1
Views: 6919

Connecting in Direct Mode

My database access is fine in "regular" mode. I tried to follow your example in the "Readme" file for Direct Mode and Encryption. But when i change the connection to Direct Mode, I get the error:
"Could not find Metadata: TDBXDevartSQLite MetaData Command factory; package: DbxDevartSQLiteDriver160.bpl. Add DbxDevartSQLite to your uses."

But I have that in the "uses", and the bpl file named is in the path and I believe I have the updated version (file date 5/17/13 and size 145). At least I did the update from Devart after direct mode was announced.

Always same error message with the things I tried. I would like to change an existing, working database in "regular" mode to be in Direct mode. I have many parameters, etc. set and working in "non-direct mode". After changing to Direct Mode, I tried blanking all of the parameters from the working connection and just adding the essential ones - Is that a good approach???

Also, when going to direct mode, should I remove the "vendor lib" that says "sqlite3.dll"?
(I tried it both ways).
:?:
P Scott
by P Scott
Mon 17 Jun 2013 14:18
Forum: dbExpress driver for SQLite
Topic: DMMonitor with XE2 Professional
Replies: 1
Views: 6126

DMMonitor with XE2 Professional

Another question...

Trying to install the SQL monitor on XE2 Professional so I can use DB Monitor...

If I try to make a new package, I am informed that Data.SQLExpr.pas is already in the DBExpress package. If I uncheck the DBExpress package and try to re-enable it, I do not get an option to add TSQLMonitor as one of the components, even though it is mentioned as a component in the code.
Perhaps I need code to register the component, which is a little beyond my usual skills?

Scott Stalheim
by P Scott
Wed 12 Jun 2013 13:41
Forum: dbExpress driver for SQLite
Topic: Linking Connection to Grid
Replies: 4
Views: 5100

Re: Linking Connection to Grid

Problem solved (?)
After installing the most recent DBX driver, I was able to apply updates to newly created tables in my database (or to newly inserted lines in the old tables). Eventually I just ended up re-creating the table with the EXACT same fields and data, and the new (identical?) table works and can apply updates. Strange, but now working. :D

Scott
by P Scott
Mon 10 Jun 2013 15:09
Forum: dbExpress driver for SQLite
Topic: Linking Connection to Grid
Replies: 4
Views: 5100

Re: Linking Connection to Grid

Thanks. Some progress!
I updated to the latest driver. Not sure I did that right, but now I can view the database and table fields in the data explorer, which is very nice and a new feature for me. But under "vendor library" I still need to have "sqlite3.dll" and I thought that had been changed so it would accept the dbxsqlite40.dll entry there. Also, after installing the driver update, I had the message that package 'dcldbxsqlite160" could not be loaded because it was contained in 2 units. I removed the conflicting unit (from Embarcadero I think), and left the unit in DBXDevartSQLite160, then no error messages.

I do now see data in the database both in the data explorer and in the grid when I run my program! The problem is now with "ApplyUpdates". When I make a change and use my "Apply Updates" button, the change fails to be saved EXCEPT for data added to a NEW row. I tried adding the "edit" and "post" lines as in the code below. I also added the count for ApplyUpdates errors, and if I try to make changes to 1 or 2 existing rows, I then get a count of 1 or 2 errors.
Maybe I need to start and commit a transaction, but I don't see any sample code on how to do that?

Apply Updates Button Code:

SimpleDataSet1.Edit;
SimpleDataSet1.Post;
i:= SimpledataSet1.ApplyUpdates(-1);
if i <> 0 then
raise Exception.Create(IntToStr(i)+' errors on ApplyUpdates occured');
by P Scott
Sat 08 Jun 2013 15:05
Forum: dbExpress driver for SQLite
Topic: Linking Connection to Grid
Replies: 4
Views: 5100

Linking Connection to Grid

Hi,

I am having problems doing the simplest task here. I have gotten the demo for SimpleDataSet to work pretty well, but after setting up my own new project, and keeping it VERY simple, I see the column names in the grid, but NO data appears. The data shows fine in my SQLite utility, SQLite Maestro. I am using DXE2 and the Devart SQLite driver (dbexpsqlite40.dll) from Dec, 2011. What I did is basically:

1. set up Connection, SimpleDataSet, DataSource and Grid, trying to follow the settings, links, and properties in the demo.

2. I mostly used component properties from the demo, but tried many variations. :? Also tried a lot of things in the SQLConnections.Database.Params basically from the demo examples.

3. Kept the actual code I wrote really brief (3 lines). Put a button on the form with the following code:

{$I .\SetLibName.inc}
SQLConnection1.Open;
SimpleDataSet1.Open;

I copied the SetLibName.inc. used by the demo into my own project folder. Again, when I click on my button, the column names appear but no data.

Thanks for any clues!

P. Scott
by P Scott
Tue 19 Jun 2012 22:07
Forum: dbExpress driver for SQLite
Topic: Fail on ApplyUpdates?
Replies: 6
Views: 8313

Re: Fail on ApplyUpdates?

:D Thanks for the help, and the tip on future debugging!

Scott
by P Scott
Tue 19 Jun 2012 02:30
Forum: dbExpress driver for SQLite
Topic: Fail on ApplyUpdates?
Replies: 6
Views: 8313

Re: Fail on ApplyUpdates?

Found the problem!

The very small example I was preparing for you worked, and with much trial and error I found that a field name can NOT have a question mark (?) in it! I had a boolean field names "Newsletter?" for True/False on who gets a newsletter. Turns out that ANY field with a "?"in the field name makes ApplyUpdates fail. (A question mark is allowed in some SQL utitlities, so don't know if this restriction comes from the driver, from SQLite, or from Delphi.)

This does raise a question on how to find errors more easily! The Delphi routine for OnReconcileError gave me an error like: <near ":13":syntax error>.
I suppose this was line 13 of the SQL for applying updates, but darned if i know where to view the SQL for applying updates.!

Thanks for the help.

Scott S.
by P Scott
Fri 15 Jun 2012 12:56
Forum: dbExpress driver for SQLite
Topic: Fail on ApplyUpdates?
Replies: 6
Views: 8313

Re: Fail on ApplyUpdates?

Still same problem. Even with no visual component.
When i do use a grid or dbedit component, the data appears, but always error on ApplyUpdates. The error count reported is one error for each record where a change was made.
Scott S.
by P Scott
Wed 13 Jun 2012 13:31
Forum: dbExpress driver for SQLite
Topic: Fail on ApplyUpdates?
Replies: 6
Views: 8313

Fail on ApplyUpdates?

I managed to create a grid in Delphi XE2 that I can edit, delete rows, etc. just fine. But when finished, the underlying database is never updated. I am using TSimpleDataSet and just a table from the database that I edit (no query that I define). In fact the only code in the whole project is:
--
procedure TForm1.BitBtn1Click(Sender: TObject); //apply updates button
var
i: integer;
begin
SimpleDataSet1.Edit; //line probably not necessary
SimpleDataSet1.Post;
i := SimpleDataSet1.ApplyUpdates(-1); //-1 allows unlimited error count
if i <> 0 then
raise Exception.Create('Error count='+IntToStr(i)+' on ApplyUpdates occured');
end;
--
If I have 3 edits to the grid, I get an error count of 3. Never do any changes get recorded in the database. Is this a delphi coding problem or something with the dbexpress driver? Do I need to apply query statements rather than editing the table in a grid? Eventually I probably will be using TClientDataSet as opposed to TSimpleDataSet - would that work better?

TIA,
Scott Stalheim
by P Scott
Sun 25 Dec 2011 14:03
Forum: dbExpress driver for SQLite
Topic: Setup Database 101??
Replies: 5
Views: 3798

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.
by P Scott
Thu 22 Dec 2011 16:20
Forum: dbExpress driver for SQLite
Topic: Setup Database 101??
Replies: 5
Views: 3798

:?
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
by P Scott
Wed 21 Dec 2011 15:46
Forum: dbExpress driver for SQLite
Topic: Setup Database 101??
Replies: 5
Views: 3798

Setup Database 101??

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