Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Honey I shrunk the fieldnames - XMLAdapter Long fieldnam
Message
De
05/09/2003 09:11:24
 
 
À
04/09/2003 14:27:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00825973
Message ID:
00826373
Vues:
29
I have developed a routine which scans the fieldnames of the cursor, and if the name is > 10 then the code will abbreviate it and update the appropriate fields in the permanent table. Your clear example helped to disclose the solution.

Thanks


>>I use the XMLadapter to create XML packages for transporting cursros acctos the Internet. If a field name on the source cursor is > 10 characters long then the resultant fieldname is reduced to 10 characters long and the value is lost.
>>
>>Does anyone have any suggestions about how to preserve the values? I am now re-working the design to eliminate the long fieldnames, but in the short run I need to at least preserve the values.
>>
>>Glenn
>
>Hi Glenn,
>
>What exact scenario are you talking about?
>The following code doesn't truncate name for me:
>
>
>CLOSE DATABASES all
>CLEAR
>
>CREATE CURSOR MyLongNameCursor(MyLongFieldName c(10))
>INSERT INTO MyLongNameCursor values("1234567890")
>oXA=CREATEOBJECT("XMLAdapter")
>oXA.AddTableSchema("MyLongNameCursor")
>oXA.ToXML("cXML")
>CLOSE TABLES
>oXA.ReleaseXML(.T.)
>
>oXA.LoadXML(cXML)
>oXA.Tables(1).ToCursor()
>SELECT oXA.Tables(1).Alias
>?ALIAS()
>AFIELDS(MyFields)
>DISPLAY MEMORY LIKE MyFields
>LIST
>return
>
>
>
>Here is VFP output:
>
>MYLONGNAMECURSOR
>MYFIELDS    Pub    A
>   (   1,   1)     C  "MYLONGFIELDNAME"
>   (   1,   2)     C  "C"
>   (   1,   3)     N  10          (        10.00000000)
>   (   1,   4)     N  0           (         0.00000000)
>   (   1,   5)     L  .F.
>   (   1,   6)     L  .F.
>   (   1,   7)     C  ""
>   (   1,   8)     C  ""
>   (   1,   9)     C  ""
>   (   1,  10)     C  ""
>   (   1,  11)     C  ""
>   (   1,  12)     C  ""
>   (   1,  13)     C  ""
>   (   1,  14)     C  ""
>   (   1,  15)     C  ""
>   (   1,  16)     C  ""
>   (   1,  17)     N  0           (         0.00000000)
>   (   1,  18)     N  0           (         0.00000000)
>Record#  MYLONGFIELDNAME
>      1  1234567890
>
>
>Thanks,
>Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform