Duplicate database and field name

Duplicate database and field name

Postby pawelu » Tue Apr 04, 2006 7: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).

Code: Select all  Expand view  RUN
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
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Tue Apr 04, 2006 8:25 am

Pawel,
Code: Select all  Expand view  RUN
   local cAlias := "TestDFN"

   ...

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

or simply remove this line:
Code: Select all  Expand view  RUN
   Alias TestDFN ;
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Tue Apr 04, 2006 9:24 am

Pawel,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 9 guests