BlackSun
February 21st, 2005, 03:13 PM
Hi again, more newbie troubels ...
I'm writing an app which reads from a database and displays the results in a list control.. Now I have 2 questions about how to do stuff..
1. Depending on what the user chooses, sometimes only part of the db is to be shown, so which of these ideas is the better to use ?
Either I plan to read the whole db into an array or something and then do all the filtering on that (in other words, just put the posts that comes through the filter in the lists). I guess this would be faster if the user chooses to do a lot of searches, or am I wrong here ? And I guess the array would be quite big.
The other way is to do all the searches in the db, but if the base is big, would this be slower ?
I guess this could be timed, but I'll never be able to to such a big db.
2. About saving.. In the app there is a save option, so I don't want any changes to be made until user chooses to save. How is this usually done ? One way I'm thinking of is to make a copy of the db and let the user do it's operations on this, and when it's time to save simply copy this over the original file..
Or else I don't know how to do.. Is there any way to not finalise the changes in the db until Save is pressed ? I'm using ODBC, and as I understand it changes are saved instantly, or is there any way to go around this ?
TIA
BlackSun
I'm writing an app which reads from a database and displays the results in a list control.. Now I have 2 questions about how to do stuff..
1. Depending on what the user chooses, sometimes only part of the db is to be shown, so which of these ideas is the better to use ?
Either I plan to read the whole db into an array or something and then do all the filtering on that (in other words, just put the posts that comes through the filter in the lists). I guess this would be faster if the user chooses to do a lot of searches, or am I wrong here ? And I guess the array would be quite big.
The other way is to do all the searches in the db, but if the base is big, would this be slower ?
I guess this could be timed, but I'll never be able to to such a big db.
2. About saving.. In the app there is a save option, so I don't want any changes to be made until user chooses to save. How is this usually done ? One way I'm thinking of is to make a copy of the db and let the user do it's operations on this, and when it's time to save simply copy this over the original file..
Or else I don't know how to do.. Is there any way to not finalise the changes in the db until Save is pressed ? I'm using ODBC, and as I understand it changes are saved instantly, or is there any way to go around this ?
TIA
BlackSun