Forum > Database

Deleting rows in SQLite tables corrupts rowid

<< < (8/9) > >>

heebiejeebies:

--- Quote from: Zvoni on April 20, 2022, 10:07:47 am ---At a guess: DBGrid.DataSource.DataSet.Last
--- End quote ---

Brilliant guess!  Perfect!  :D



--- Quote ---Do you actually have enough entries to exceed the visible portion of the Grid?
--- End quote ---

Yes, although I've tried both ssVertical and ssAutoVertical and neither works in any case.  I presume ssVertical should show them whether there's enough entries or not.



--- Quote ---And we're back at your SELECT * FROM .....
Try:
SELECT CAST(Field AS CHAR) AS Field, SomeOtherFields FROM MyTable

--- End quote ---

Another brilliant guess, thank you!  :D  I can probably just use this in place of the DBGrid as it has scrollbars.

heebiejeebies:

--- Quote from: Zvoni on April 20, 2022, 10:35:33 am ---btw: Your "If ProtocolHomeTabs.ActivePage..."-Mess can be cut down

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Const  TableArray:Array[0..3] Of String=('NegPatterns','Custom1','Custom2','Custom3');  SQL:String='SELECT * FROM ';        ...ProtocolQuery.SQL.Text:=(SQL+TableArray[ProtocolHomeTabs.PageIndex]); 
No reason to pollute the code with those If/Then

--- End quote ---

Haha, thank you! :) Maybe if I post enough of my horrible code I can get you to optimise my entire program for free, just through sheer irritation!

Zvoni:

--- Quote from: heebiejeebies on April 20, 2022, 11:23:54 am ---Haha, thank you! :) Maybe if I post enough of my horrible code I can get you to optimise my entire program for free, just through sheer irritation!

--- End quote ---
2 € / line of Code... *gggg*
 :P :P :P :P :P


--- Quote ---Yes, although I've tried both ssVertical and ssAutoVertical and neither works in any case.  I presume ssVertical should show them whether there's enough entries or not.

--- End quote ---
Eh, No!
ssVertical just prepares the Scrollbar (ssAutoVertical doesn't!).
And the Scrollbar itself only shows up if the entries exceed the visible Part

heebiejeebies:
Spoke too soon.  DBLookupListBox doesn't have an "OnCellClick" event, and when I put my code in the regular OnClick event, it doesn't recognise which row the user has selected - it just does everything as though the user had selected the first row.

Anyone know how to make it recognise the row?  Or anyone have any other ideas about fixing the DBGRid scrollbars?  Thanks!

dseligo:

--- Quote from: heebiejeebies on April 20, 2022, 09:22:12 pm ---Spoke too soon.  DBLookupListBox doesn't have an "OnCellClick" event, and when I put my code in the regular OnClick event, it doesn't recognise which row the user has selected - it just does everything as though the user had selected the first row.

Anyone know how to make it recognise the row?  Or anyone have any other ideas about fixing the DBGRid scrollbars?  Thanks!

--- End quote ---

It has OnClick event. If you enable 'ScrollListDataset' in Object inspector then this works in OnClick event:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---DBLookupListBox1.ListSource.DataSet.FieldByName('your_field_name').Your_Field_Type

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version