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
Linking Connection to Grid
Re: Linking Connection to Grid
Hello,
You are using a rather old dbExpress driver for SQLite version. Please try reproducing the problem on the latest dbExpress driver for SQLite version. If the problem repeats, contact us again.
You are using a rather old dbExpress driver for SQLite version. Please try reproducing the problem on the latest dbExpress driver for SQLite version. If the problem repeats, contact us again.
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');
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');
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.
Scott
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.
Scott
Re: Linking Connection to Grid
Hello,
You can use the Direct mode on a win32 platform with no need for the sqlite3.dll library. For this, in the connection settings select Devart SQLite Direct instead of Devart SQLite.
You can use the Direct mode on a win32 platform with no need for the sqlite3.dll library. For this, in the connection settings select Devart SQLite Direct instead of Devart SQLite.