Hello Roger,
There is a possibility DCBROWSE object in a DBF copy?
Ayhan
oBrowse2DBF ?
Re: oBrowse2DBF ?
Are you saying that you want to create a new database from the contents of a browse object?
The answer is Yes.
This would be similar to a SQL select statement with the INTO clause.
Before I show you how to do this, I would need a small sample program that displays the browse you want to export to a DBF.
The answer is Yes.
This would be similar to a SQL select statement with the INTO clause.
Before I show you how to do this, I would need a small sample program that displays the browse you want to export to a DBF.
The eXpress train is coming - and it has more cars.
Re: oBrowse2DBF ?
Hello Roger,
I want to copy this table (oBrowse1) into a new DBF.
Regards
Ayhan
Code: Select all
@ .1,.5 DCBROWSE oBrowse1 PARENT oBrowBox1 ALIAS "rARTIKEL" ;
SIZE 48.9,19.6 ;
PRESENTATION aPres ;
CURSORMODE XBPBRW_CURSOR_ROW ;
SCOPE ;
font "7.Helv" ;
FREEZELEFT { 1, 1 } ;
EVAL {|o|o:itemMarked := ;
{||xAINV_LoadFields(aApp,DCGETREFRESH_TYPE_EXCLUDE,{GETLIST_BROWSE})} } ;
HANDLER BrowseHandler REFERENCE aApp ;
SORTSCOLOR GRA_CLR_WHITE, GRA_CLR_RED ;
SORTUCOLOR GRA_CLR_WHITE, GRA_CLR_DARKGRAY ;
SORTUPBITMAP BITMAP_RD_UP_RED ;
SORTDOWNBITMAP BITMAP_RD_DOWN_RED ;
ID "BROWSE"
DCBROWSECOL FIELD rArtikel->Artnr WIDTH 4 HEADER msg("ARTNR") PARENT oBrowse1 ;
SORT {||rArtikel->(OrdSetFocus('ARTNR'))} LEFTBUTTON _DEFAULT rArtikel->(OrdSetFocus())=='ARTNR'
DCBROWSECOL FIELD rArtikel->Artkurz WIDTH 5 HEADER msg("Kurzbezeichnung") PARENT oBrowse1 ;
SORT {||rArtikel->(OrdSetFocus('ARTKURZ'))} LEFTBUTTON _DEFAULT rArtikel->(OrdSetFocus())=='ARTKURZ'
DCBROWSECOL FIELD rArtikel->Artbez WIDTH 7 HEADER msg("Bezeichnung") PARENT oBrowse1 ;
SORT {||rArtikel->(OrdSetFocus('ARTBEZ'))} LEFTBUTTON _DEFAULT rArtikel->(OrdSetFocus())=='ARTBEZ'
DCBROWSECOL FIELD rArtikel->met WIDTH 4 HEADER msg("MEZ") PARENT oBrowse1;
SORT {||rArtikel->(OrdSetFocus('MET'))} LEFTBUTTON _DEFAULT rArtikel->(OrdSetFocus())=='MET'
DCBROWSECOL FIELD rArtikel->AGRUPPE WIDTH 5 HEADER msg("Gruppe") PARENT oBrowse1 ;
SORT {||rArtikel->(OrdSetFocus('AGRUPPE'))} LEFTBUTTON _DEFAULT rArtikel->(OrdSetFocus())=='AGRUPPE'
DCBROWSECOL FIELD rartikel->BESTAND WIDTH 5 HEADER msg("Bestand") PARENT oBrowse1
DCBROWSECOL FIELD rartikel->VKPREIS WIDTH 5 HEADER msg("VK-Preis") hide {||!pass2("PREIS")} PARENT oBrowse1
I want to copy this table (oBrowse1) into a new DBF.
Regards
Ayhan
Re: oBrowse2DBF ?
Ok, this is possible. I can create a new function: DC_Browse2Dbf() but you will need to pass some information that cannot be determined automatically from the browse object - unless I create a holder for that info in the DC_XbpBrowse() class.
This is one solution:
DC_Browse2Dbf( oBrowse, cDbfName, aStructure )
Where aStructure is an array that contains the structure of (cDbfName).
This is a function I can write for you without requiring a new eXpress++ release.
Here is another solution:
I can add another clause to the DCBROWSECOL command:
DCBROWSECOL .. STRUCTURE { 'CUST_NAME', 'C', 20, 0 }
This would store the structure info in the oBrowse object to be used later by DC_Browse2Dbf()
It could be possible to create the dbf without structure information by using the column headings as the field names.
The difficulty, however would be in automatically determining the width and decimals of the dbf fields.
This is one solution:
DC_Browse2Dbf( oBrowse, cDbfName, aStructure )
Where aStructure is an array that contains the structure of (cDbfName).
This is a function I can write for you without requiring a new eXpress++ release.
Here is another solution:
I can add another clause to the DCBROWSECOL command:
DCBROWSECOL .. STRUCTURE { 'CUST_NAME', 'C', 20, 0 }
This would store the structure info in the oBrowse object to be used later by DC_Browse2Dbf()
It could be possible to create the dbf without structure information by using the column headings as the field names.
The difficulty, however would be in automatically determining the width and decimals of the dbf fields.
The eXpress train is coming - and it has more cars.
Re: oBrowse2DBF ?
The solution DC_Browse2Dbf (oBrowser, cDbfName, aStructure) would be more interesting for me.
Re: oBrowse2DBF ?
Ok. Try the attached file.
- Attachments
-
- browse2dbf.zip
- DC_Browse2Dbf() test program
- (1.4 KiB) Downloaded 1292 times
The eXpress train is coming - and it has more cars.