1 (edited by gieri 2016-07-14 13:15:28)

Topic: using DB on external drive, reset DB

Hello,

1. when I set den DB path to an external network drive I get an error message during open my Application.
When I use no external path, everything starts fine.

2. How can I reset the database so get back to ID 0?

3. How can I select multiple rows to delete a bunch ob entries?

Thanks for you help

Cheers

gieri

Post's attachments

Attachment icon Bild 147.jpg 28.69 kb, 231 downloads since 2016-07-14 

Re: using DB on external drive, reset DB

1 - I used to work on a shared folder with multiple users for a while with no issue using a shortcut to start the final .exe from shared, do you store only the sqlite.db remotely or do you share the entire folder?

2 - Not quite sure to understand what you are looking to achieve here, each table has a column ID which increments automatically when creating a new entry. Remove all entries and you are back to 0...

3 - Maybe Dmitry has a trick for this as I am not sure if holding Ctrl for multiple selection would work, if not, I would use sql queries within a script.

Re: using DB on external drive, reset DB

gieri wrote:

3. How can I select multiple rows to delete a bunch ob entries?


Hello,

An example, how to remove rows
http://myvisualdatabase.com/forum/viewtopic.php?id=1433

Dmitry.

Re: using DB on external drive, reset DB

tcoton wrote:

1 - I used to work on a shared folder with multiple users for a while with no issue using a shortcut to start the final .exe from shared, do you store only the sqlite.db remotely or do you share the entire folder?

2 - Not quite sure to understand what you are looking to achieve here, each table has a column ID which increments automatically when creating a new entry. Remove all entries and you are back to 0...


Hi,

I stored only the .db on the shared drive and config in the app the target path to the .db. Shoud I move a copy of the whole project to the share and a copy of the project also to the client side with linking the .db in the app?

I have created some test antries and delete all, but when I create a new one, this won´t start with ID0. it counts further on even when nothing showed in the grid.

Cheers

gieri

Re: using DB on external drive, reset DB

DriveSoft wrote:
gieri wrote:

3. How can I select multiple rows to delete a bunch ob entries?


Hello,

An example, how to remove rows
http://myvisualdatabase.com/forum/viewtopic.php?id=1433

Thanks for that hint. Regrettably I´m not familiar with such code snippets. How can I use it? Must i add this code to an Button?
Best way would be if I could select like in other windows app  with Crtl oder Shift key.

Cheers

gieri

Re: using DB on external drive, reset DB

Did you download the example project to see how it works? smile

7 (edited by gieri 2016-07-15 15:48:57)

Re: using DB on external drive, reset DB

tcoton wrote:

Did you download the example project to see how it works? smile

Hello tcoton,

OK, after some playing around with the sample I´m sure I have made all configs similar in my project. Regrettably it doesn´t worked the same as in the sample.

When I have a bunch of entries and I click just on one entry, all other rows are disappear. Do you have an idea what happened here?
Also I still have the problem that after delete all entries, the ID will not reset to 0 when I add some new entry
It seems that my grid will not auto refresh when I have made a new entry with the entry form... is there a option to make this grid autofresh?


Cheers

gieri

Re: using DB on external drive, reset DB

Could you please post your project as zip file without the .exe and .dll in this topic to have a look?

Re: using DB on external drive, reset DB

Gieri,
To reset the id to 0 after deleting all records from a table, place the following after your sql delete:

SqlExecute('Delete from sqlite_sequence where name=''Table_Name''');

Substitute Table_Name with your table name inside the quotes.

Re: using DB on external drive, reset DB

tcoton wrote:

Could you please post your project as zip file without the .exe and .dll in this topic to have a look?

Hello Tcoton,

see attached. As I mentioned, If you have a bunch of entries and you click on one, all other entries disappear. May something is wrong in fact of the script code?

Also the list of the grid doesn´t update automatically. I have to push the Search button twice to see the whole list.

Just on little question left, how could I crate a counter which shows how many entries are in the list.

Cheers

gieri

Post's attachments

Attachment icon My Visual DataBase.rar 1.07 mb, 445 downloads since 2016-07-18 

Re: using DB on external drive, reset DB

Morning Gieri, Thierry,

I was having a look at your project and there are a couple of things that you could try and change (all on Form1) to see if it does what you want.
1)
I think your 'search' (button4) doesn't behave correctly because you have included tablegrid1 as a selected component.
2)
You also do not need an incremental search on tablegrid1 pointing to button4.
3)
I would add an incremental search on edit2 and edit 3 pointing to button4 instead.
4)
You could change the filter properties for edit2 and edit to %s% to perform incremental wild-card searching
5)
If you do 4) and 5) you can hide the 'search' (button4) totally as it is now working incrementally
6)
You can add counters to tablegrid by using the tablegrid settings (where you add the column, column headings etc - click  'footer' and select 'count' option
7)
If you want to select multiple rows for deletion, you can also use 'go multiselect'  which is a property of the tablegrid (properties / options) instead of adding it in a script
8)
when selecting multiple rows in a tablegrid, you select the first row as normal AND THEN hold the CTRL key and select  any others;  if multiple rows display in the tablegrid as highlighted, you have done it correctly.

I hope this answers some of your questions helps.  I have included all of the points in the attachment.

Derek.

Post's attachments

Attachment icon gieri various.zip 340.63 kb, 423 downloads since 2016-07-18 

Re: using DB on external drive, reset DB

derek wrote:

6)
You can add counters to tablegrid by using the tablegrid settings (where you add the column, column headings etc - click  'footer' and select 'count' option

Hello derek,
that´s awsome!! Thanks a lot for your help.

I use in TableGrid1 in the Footer (Count) the Label Text before "Summe:X"
In TableGrid2 in the Footer (Count) the Label Text before "Erledigt:X"

When I click in TableGrid2, the Text before in TableGrid1desapears and only the counted number is left there. When I close and open the App again, the "Text before" Counter in TableGrid1 is back again. I think this is more like a bug, isn´t it?

Can define the Style which I use for the Heads also to the footer? Office210 for example?

cheers

gieri

Re: using DB on external drive, reset DB

Hi Gieri,
Yes, it also loses the footer caption when you do a 'search' on form1.tablegrid1. 
Maybe you can do it by script (perhaps something like   form1.tablegrid1.column[0].footer.caption := 'xxxxx'), but I haven't tried it.  As you said, I think it is a bug that should be fixed by Dmitry rather than us having to find a work-around..
When you use Office2010 header formatting, it adds a thin blue line above the form1.tablegrid footer - maybe that is all the Office2010 footer formatting that is avallable?
Anyway, glad it helped.
Derek.