>oCustomer:fieldPos( cFieldname )
Opps, I meant:
oCustomer:aBuffer[oCustomer:fieldPos( cFieldname )]
The data is stored in aBuffer so you need the location in aBuffer for the fieldname.
James
>oCustomer:fieldPos( cFieldname )
Opps, I meant:
oCustomer:aBuffer[oCustomer:fieldPos( cFieldname )]
The data is stored in aBuffer so you need the location in aBuffer for the fieldname.
James
Thanks for the info James
Regards,
Pete
Rimantas wrote:nageswaragunupudi wrote:TDataBase class comes free with FWH
In earliest versions of FWH this was not fully completed . Can you confirm a good results with that class ?
Regards !
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
@ <row>,<col> XBROWSE oBrw SIZE <width>,<height> PIXEL OF oWnd ;
COLUMNS aCols HEADERS aHead COLSIZES aSizes OBJECT oCust CELL LINES
Just had another thought, what about if you had a related database and you wanted a browse that referenced both objects/databases?
Regards,
Pete
PeterHarmes wrote:Just had another thought, what about if you had a related database and you wanted a browse that referenced both objects/databases?
Regards,
Pete
Pete,
>Just had another thought, what about if you had a related database >and you wanted a browse that referenced both objects/databases?
There are several ways to do this with database objects.
You can use the skipper to keep both databases in sync:
oLbx:bSkip:= {| nRecs | oInvoice:skipper( nRecs), oCustomer:seek( oInvoice:invno) }
Then you just define the fields:
@ 0,0 LISTBOX oLbx FIELDS oInvoice:invno, oCust:company...
Also you can build complex objects--objects that contain other objects. Then you have have a invoice table (database) object that contains the customer table. The invoice object keeps them in sync. Then you can just do:
@ 0,0 LISTBOX oLbx FIELDS oInvoice:invno, oInvoice:oCustomer:company...
Objects can be very powerful and flexible.
Regards,
James