101

(1 replies, posted in General)

Merci Chris pour ton soutien. Désolé pour le site et la doc qui sont en anglais, mais pour l'instant cela me semble le  plus efficace pour communiquer avec d'autres utilisateurs.

J'en profite qu'en même pour passer un grand bonjour à tous les programmeurs français. N'hésitez pas à me contacter pour signaler des bugs --  ça devrait être facile vu le nombre de bugs...  wink  -- ou pour participer au projet, d'une manière ou d'une autre.

Luc.

102

(2 replies, posted in Bug Solved)

I tried to download your file but there is a problem : invalide zip archive or the link is dead.
Что такое страница 404/403?
I don't read russian, so I am quite lost with your server page, sorry.

Please check your link and file. You can send it directly by mail (mail info on website main page, write "Lazarus" in message header).

Anyway, try first to open your database using SqliteToolBox demo program. You should have all the tables listed.
if not, try to create the same database with Kexi.

Let me know !

Thanks.

103

(1 replies, posted in Bug Solved)

Thanks for this information.

I remove the link. In fact, I shouldn't have updated the page because the package 0.26 is not ready yet. I didn't think someone was about to download this so quickly !

Should be ready at the end of this week...

Luc

104

(1 replies, posted in General)

Hello sebastien,

I don't really know the solution to your problem, since sorting is directly handled by the sqlite library.

you could may be check the documentation on sqlite page about creating database using UTF16 character support or try to create a database with Kexi and verify if sorting produces correct results...

If someone kwows the answer, let us know.

Version 0.25 will gives opportunity to quickly sort a table or a query using the SortedBy or OrderBy TSqlitePassDataset methods, but they are using SQL statement, i.e. the real job is done, again, by the sqlite library.

Let me know.

Luc

105

(1 replies, posted in Bug Solved)

I checked out the version 0.24 (0.25 is coming soon) but I didn't notice any error while puting the TSqlitePassDatabase component on a form using Lazarus 0.9.20 and Fpc 0.2.4 under WinXp.

I suggest that you try to compile the demo program. The Database component is created at runtime so you will be able to step in the code and find out what's going wrong in the Create procedure.

There is still a bug while destroying the component though (invalid pointer operation) with Lazarus but not with Delphi...

106

(8 replies, posted in General)

Thanks for this family support !

107

(4 replies, posted in General)

Hi Brian,

v0.21 -> 0.22


I noticed that there are two different sqlite type 'dtSqliteAdmin' and 'dtSqlitePass' what's the difference?

The TSqlitePassDatabaseType = (dtSqlitePass, dtKexi, dtSqliteAdmin, dtFpc, dtUnknown); is used by the TSqlitePassDatabase to find out (from the file extension) the program used to create the sqlite database file.

Then, the Procedure TSqlitePassDatabase.Open takes care of creating the right translator for this database type, because Kexi or SqliteAdiministrator don't handle things the same way, especially with date/time/index/fieldtypes...


Procedure TSqlitePassDatabase.Open;
begin
....
{ Create the appropriate FieldTranslator }
// TODO : continu Translator implementation...
Case FDatabaseType of
  dtSqlitePass  : Translator := TSqlitePassTranslator.Create(Self);
  dtKexi        : Translator := TSqlitePassTranslator_Kexi.Create(Self);
  dtSqliteAdmin : Translator := TSqlitePassTranslator.Create(Self);
  dtFpc         : Translator := TSqlitePassTranslator.Create(Self);
  end;
....
end;

For some reason I've a feeling this isn't the best way to do it.  Do you have any other suggestions on how to insert a record in a table?

Your code is ok. In fact, the SqlitePassdataset uses quite the same code to insert/append records.
But, the goal of the component, even if you can use directly a call to the DB.Engine.Exec( SQL, nil  ) is to avoid such annoying writting...
Furthermore, it doesn't take care of correctly binding fields values (look at the TSqlitePassTranslator.BindValue) and doesn't use transactions which are very important to speed up operations.

The classic way would be to use a TSqlitePassDataset linked to a TSqlitePassDatabase, open and use a DbGrid or other DataAware controls to do the job.

Another way is to use code like in the Demo program :


{ ------- Testing ------- }
procedure MainForm_DoSbAppendRecordsClick;
var
i, j, TickCount, RecordCount: Integer;
begin
// Inserting Records - Speed Test.
With MainForm do
begin
MyDataset.DisableControls;
TickCount := Integer(GetTickCount);
RecordCount := StrToInt(EditRecordCount.Text);
if CheckBoxUseTransaction.Checked
   then MyDataset.Database.Engine.Transaction.Start;

for i := 0 to RecordCount do
begin
MyDataset.Append;
for j := 0 to Pred(MyDataset.Fields.count) do
Case MyDataset.Fields[j].DataType of
     ftString : MyDataset.Fields[j].Value := 'Enre num : ' + IntToStr(i) + '-T' + IntToStr(TickCount);
     ftInteger: MyDataset.Fields[j].Value := TickCount + j;
     ftFloat  : MyDataset.Fields[j].Value := TickCount + j + 0.57;
     end;
MyDataset.Post;
end;
if CheckBoxUseTransaction.Checked
   then MyDataset.Database.Engine.Transaction.Commit;
MyDataset.EnableControls;
MainForm_UpdateStatusBar;
end;
end;

Your contribution is welcome for expanding database examples, help file, testing, coding or wathever you wish.

Just let me know if you use fpc/delphi, the versions...etc.

Luc

108

(4 replies, posted in General)

Thanks for your post.

Your code seems to be OK. Unfortunately, there is a bug in the TSqlitePassDataset.InternalInitFieldDefs regarding the use / not use of the rowid in the SQL statement. It should be solved in the 0.22 version, available by the end of this week (2006-09-21).

Then, let me know if you still have trouble.

This new version will also include some infos about indexes defs and improvements in demo.