Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field name and type
Message
De
02/11/2005 02:57:06
 
 
À
02/11/2005 01:46:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP3
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01064365
Message ID:
01064377
Vues:
20
>Dear Experts
>
>
>CLOSE ALL
>CLOSE DATABASES
>OPEN DATABASE D:\GIN2006\TABLES\ACCOUNT
>tbname=justfname(thisform.pageframe1.page2.list1.value)
>USE &tbname
>gnFieldcount = AFIELDS(gaMyArray)
>
>FOR nCount = 1 TO gnFieldcount
>   ? gaMyArray(nCount,1)
>ENDFOR
>
>The above codes work fine.
>But I want to add all field names and their type into list1 as
>
>debit n(8)
>credit n(8)
>detail c(20)
>
>List1 has two columns
>
>Please modify codes or suggest another
>Thanks in advance



Assuming that Thisform.List1 is your listbox control
CLOSE ALL
CLOSE DATABASES
OPEN DATABASE D:\GIN2006\TABLES\ACCOUNT
tbname=justfname(thisform.pageframe1.page2.list1.value)

USE (tbname)
gnFieldcount = AFIELDS(gaMyArray)
thisform.AddProperty("myArray[1,2]")

thisform.List1.RowSourceType = 5 && Array
thisform.List1.RowSource     = [thisform.MyArray]
thisform.List1.ColumnCount   = 2

FOR nCount = 1 TO gnFieldcount
   DIMENSION thisform.myArray[nCount,2]
   thisform.myArray[nCount,1] = gaMyArray[nCount,1]
   thisform.myArray[nCount,2] = gaMyArray[nCount,2]
ENDFOR
thisform.List1.Requery()  && Maybe this line is redundant, but just in case :o)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform