Forums


Aducom Software :: Forums :: Delphi SQLite Version 2.8.x Components :: Bugs/Enhancement requests
 
<< Voorgaande discussie | Volgende discussie >>
TableName property acting strange
Ga naar pagina  [1] 2
Moderators: aducom, aducomadmin2
Auteur Bericht
chorlya
za jan 10 2004, 12:03
Geregistreerde deelnemer #11
Geregistreerd: do jan 08 2004, 01:50
berichten: 13
Hi all,

I'm using version 1.0.F of SQLite Delphi component with Delphi 7 (on W2K with SP4) and am having some weird problems.
When I first installed this package I followed instructions in "Samples" section of docs and everything worked fine for first 2 or 3 examples.

Then I wanted to try something just a bit different and thats where strange things started to happen. Now when I choose .sdb file and then go to TASQLiteTable property "TableName" I always get table named "name" as my first option.
So list of tables for db with tables 'abc', 't1', 't2' and 't3' looks like this:
-name
-abc
-t1
-t2

'name' is always first, then real tables from db, and last table in db is never shown (I gues 'name' is taking its place).

Of course if I choose 'name' and set Active property to True I get an error message "No such table: name".

And this is all follwed with buch of Access Voilations in module rtl70.bpl. This AV start popuping up when I add DataSet, DBGrid and DBNavigator to the form.

I tried unistalling and intalling Aducom package multiple times, then I even reinstalled Delphi and that 'name' table is still there.

Does anyone have any clue as to what is this related or how can I fix this and be able to use Aducom components?
I can provide project files with db used if that is needed.

Any help at all is greatly apreciated.
Thanks,

chorlya
Terug omhoog
chorlya
za jan 10 2004, 03:38
Geregistreerde deelnemer #11
Geregistreerd: do jan 08 2004, 01:50
berichten: 13
Albert,

thanks for your prompt response :lol:

I tried to install new version from asqlite.dpk but I get this error:
ASGSQLiteDsg.pas(77): File not found: 'AMDSqlite.dcu'

If I try to install from asqlitepkg.dpk then I get this error:
ASGSQLite.pas(116): File not found: 'ASGRout.dcu'

Should I just exculde this files from "uses" list?
Terug omhoog
chorlya
zo jan 11 2004, 10:06
Geregistreerde deelnemer #11
Geregistreerd: do jan 08 2004, 01:50
berichten: 13
Albert,

I was able to install OK and that "ghost" table name problem is gone
But now I'm experiencing some problems with buch of AVs.
Here is one very simple project to demonstrate it
Here is exe compiled with D7 in case you don't get AVs on D6
I *always* get AV when closing this app and when updating record.

Also, if I set ASQLiteTable's Active property to false then when I try to set it back to True I always get AV.

When I try to open this project from Windows Explorer by double-clicking on .dpr file I get "Application Error: delphi32.exe" instruction at "XXXX" referenced memory at "XXXX". Memory could not be read...
and after a few OKs to terminate the app "Exception EAccessVoilation in modul vcl70.bpl" accours. So to actualy open the project I have to open Delphi first and then go to "Open Project..."
Other then that Delphi IDE it self tends to generate a lot of AVs and has to be terminated from time to time when working on a project with ASQLite components.
Terug omhoog
aducom
zo jan 11 2004, 02:18

Geregistreerde deelnemer #1
Geregistreerd: wo jan 25 2006, 04:34
Woonplaats: groningen (NL)
berichten: 1561
I have downloaded the example and they do give the AV's. It's an odd problem, since this is new to me. I'm affraid that some error has gone into the components since this component was the first we created and always had worked fine. We'll get into it.

albert

albert
Terug omhoog
aducom
zo jan 11 2004, 02:37

Geregistreerde deelnemer #1
Geregistreerd: wo jan 25 2006, 04:34
Woonplaats: groningen (NL)
berichten: 1561
I found the problem, however I cannot solve it at the moment. Problem is that your fields are defined of type text. Internally they are treated as strings of 30000. This is too much for the table grid, it can handle only strings of 255 chars. So the AV is generated within the Delphi components. Working with clobs is on the todo list so it will be solved, however, for now, if you want to work with strings, try to declare them as varchar(somevalue) where somevalue is a valid integer between 1 and 255. I hope to solve the feature in the near future. I'm sorry for this, but the components only exists now for about 7 weeks, so there's a lot to develop about them.

(By the way, declaring a varchar(>255) can cause same problems as described)

Albert

albert
Terug omhoog
chorlya
zo jan 11 2004, 04:33
Geregistreerde deelnemer #11
Geregistreerd: do jan 08 2004, 01:50
berichten: 13
Alber,

thanks for your quick response (again :lol: ) and yes that does solve my problem, well at least with all those AVs.

Now I have another problem with updating through grid.
If I try to update a row with PRIMARY KEY column's value greater then 9 I get a "PRIMARY KEY must be unique" error.
Only relation I can see here is that I can only update records taht have one digit value for PRIMARY KEY. I have 36 records in this table and if I delete record with PRIMARY KEY column value=2 then I can update all records from 20 to 29. So there is obviously some bug here that is checking only first digit of PRIMARY KEY to see if its unique.

If I try to insert new record I can only insert a record if I enter unique vale for PRIMARY KEY column my self. Is there some way to make inserting from grid generate new auto increment value?
Terug omhoog
aducom
ma jan 12 2004, 02:23

Geregistreerde deelnemer #1
Geregistreerd: wo jan 25 2006, 04:34
Woonplaats: groningen (NL)
berichten: 1561
We'll look into it again. Again a strange problem, since we use these components ourselfs (the priority sequence of creating features in the components depends on our own needs!) with integer keys far beyond yours. It's nice to see how others are using these and you'll probabely do things differently than we do. Thank you for being so patient.

About the autoincrement isue, i've quickly scanned the SQLite homepage and could not find it as a feature of SQLite, but I'm not sure if it realy doesn't excists. The feature should be available in the SQLite database software, and I know there is a hidden key generated for each record. If SQLite is not able to generate unique keys we sure will need this feature some day, so we've put it on the todo list.

Albert

albert
Terug omhoog
aducom
ma jan 12 2004, 03:37

Geregistreerde deelnemer #1
Geregistreerd: wo jan 25 2006, 04:34
Woonplaats: groningen (NL)
berichten: 1561
Hi,

I've tried several things on your tables but cannot reproduce your problem. Could you make your project downloadble again? Check your code on the callback routine. It should be:

end else RowId := StrToInt(PVal^); <============= here!

inc(PName); inc(PVal); inc(PType);
end;
FMetaData := true;
if not bHasRowId then RowId := -1;
if bValidRecord then FResult.Add(ResultStr, RowId);
end;

In the old version it was PVal^^ which causes your mentioned error. Try to fully unload the components (delete the bpl if you have to) and reinstall or compile both packages. Just open up the package one by one and compile.

Albert

albert
Terug omhoog
chorlya
ma jan 12 2004, 09:04
Geregistreerde deelnemer #11
Geregistreerd: do jan 08 2004, 01:50
berichten: 13
OK, that autoinc issue aside I'm still having trouble updating records.
I have reinstalled ASQLite (I had to delete asqlite.bpl manualy). First I compiled both package and then installed asqlite.dpk.
But the problem is still the same.
Here is the project
And here is the exe in case you don't get that problem

btw. I don't understand what you mean by

as far as I know that is exactly how you generate next autoinc value, by inserting NULL. Like this


Regarrds,
chorlya
Terug omhoog
aducom
ma jan 12 2004, 12:47

Geregistreerde deelnemer #1
Geregistreerd: wo jan 25 2006, 04:34
Woonplaats: groningen (NL)
berichten: 1561
The autoinc is difficult in the current component, since it will initialize all fields when an insert is executed. So the field will become zero in stead of 'null'. Then you put your data in and commit, so the field never becomes 'null'. You cannot enter 'null' into a numeric (delphi controlled) field. But I will think of someting, don't worry.

I will check out your project.

Albert

albert
Terug omhoog
Ga naar pagina  [1] 2  

Ga naar:     Terug omhoog

Publiceer deze discussie: RSS 0.92 Publiceer deze discussie: RSS 2.0 Publiceer deze discussie: RDF
Powered by e107 Forum System