FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Duplicate database and field name
Posts: 126
Joined: Thu Oct 06, 2005 10:18 PM
Duplicate database and field name
Posted: Tue Apr 04, 2006 07:33 AM
Antonio,

I create this code. When I try create browse object for database with field name like database error is generated (data width).

Function TestDFN ()

   Local oWnd := Nil
   Local oLst := Nil
   Local aStr := {}
   Local i := 0

   AAdd (aStr, {'TestDfn', 'C', 30, 0})
   AAdd (aStr, {'F2',      'N',  5, 0})
   DbCreate ('TestDfn', aStr)
   Use TestDFN New
   For i := 1 To 50
       TestDFN->(DbAppend ())
       TestDFN->TestDFN := 'Field:' + PadL (i, 2)
       TestDFN->F2      := i
   Next
   TestDFN->(DbGoTop ())

   Define Window oWnd Title 'Test DFN'

   @ 20, 0 ListBox oLst ;
   Alias TestDFN ;
   Fields ;
   TestDFN->TestDFN, ;
   TransForm (TestDFN->F2, '99') ;
   FieldSizes 100, 30 ;
   Headers 'TestDFN', 'F2' ;
   Size 240, 200 ;
   Pixel

   Activate Window oWnd

Return .T.


Regards
Pawel
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Duplicate database and field name
Posted: Tue Apr 04, 2006 08:25 AM
Pawel,
   local cAlias := "TestDFN"

   ...

   @ 20, 0 ListBox oLst ; 
   Alias cAlias ; 
   ...

or simply remove this line:
   Alias TestDFN ;
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Duplicate database and field name
Posted: Tue Apr 04, 2006 09:24 AM
Pawel,

This is the right fix:
   @ 20, 0 ListBox oLst ; 
   Fields ; 
   TestDFN->TestDFN, ; 
   TransForm (TestDFN->F2, '99') ; 
   Alias "TestDFN" ; 
   ...
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion