This bug is corrected in upcoming 0.42 version (I plan the release for next week)
I had a hard time to catch it...
The Deleted records are now recycled to be re-used when the next insert or append occurs
You are not logged in. Please login or register.
SQLitePass Forum - Powered by PunBB » Posts by luckylazarus
This bug is corrected in upcoming 0.42 version (I plan the release for next week)
I had a hard time to catch it...
The Deleted records are now recycled to be re-used when the next insert or append occurs
Thank you Wolfy,
I will probably move your post to another topic.
We will take care of the easter eggs today...
Regards
Great update Parcel.
BUGFIXES AND ENHANCEMENTS
I would be happy to include your modification or bugfixes in the current 0.42. To do this, I need to keep track of your contribution (except for the fixes posted on forum).
May be the simplest way would be to mark the code changes with something like
//------- edited by Parcel on dd-mm-yyyy
...code
// ------- end ----------------
What do you think about it ?
UTF8 and UTF16
I'm very concerned with utf8 or utf16 support, even if the component is good enougth for english or french...It could then be used by many others people.
I currently use old fashion Delphi4 to code sqlitepass so I'm missing unicodestrings and I would appreciate your help to turn the component utf compliant from D4 to D2008 and Lazarus/fpc...
This is a very ugly bug.
As you can see, the components are not stable yet...
I try to quickly repair this.
Thanks Parcel
Ok Parcel,
I changed the RangeCheck error in TSqlitePassBitArray and have to work on TSqlitePassDatabase.CreateDatabase qnd GetRecord
as soon as I have enough time....
Luc
Hi Parcel, thanks for all your work and checks.
I changed :
function TSqlitePassRecordset.SqliteValueToBuffer
...
dtsDateTime : DoubleValue := SqliteDbv3_column_double(PSqliteData,ColumnIndex);
...
Database Page Size :
The Sqlite documentation says
"PRAGMA page_size;
PRAGMA page_size = bytes;
Query or set the page size of the database. The page size may only be set if the database has not yet been created. The page size must be a power of two greater than or equal to 512 and less than or equal to SQLITE_MAX_PAGE_SIZE. The maximum value for SQLITE_MAX_PAGE_SIZE is 32768.
When a new database is created, SQLite assigned a default page size based on information received from the xSectorSize and xDeviceCharacteristics methods of the sqlite3_io_methods object of the newly created database file. The page_size pragma will only cause an immediate change in the page size if it is issued while the database is still empty, prior to the first CREATE TABLE statement. As of version 3.5.8, if the page_size pragma is used to specify a new page size just prior to running the VACUUM command then VACUUM will change the page size to the new value."
So The pageSize could be verified when the property is set by user or when database is created.
I work on it and keep you informed soon.
The TSqlitePassRecordset.AddString was already changed in 0.42
...
Result := Integer(FRecycledStrings[Pred(FRecycledStrings.Count)]); // << changed PInteger()^ to Integer
...
Thanks a lot Parcel.
I check and include your fixes in the 0.42 release.
Hi Wolfy,
You don't really need this 'C' code since SqlitePass Dataset can do the job for you. It is as trivial as loading a picture via a DbImage... Just joking.
I understood you wanted to embed any kind of file into a Db and then be able to save them back to another location.
If this is your goal, I wrote a little demo program for this purpose.
Download here
The source is included and the database is already filled with a txt, a pdf, a bmp, the latest SqliteToolbox.exe (Not officially available...) and his database...
The complete unit is :
unit BlobForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DBCtrls, Grids, DBGrids, Db, ExtCtrls, SqlitePassDbo, Buttons;
type
TForm1 = class(TForm)
SqlitePassDatabase1: TSqlitePassDatabase;
Dataset: TSqlitePassDataset;
Panel1: TPanel;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
SbLoadBlob: TSpeedButton;
SbSaveBlob: TSpeedButton;
DatasetFileId: TLargeintField;
DatasetFileLocation: TStringField;
DatasetBlobData: TBlobField;
OpenDialog: TOpenDialog;
SaveDialog: TSaveDialog;
procedure SbLoadBlobClick(Sender: TObject);
procedure SbSaveBlobClick(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.SbLoadBlobClick(Sender: TObject);
begin
if OpenDialog.Execute
then begin
Dataset.Edit;
DatasetFileLocation.Value := OpenDialog.FileName;
DatasetBlobData.LoadFromFile(OpenDialog.Filename);
Dataset.Post;
end;
end;
procedure TForm1.SbSaveBlobClick(Sender: TObject);
begin
if SaveDialog.Execute
then DatasetBlobData.SaveToFile(SaveDialog.Filename);
end;
end.
The Db was created with SqliteToolbox :
CREATE TABLE "BlobTable"
(
"FileId" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
"FileLocation" STRING(250),
"BlobData" BLOB
)
I hope this will help you.
Have fun
Luc
Hi Wolfy,
The good news is : Yes SqlitePass handles blobs. (Images, Memo, ...etc)
The bad news is : In current version (0.41), when using images, This only works with Delphi and bmp.
FPC and Lazarus handles Memo but I still have problems with the Lazarus TdbImage that doesn't display images yet. This fix is planned for futur releases but I don't think it will be ready for the next 0.42 as I have to post questions on lazarus forum...I need help too...
Anyway, for xp and Delphi
Dowload and install the demo program from my site
Run and open the demo database ...SQLitePass\Demo\Databases\ExpertPersonal_dbdemos.db3
Select the Table Biolife.
You should be able to display Fishes bmp and Memo, Clear, Import, Export it...etc
Here is the code used in demo program (It uses a classic TDbImage component) :
procedure TMainForm.BtLoadPictureFromFileClick(Sender: TObject);
begin
if OpenPictureDialog.Execute
then begin
Dataset.Edit;
TBlobField(DbImage.Field).LoadFromFile(OpenPictureDialog.Filename);
end;
end;
procedure TMainForm.BtClearPictureClick(Sender: TObject);
begin
Dataset.Edit;
DbImage.Field.Clear;
end;
procedure TMainForm.BtSavePictureToFileClick(Sender: TObject);
begin
If SavePictureDialog.Execute
then TBlobField(DbImage.Field).SaveToFile(SavePictureDialog.Filename);
end;
Using classic BlobField should be ok with other kinds of large data.
I know documentation is not very usefull for now but the components are having to many changes rigth now.
Let me know if you still have problem so others users could share our experience.
Regards.
Luc
I tried the "buggy Db" with no warning. Could you tell me if you still get an error ?
Parcel, This bug was already solved in next 0.42. The current implementation is :
procedure TSqlitePassDataset.LocateMoveToRecord;
begin
FLocateMoveState:= grError;
if FLocateFoundRecords.Count = 0
then Exit;
if (FLocateCurrentItem > -1) and (FLocateCurrentItem < FLocateFoundRecords.Count) then
begin
MoveBy(Integer(FLocateFoundRecords.Items[FLocateCurrentItem]) - PInteger(ActiveBuffer)^);
if FLocateCurrentItem = 0
then FLocateMoveState := grBOF
else if FLocateCurrentItem = Pred(FLocateFoundRecords.Count)
then FLocateMoveState := grEOF
else FLocateMoveState := grOk;
end;
end;
I let you catch some more bugs...
Thanks
Thanks again Parcel,
I check this and let you know...
I working on filters and should upload the next release in a couple of weeks...
Parcel,
Thanks for this bug fix. I didn't test it yet but...
The procedure TSqlitePassTranslator.IntegerToTimeText will be modified in the next release with :
...
Const
TimeDiv = 86400000; { 1000 / 60 / 60 / 24 }
var
....
TimeValue : TTime;
begin
TimeValue := Value / TimeDiv;
DecodeTime(TimeValue, Hour, Min, Sec, MSec);
...
Thanks
I received the Db and will have a look.
I keep you informed.
Luc
Hi Tohang,
I don't know if someone else had the same problem compiling the package. The units you mentioned are old units from another project I started years ago. They are not used by Sqlitepass so you can find the reference(s) that point to them and remove it.
What is your developpement platform D4, lazarus, Winxp, Linux ?...
What package did you used to install ?
Hello Parcel,
I know there are some issues with the TSqlitePassDatabaseDataTypeOptions.LoadFromDatabase procedure but
I just created a new database using Kexi and opened it with delphi. The warning was not fired.
As a quick fix, select the Database.DatatypeOptions.LoadOptions to false or set soManual to True.
Could you send your Db by mail. Il will have a look.
Thanks.
Luc
The current version is 0.41 ... Did you want to mean "hope 0.42 will be work well" ?
Regards.
Luc
Hello Koba,
I will have a look to UTF8 encoding. Could you send a database sample by mail to luckylazarus@free.fr ?
Thanks
Thanks for your database.
This setting works correctly (tested with 0.41 library)
As you can see here (if you cannot enlarge the picture, do a 'save as' with your browser) :
You should be able to get the correct result using database.datatypeoptions
The matching date format for databases created with sqliteExpert should be
DateFormat : YYYY-MM-DD
DateStorage : asText
DateTimeFormat : YYYY-MM-DD hh:mm:ss
DateTimeStrorage : dtsText
Please, try this or send your sample database by mail : luckylazarus@free.fr
Be aware that sqlitepass component 0.40 are not "stable" and should not be used in a "real" application since many bugs have to be corrected.
regards
Ok, this is fixed in the 0.41
I will upload the new library by next week.
I don't have Northwind Access Database but try this :
Open your database with SqliteToolbox and select the orders table.
Look at the tab 'fields definition' to check how those fields are stored. If their Datatype is not DateTime (I guess it will be Date) then you will have to go to Database/Options/CustomFieldDefs and define the fields OrderDate, RequiredDate, and ShippedDate as DateTime. Select Save To Database and Ok to close the form.
You should have your fields corectly displayed now...
Let me know or send me you sample db.
I will check this for the next version...coming soon.
Thx.
Luc
The TSqlitePassSelectStmt.BuildSchema retrieves tables names and fields names from the following sqlite functions :
FieldName := SqliteDbv3_column_origin_name(StmtHandle, i);
TableName := SqliteDbv3_column_table_name(StmtHandle, i);
I am using these functions because I don't have a built-in sql parser yet (planed for futur versions). The bad news : sometimes, sqlite returns an empty tablename. I think this is what happened with your query.
A possible work around would be to provide the correct table and field names directly in the buildschema function (replacing SqliteDbv3_column_origin_name(StmtHandle, i) with your own function that should return the table name...)
I'm already working on others changes in the TSqlitePassSelectStmt object so I don't think it will be for the next version.
I'm very interested in finding an answer to this problem. That will allow to use the component whithout the need to compile the sqlite library with SQLITE_ENABLE_COLUMN_METADATA.
Hi John,
Thank you for all your comments on the component. I will try to fix it for the next incoming version (0.40).
I was ready to publish an upgrade with some changes but I decided to delay the next public version because I am completely rewriting the TsqlitePassRecordset object in order to work with pointers and paged memory.
I changed the internal TsqlitePassTranslator object too.
These changes should increase the component speed.
I plan the 0.40 version to be available by the end of november.
Luc
Yes.
Version 0.40 is on the way, not as fast as I wish but writing components is just a hobby for me...I am quite busy with my job, family and others activities.
I will check the component with D6. If someone knows how to keep compatibility between D4/D7 without having to check or uncheck the text DFM...
SQLitePass Forum - Powered by PunBB » Posts by luckylazarus
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 7 official extensions. Copyright © 2003–2009 PunBB.