Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursortoxml and xmltocursor
Message
De
18/06/2010 01:54:21
 
 
À
18/06/2010 01:25:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01469554
Message ID:
01469558
Vues:
53
Mike,
Try this

CREATE CURSOR mycur (pono c(10), order I(4))
INSERT INTO MyCur (pono ,order) VALUES ([1000], 0)
INSERT INTO MyCur (pono ,order) VALUES ([1001], 1)
INSERT INTO MyCur (pono ,order) VALUES ([1002], 1)

CURSORTOXML('mycur','mycur.xml',1,16+2+512,0,"1")

XMLTOCURSOR('mycur.xml','test',512+1024)
SELECT test
BROWSE


>Hi Guys,
>
>I want to create a program that will convert a cursor into an xml file and later use that xml file to retrieve the data stored in it. I created the following cursor
>
>CREATE CURSOR mycur (pono c(10), order I(4))
>
>I then populated this cursor with the following records
>
>1000 0
>1001 1
>1002 1
>
>I then converted this cursor to xml using the following lines of code
>
>CURSORTOXML("mycur","lcXML",1,48)
>STRTOFILE(lcXML,"c:\mycur1.xml")
>
>when its time for me to use the xml file and convert it back into a cursor I used the following lines of code
>XMLTOCURSOR("c:\mycur1.xml","newcur",4)
>
>The main problem is that the data type for the field pono has changed to Integer and the field for order has changed to L(1) or logical. Is there a way to retain the original field types of the original cursor which in this case is mycur? I am expecting that when I convert the xml file back to cursor using this line of code, XMLTOCURSOR("c:\mycur1.xml","newcur",4) it will create a new cursor with an alias of newcur having the same fields and data type as mycur.
>
>Please help and thanks in advance...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform