Re: Data sorting for print job



Lorne wrote:

I want to print 6 pieces of information for each of several hundred
or more objects and allow the user to specify the order they are
printed by selecting one, two or three out of three of these pieces
of info to sort by.

Hence if they pick the second data field then it will sort on this
field before printing, but if they pick the 3rd field it will sort on
that field. All the sort fields are text info so will be sorted by
alphabet. If they pick 2 fields it sorts by the first then sub sorts
by the second. The sort fields are not unique so there maybe many
entries with the same data for 1, 2 or 3 out of the 6 fields.


check the Sort and Sorted properties for a TADODataset and descendants.

Although it is "designed" for desktop databases I would suggest to
avoid TADOTable as it has the nasty habit to try to load *all* the
records every time.

Also check DisableControls and EnableControls methods. While they are
designed to allow the programmer to disconnect/connect the dataset from
visual data-aware components (for example DBGrid) and speed it up, it
also speeds up the operations with a dataset even if it is not
connected to any such component.


1] is a database the best way or are there alternatives such as
creating my own record structure and sort routines? Note I do not
need user interface to data - I just run through the objects to
create a list with 6 entries per object, sort the list, print the
data then destroy the list. Nothing is visible to the user except a
print preview and an option to try again.


I would suggest not to reinvent the wheel. OTOH, if you have the
information in a database you can always expand your functionality in
an easier way than if you have to program all

2] If I use ADO can I be sure it will run on all Windows computers
post Windows 95 or do I need to distribute anything with my program
in case the users do not have database programs installed? I have
seen mention of distributing the ADO engine & DCOM95 separately and I
do not know what that involves.

see

http://msdn.microsoft.com/data/learning/MDAC/


3] Is there a better database solution than Access/ADO which I have
used once - the only experience I have on database use.

Access is not bad as a desktop database. Desktop database systems are
ok for small and/or simple databases for which you do not require to do
complicated things or high performance.

OTOH, relational database management systems (RDBMS) usually are more
powerful, are based on SQL, allow you to work with triggers, checks,
views, constraints, stored procedures, snapshots and a lot more
things,etc. Examples could be MS SQL, Firebird, Interbase, Oracle, DB2,
NexusDB, MySQL, etc.

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam

.



Relevant Pages

  • Re: Primary Key not sorted
    ... Are you willing to rely on any "natural" sort of records? ... > though the Company field is the Primary Key but if I ... When I Compact and Repair the database it ...
    (microsoft.public.access.tablesdbdesign)
  • Re: WHY
    ... >it would be GROSSLY inefficient to do sorting on 100 different machines ... each of these phones has had to sort the same numbers ... table or an OLAP cube but in an array in memory having just been calculated ... it's way to a database, but it'd be read and used in calculations prior to ...
    (microsoft.public.excel)
  • Re: Microsoft ACCESS orderby case insensitive
    ... Sorry for that because I've always been working on the Oracle database, ... sort many fields not only one, depends on which field user clicks. ... "Duane Hookom" wrote: ... Is there a simple way to sort in case insensitvie? ...
    (microsoft.public.access.forms)
  • Re: Data sorting for print job
    ... Just to be clear to every body this data is not in a database - I have ... permanently in the underlying MP3 files anyway. ... of info to sort by. ... Access is not bad as a desktop database. ...
    (borland.public.delphi.database.ado)
  • Re: sorter script [was: Frustrated newbie question]
    ... was from the "perldoc -q sort" as a way of ... most 'elegant' of looking algorithms. ... that bogged the database engine down. ... was due to bad implementation on the db engine. ...
    (perl.beginners)