Farzana wrote: > Dear All, > > We are working in eVC++ environment with SQLite database.We need to populate > the listbox with the values obtained by executing the query. > We were able to get the values of the query by using the API’s > sqlite3_prepare and sqlite3_step. > But we were able to populate and move the listbox in the downward direction > only and we couldn’t get the correct result when we click the upward > direction button of the listbox.Is there any API or functions available to > move the data in upward direction in the listbox? > > We happened to come across the functions of BTree such as > sqlite3BtreePrevious, sqlite3BtreeNext where we are suppose to use cursors. > Is it possible to execute the query using cursors and move the pointer in > the upward or downward direction?
Farzana, Moving the list control has nothing to do with SQLite, that's a function of your interface code. I have a couple of solutions that I use for dealing with grids and list controls in general. The first is to maintain a shadow store behind the scenes with the data from my database records. In particular, I define a class to hold a record. My screen has a vector of these classes. So when the user makes changes to row 3 of the list control, behind the scenes I make those changes to item 3 of the vector. In fact I find this easiest to do by deriving a specialized list control that deals with this particular view on the data. Another approach is to record the primary key with each row of the list control. This works fine if you don't allow in-place editing, and the users will only be adding or deleting records (or their edits occur on a different screen). Clay _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users