home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 March
/
Chip_2002-03_cd1.bin
/
zkuste
/
delphi
/
kompon
/
d5
/
CSDBPACK.ZIP
/
TCSDBBrowse.txt
< prev
Wrap
Text File
|
2001-12-21
|
4KB
|
119 lines
TCSDBBrowse Component Ver 0.2.1 for Delphi 5
--------------------------------------------
Copyright (⌐) 2001 by Cin Sieng
Updated 21 December 2001
Email: bayikiddo@gmx.co.uk
Description: TCSDBBrowse
This component is a browsing utility for databases where you would normally find
in DBase, foxpro using the 'browse' command.
This component not just do this, but can return the selected key(s) value as well
with the ability to multiselect records.
All you have to do is to supply tablename, order by field list, display field list,
and return key(s).
Below is the parameter that needs to be supplied. See sample project.
TMyParam = class(TObject)
Tablename: String; // table name to use (M)
WhereSQL:String; // any sql WHERE clause (O)
MultipleSelect:Boolean; // specify if user can select multiple rows (O) default FALSE
Key : TStringList; // the key fields to return (M)
TitleStr: TStringList; // column title of the grid (O)
// separate column name with | (pipe)
// uses DisplayToUse as index
IndexName: TStringList; // sorting name (M)
IndexStr: TStringList; // for use with ORDER BY clause, should contain actual field names
// field names w/ spaces should be enclosed in '[]' (M)
IndexToUse: Byte; // select which ORDER BY to use in IndexStr (O) default 0
DisplayName: TStringList; // name of Display for field lists. (M)
DisplayStr: TStringList; // list of field names to list in the browse window (M)
DisplayToUse: Byte; // select which Display to use (O) default 0
ResultStr: TStringList; // selected records key field value will be returned here
// if 3 keys items are supplied & multipleselect=TRUE
// first three items of ResultStr is the key to the first
// selected record, second three items is for the second one
// and so on.
end;
****NOTE**** (M) = Mandatory, (O) = Optional
ColorSet property
-----------------
StripeColor1 = odd row back ground color
StripeColor2 = even row background color
FontColor = display font color
BkColor = background display color
SelectedFontColor = selected display font color
SelectedBkColor = selected background display color
SelectedHLFontColor = selected and highlighted display font color
SelectedHLBkColor = selected and highlighted background display color
Thanks To everyone in the borland newsgroups that help me.
You are free to use the TCSDBBrowse Component in compiled form for any
purpose.
This component is provided 'as-is', without any express or implied warranty.
In no event shall the author be held liable for any damages arising from the
use of this component.
Installation
------------
Delphi 5 - Just open CS.DPK and compile to install, ignore the warnings if any.
Usage
-----
Available key when browsing:
Cursor keys - to move around
Z - to maximize/restore window
Ctrl-A - Select all records (when multipleselect = TRUE)
Ctrl-U - Unselect all records (when multipleselect = TRUE)
Ctrl-R - Refreshes Dataset
F4/right click on grid - show popup menu for sorting & display selection
Limitation
----------
- Works on any data access component that have the 'SQL' property only.
e.g: TQuery, TADOQuery
- No checks on field names if it's in the table.
Bugs report
-----------
Before making any bug reports please first verify you are
using the latest version from the website you downloaded from
Please include sample code if possible.
Any suggested enhancements would also be appreciated.
Future Enhancements
-------------------
- improve on the search interface
- verification on field names supplied
History
-------
14 December 2001
- ver 0.1 first release
18 December 2001
- ver 0.1 include the DFM file, oops :)
19 December 2001
- ver 0.2 added grid color setting (TGridColor) property
21 December 2001
- ver 0.2.1 fix the TitleStr to allow different column header name for each DisplayStr