76

(3 replies, posted in General)

Chuck West wrote:

The forum states that no additional registrations are
accepted.  How does someone request assistance when using this
component?  I am using Delphi 7 and receive an
error every time I compile a program with the Database component included on
the form.  I receive the error listed below.

[Error]RLINK32: Unsupported 16bit resource in file "Unit1.dfm"

Hi Chuck !

You have already the answer. To register to this forum, just send a mail to luckylazarus@free.fr
I will create your account and post your first question.

Concerning your problem, Try this link. It should give you the answer : SQLitePass *.dfm files are created with Delphi 4.

http://coding.derkeiler.com/Archive/Del … /0539.html

If it doesn't work for you, give me more information : the windows and SQLitePass component version you are using ? or a sample of your form/app
(I just have Delphi 6 installed on my computer but I will try to do something for you).


Let me know.
Thanks.

John,

Sorry to answer so late. I was in vacation in spain...

I will try filtering and FindFirst or alike functions. Could you send a db sample and the code you use via email ?
Next version should be out quite soon and I would like to solve bugs if any...

I'm working on Lookup fields and try to implement the ability to sort the dataset on lookup or calc fields.

Thanks.

78

(3 replies, posted in Bug Solved)

Hi John,

Yes, you are right, the download link points to a pdf file. This pdf file contains internet links to download the different component/demo versions.

This way of doing things can seem strange. In fact, I don't have a handy html/css editor and I found pdf was the easiest way to maintain the main page.

Anyway, let me know if you experience other problems with the site.

Regarding your question :

John wrote:

"I have a question regarding  SqlitePassDataset.Locate, which I can't get to find records.
For instance, I found that SqlitePassDataset.Lookup would work as follows:
        V:= TimeTagSqlitePassDataset.Lookup('ProbeID;TransferDate', VarArrayOf([TMDProbeID,FloatToStr(TMDProbeDate)]), 'TransferDate');
        if (VarType(V) in [varNull]) then  // there is no duplicate entry
But the following would find nothing:
          if not TimeTagSqlitePassDataset.Locate('ProbeID;TransferDate', VarArrayOf([TMDProbeID, FloatToStr(TMDProbeDate)]), []) then  // there is no duplicate entry

Not sure if Locate would be any faster than using Lookup.
I am using SQLitePass 0.34 and sqlite 3.54 with Delphi 7."

I let you try with the 0.35 version.
the difference of speed between locate and lookup shouldn't be very important (I didn't test locate versus lookup on huge dataset). The actual implementation keeps track of all the records matching the locate or lookup pattern. I plan to add an new property to limit the number of records returned by the locate/lookup properties.

If you have problem again, you can send a sample of your database. I'll be pleased to help you.


Regards.

Luc

79

(1 replies, posted in Bug Solved)

Sorry for this.

In fact, I checked this quickly and  thought everything was ok because, on saving, I write two lines to the storage version StringList :

procedure TSqlitePassDatabaseDataTypeOptions.SaveToDatabase(_SaveOptions: TsqlitePassDataTypeStorageOptions = []);
...  

{ Save Storage Version }
     With Lines do
          begin
          Add('ComponentVersion');Add(FDatabase.VersionInfo.Component);
          end;

    DbSettingsDataset.FieldByName('StorageVersion').Assign(Lines);
...
end;

Am I wrong ?

80

(12 replies, posted in General)

Ok,

Thanks, I will add this to the next release.

Luc

81

(12 replies, posted in General)

Hi Chukkan,

From version 0.33, a database can be created at runtime like this :

procedure TForm1.BtCreateDatabaseClick(Sender: TObject);
begin
if Not FileExists('NewDb.db3')
   then SqlitePassDatabase1.CreateDatabase('NewDb.db3');

SqlitePassDatabase1.Close;
SqlitePassDatabase1.Database := 'NewDb.db3';
SqlitePassDatabase1.Open;
SqlitePassDatabase1.TableDefs.CreateTable(
'CREATE TABLE [SampleTable] ( [AutoIncField] AUTOINC, [BinIntField] BIGINT,' +
'[BinaryField] BINARY, [BlobField] BLOB, [BooleanField] BOOLEAN, [CharField] CHAR,' +
'[ClobField] CLOB, [CurrencyField] CURRENCY, [DateField] DATE, [DateTextField] DATE,' +
'[DateTimeField] DATETIME, [DecField] DEC, [DecimalField] DECIMAL, [DoubleField] DOUBLE,' +
'[DoublePrecisionField] DOUBLE PRECISION, [FloatField] FLOAT, [GaphicField] GRAPHIC,'+
'[GuidField] GUID, [IntField] INT, [Int64Field] INT64);');
SqlitePassDataset1.DatasetName := 'SampleTable';
SqlitePassDataset1.Open;
end;

This example can be found in ../demo/delphi4/Demo_Test

Be Aware that kexi databases cannot be created this way because kexi uses specials internal tables that won't be created that way. May be in the next versions...

A new package for D6 and D7 is available too. Let me know if you still have problems compiling under D7.

Luc.

Many thanks for your contribution and smart remarks.

Leander007 wrote:

Only functional part of "LoadFromDatabase" procedure is used in next procedure and as we see here is exploited only
LoadFromDatabase for SoCustomFieldDefs, where are others? Is this bug or yet not finished feature?

Both...I didn't have time to finish it in 0.32. Done in 0.33 (Except bugs...). You can also call LoadFromDatabase Directly from the database (MyDb.DatatypeOptions.LoadFromDatabase)

Leander007 wrote:

FIXED CODE:
   { Enforces fields fieldTypes to ftMemo whatever Databasetype is used }
     For i := 0 to Pred(DbSettingTableDef.FieldDefs.Count)
         do begin
          if DbSettingTableDef.FieldDefs[i].FieldName = 'Rowid' then Continue;
          DbSettingTableDef.FieldDefs[i].DataType := ftMemo;
         end;

I have already done some other changes to the 'LoadFromDatabase' code but I will add your correction (below) if loading problems are not solved.

I'll upload version 0.33 by the end of this week.

Luc

83

(12 replies, posted in General)

Hi Chukkan

I won't be able to answer directly to your post until the end of the week (busy).
Many thanks for the info on compiling problems with Delphi 7. I'll try to add  a package soon.

For you problem, I'll check it later (next week), sorry.

In fact I always use existing databases, so it is a good subject of study but you can may be try with connected := false (not sure it works...)

Regards

Luc

84

(12 replies, posted in General)

Hi Chukkan,

the SListIndexError is a constant string declared (with Delphi 4) in the Borland unit "Consts".

Obviously, this unit was renamed or merge with another one in Delphi 7.

SListIndexError  is a simple string so, as a quick fix you can directly change the SqlitePassUtils code :

  if (Index < 0) or (Index >= FCount) then Error(SListIndexError, Index);

by

  if (Index < 0) or (Index >= FCount) then Error('List Index out of bounds (%d)', Index);

Hope it helps.


I'm working on 0.33 version which will be more stable. It will be out soon, so let me know if this fix work so I can adapt the code to D7.

Thanks

Luc

85

(12 replies, posted in General)

Hi Chukkan,

I don't have Dephi 7 running here but I will be glad to help you if you give me some details about the compilation problem.

Thanks.

Luc

86

(11 replies, posted in General)

Hello Dave,

Yes it should be all. I didn't answer earlier because I was working on 0.32 version.

It is now available for download. The database file dialog saves the last used path as you suggested in a previous post.

I tried this version under win xp and ubuntu. I still have stability problems with lazarus. The test programs seem to be more usable/stable when running outside the lazarus ide and the debugger.

Let me know about bugs/problems and if you can start to work quite correctly with the components...

I would also need someone to check the help file since english is not my native language and I'd like to be sure it is "understandable" by anyone!

Many Thanks.

Sincerely.

Luc

87

(11 replies, posted in General)

Dave,

gcc --version gives :

gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

I don't think this is the problem.

Could you try the following statement. It seems to compile ok and to generate the libsqlitepass3.so even if you are not root.

gcc -shared -Wl,-soname, -o libsqlitepass3.so sqlite3.o

Thanks

Luc

88

(11 replies, posted in General)

I tried again to compile the library and got the same message as yours, then I tried to compile as root. It worked.

so, in the console window, enter

sudo -s

then enter the root password or yours if you had the the same rights as roots (but you don't because the compilation didn't work)

compile as you did.

Finally, to copy the libsqlitepass3.so file to /usr/lib press alt+F2 and enter

gksudo nautilus

Re-enter root password or yours to have enough rights to copy the libsqlitepass3.so generated with gcc and owned by root.

I really don't know much about linux but it should work.
If someone has got a better way, you are very welcome.

A last,
to test the sqlitepass components, I put them in /media/windows (on my window ntfs partition) so I don't have to play with administration/root rights with these files

Bug Under Lazarus :
at designtime and may be at runtime the dbaware components don't display dataset data (except with the sqlitepassdboDemo where the database/dataset components are created by code)
It works ok with Delphi 4...

I keep on working on 0.32 but I very busy at work and the help file update is quite a big job.

I hope it helps.

Luc

89

(11 replies, posted in General)

Ok Dave,

I don't have this problem on linux, so I would like to check this :

  - First, did you compile and install the libsqlitepass3.so in /user/lib as described in the tutorial ?
  - If not, try this
  - You can also use the Database.sqlitelibrary property  to connect to an alternative sqlite library (must be compiled as shown on tutorial). If you don't fill this property, the default one (libsqlitepass3.so) will be used and of course it must be in system PATH.
  - if you already tried this...then I've got something wrong.

Anyway, I check this and try to fix the default path in the open dialog box.

90

(8 replies, posted in General)

Hello Dave,

I've just made a quick tutorial on how to compile the sqlite library under ubuntu/linux (link on the main page of the website).

Version 0.31b is now available and should work with Lazarus/Linux.

Please check this if you want.

I've got to go to work.

See you later.

Luc

91

(8 replies, posted in General)

Thanks for your answer.

The connection to the library is ok under win32. I tried to use the components under linux with the same problem as yours.
I used gcc -c sqlite3.c to compile the library. gcc generates a sqlite3.o file.
I first thought this file was not correct to be used as a library.
maybe I should  try to ask the linker (ld) to generate a shared library.

I will test it later.

What is the best location to place a shared library under linux (like ../windows/system32) ?

Regards.
Luc

92

(8 replies, posted in General)

Dave,

I guess you know version 0.31a is ready for download.

It should compile under linux and install properly in lazarus but I couldn't test it with sqlite library. I need help.

I didn't find out how to compile the sqlite library with the SQLITE_ENABLE_COLUMN_METADATA to include the following functions

sqlite3_column_database_name
sqlite3_column_database_name16
sqlite3_column_table_name
sqlite3_column_table_name16
sqlite3_column_origin_name
sqlite3_column_origin_name16
sqlite3_table_column_metadata

in the sqlite library 

Could you tell me the best way to achieve this under unbuntu ?

Thanks

Luc

93

(8 replies, posted in General)

Ok Dave.

I'm still writing and modifying version 0.31 but I don't have too much time for it.
I will post a pre-release (0.31a) in about two weeks, so you will be able to check it with Linux.

Best Regards
Luc

94

(8 replies, posted in General)

Hi Dave

I didn't test the compile process with Linux because I don't have any computer available with this OS right now...
I'm working on version 0.31 that should solve many memory leaks and gives more databases support.
It should be ready in a couple of weeks and it would be great if we could solve some Linux issues.

GetProcAddress is used to load the external library functions. I try to find out how it should be set with Linux.

95

(2 replies, posted in General)

Hello,

The Sqlite3ds unit and the TSqLite3DataSet you are using have been written by Luiz Americo Pereira Camara (pascalive at bol.com.br) and are not part of the SqlitePass Library.

You should post your message on the lazarus DB forums. It seems this unit is widely used and you should get an answer very shortly.

Regards.

Luc

96

(5 replies, posted in General)

Hi Gilles,

SqlitePass doesn't use any of the files included in /usr/share/fpcsrc/packages/base/sqlite/ even if the sqlite3.pp file and SqlitePassApi-v3.pas share the main goal : to load the external sqlite library (sqlite.dll or sqlite.so) and import the functions in order to use the db engine.

In fact, I started to write this library because I needed to manipulate data from sqlite under Delphi 4 and Lazarus. As you can guess, Delphi doesn't include files like the ones found in /usr/share/fpcsrc/packages/base/sqlite/...

So I had to have my own specific files to work with Delphi.

Another difference (a huge one) is that TSqlitePassDataset is designed to work with data_aware controls and inherits from TDataset. Of course you can use it alone as a classic table or query.

I'm always interested in feedback about problems or bugs. If you use the components on linux (your files path seems to be a Linux/Unix one), let me know how the library works. I can't test it under Linux.

Of course, your feedback will be welcome even if you use win32...  smile

Thanks.

Luc

97

(1 replies, posted in Bug Solved)

Hello Ron,

Sorry to be late to answer your comment but I was in spain for my holidays...

I will check this error and try to figure out what's wrong.

Lazarus under win32 is not always easy to debug.  I know that Version 0.9.23 gives strange behavior with custom property editors. 0.9.22 seems to be more stable.

I work actually on filtering / Master / Detail but I will keep you informed.

Thanks.

Luc.

98

(1 replies, posted in General)

Hello Wilhem,

Sqlite engine doesn't natively recognise specific datatypes (for sqlite, everything is first considerated as a string).

So it's quite difficult to map the datatypes stored in a "create statement" of a table to the pascal datatypes because they have to be translated depending on the program which created the database...and there are lot of programs.

SqlitePassDatabase tries to determine which program created the database (by using the file extension). Then a TSqlitePassTranslator is created to handle the mapping between the native data types and the pascal data types.

Presently, only one Kexi translator and one default translator are implemented.

You will notice, when you try to open the sqlite expert demo database with sqliteToolbox that the database type is "Free Pascal" (on the bottom toolbar). In fact, the database type is not correctly recognised.

Anyway, Sqlite Expert Personal seems to be a nice program.

I'll try to write a SqlitePassTranslator implementation for it and to improve the default translator to make it customisable.

Feel free to contribute to this if you want.

regards.

Luc

99

(1 replies, posted in Bug Solved)

Thanks for your remark Wilhem

As a quick fix, open the file SqlitePassParser.pas and change the

procedure TSqlitePassSqlStmt.UnPrepare;
begin
  FEngine.UnprepareStmt(FStmtHandle);
end;

with

procedure TSqlitePassSqlStmt.UnPrepare;
begin
 if Assigned(FEngine)
    then FEngine.UnprepareStmt(FStmtHandle);
end;

Save and recompile the runtime package.

I hope it will help. smile

Luc

Hi Wilhelm and welcome to the forum.

I will check this error soon and give you a proper answer. (It seems to be an access to an object or a property already destroyed or pointing to nil).

Thank you  for your interest.

Regards.