DataControl1

If i use the DataControl1 with listbox can i display the data progressively (yes/No)
i have over 6,000 items to display end search
Thanks

I highly suggest you dump the datacontrol… and convert to using SQL and Recordsets and handle everything programmatically.

this will give you much greater control over what data you retrieve, when your retrieve it, and what order it is in.

ok
but how i display the data progressively

if i use Do loop to load all data to the list it slow it take about 12 second to load all the list.
this is for a Web app

easy answer… Don’t

two reasons

  1. its slow, as you mentioned
  2. your user is NOT going to scroll thru all 6,000 items… ever… trust me…

So …
a) only bring in the minimum amount of information the user needs to see (look up the details only when necessary)
b) implement a paging method… load at most a few hundred records (or less)… and give the user a way to “jump” around, or it they scroll to the end of what you loaded… then load another “page” of records…

Is that more complicated? sure… but trust me… it is how it should be done.

I work on an application (not written in Xojo) that gives our clients the ability to select/view/scroll thru 6 MILLION records of data, and we use exactly the techniques I mention above…

[quote=14472:@Alexis Colon Lugo]how i display the data progressively
if i use Do loop to load all data to the list it slow it take about 12 second to load all the list.[/quote]

You don’t have tools yet to do this properly in Xojo because Xojo seems focused in client side forward only cursors with synchronous operations. You don’t have the usual dbgrids able to handle asynchronously server side cursors to do this. The only not forward only Xojo cursors are the local file based Real/SQLite and the Oracle Db.

So, you must “invent” a way of handling your needs fetching blocks of records. ;p

I believe you are mistaken. The fact that a cursor is forward only, or bi-directional is not controlled by Xojo… It is controlled by the database engine in use, be that engine local (like SQLite) or remote .

And if I am not mistaken, SQLite supports only MOVENEXT, and does not support MOVEPREV (Xojo has both commands for those database engines that DO support it)

But by using the RowID and LIMIT you can quite easily create your own paging mechanism

All it takes it a little imagination,

Nope. There is a layer before the DB engine, the client side “engine” or “driver” or “connector”. PostgreSQL for example, let’s full movements, but Xojo implemented just a client side, forward only, synchronous connector. Check the docs. SQLite accepts moveprevious()

RecordSet.MovePrevious ( )
Moves the record pointer to the previous record in the RecordSet.

Currently only supported by these databases:

    SQLiteDatabase
    OracleDatabase
    ODBCDatabase, although not all ODBC drivers implement this 

A RecordSet is populated in memory when you call the SQLSelect method. If you use MovePrevious to go back to prior records (including those that you may have changed using the Edit method), then you will get the values that were originally populated, not the changed values.

not gonna argue… I gave you a technique… use it or don’t… your choice

I am not arguing, just answering your point where you told I probably was wrong and had a doubt. So I just copied one part of the docs here to answer. :wink: