Recordset or equivalent Implementation for database manipulation

markbarrett_1

Member
Licensed User
Longtime User
Hi,

I've been looking at Basic4PPC in the last week and looks fairly good for creating applications with a quick turn around time.

The one piece that I haven't been able to find is a recordset or equivalent to simplify database record manipulation. (move first, move next, move previous, and move last). Sure I can go off and write something which simulates it, but before I go off an do that unit of work wanted to see if it was on anybody's radar.

Thoughts?

Cheers.

M
 

BPak

Active Member
Licensed User
Longtime User
B4X:
   ' move to the previous bet in the table   
   BetRow = (BetRow+tblBet.RowCount-1) Mod tblBet.RowCount

   ' move to the next Bet in the Table
   BetRow = (BetRow+1) Mod tblBet.RowCount

I used this in my FlatBet Program which can be seen here

http://www.b4x.com/forum/showthread.php?t=389
 

markbarrett_1

Member
Licensed User
Longtime User
Hi,

I was more thinking having a sqllite backend with 100s or maybe 1000s of records, where you don't really want to burn a whole array table keeping tabs on things.

Cheers.

M
 

BPak

Active Member
Licensed User
Longtime User
I have looked through the sqlite docs and have not found those functions avail.

I guess the way to do it is to Create Index and use the Index to move through the records.
 

markbarrett_1

Member
Licensed User
Longtime User
Hi,

Its fairly straight forward to do with sql statements (assuming you have designed your sql tables properly and have created the right indexes with your primary key and whatever sort order you are wanting to go through the database - you need an ability to uniquely identify each row, that is the big gotcha). I've seen it done on other database engines - as everything I've read about sqllite's sql implementation there is no reason to suggest that it won't work in that engine either - like I said a bit of code to make it happen.

Cheers.

M
 
Top