PeterHarmes wrote:James,
Interested in using a database class, but was wondering how i use the class in the following situation:
I give my clients the ability to modify what appears in a browse and in what order the columns appear in, so i have a database that holds the browse info, like this:
Browse Code, Column Number, Field, Size, Header
for example:
CUSTOMER,1,CUSTOMER->ACNT_NBR,100, "Account"
CUSTOMER,2,CUSTOMER->ACNT_NAME,300,"Name"
etc..
The way i currently do this, is to do a strtran on the info read from the database, so if the CUSTOMER alias was CUST01 I would transform the "Field" field to "CUST01->ACNT_NBR" & "CUST01->ACNT_NAME" etc..
How can i do this with either tData or tDataBase class?
Best Regards,
Pete
I may suggest a very easy way to create such an XBrowse.
Have the column names, headers and column sizes in 3 arrays ....
example, column names aCols := { 'ACNT_NMBR', 'ACNT_NAME', ..... }
column headers aHead := { "Account", "Name", ..... }
column sizes aSizes := { 100, 200, ..... }
It is easy for you to construct these arrays from your browse info database table.
Now to create the browse :
@ <row>,<col> XBROWSE oBrw SIZE <width>,<height> PIXEL OF oWnd ;
COLUMNS aCols HEADERS aHead COLSIZES aSizes OBJECT oCust CELL LINES
I assume oCust to be the Database object. ( TData or TDataBase )