wwBusinessObject::importdata

Imports data using the same

o.importdata(lnMode,lcData,lcAlias)

Return Value

.t. or .f.

Parameters

lnMode

Cursor XML Modes
1 - XML from cursor
creates a cursor from the current data structure by running a SELECT * WHERE .F. and attempts to import the XML data. If the XML data contains only partial fields only those fields are updated while the others are left blank. Compatible with export formats 1,2,3

2 - XML from cursor with Schema
3 - XML from cursor with DTD
imports into new cursor created by the structure of the provided schema or dtd. If you export only a couple of fields or dynamic fields this will correctly maintain the structure. Compatible with format export formats 2,3.

5 - XML from Cursor using VFPs CursorToXML
6 - XML from Cursor using VFPs CursorToXML with Schema
requires VFP 7 to work. Mode 5 exports will result in a cursor that is created by guessing the structure. Mode 6 exports will use the schema to create a new cursor of the same structure as the original.

Object XML Modes:
11 - XML from oData member
12 - XML from oData member with Schema
13 - XML from oData member with DTD
All of these work the same because the structure of the object is known. Imports into the oData member. Schema or DTDs are not explicitly accessed or used.

20 - XML from object hierarchical (No Schema/DTD)
imports the entire object. Note: This will overwrite any properties you have previous set, so it's recommended you import to a 'work' object.

Miscellaneous Modes:
30 - ADO recordset from cursor (into vResult)
40 - Binary conversion of VFP cursor (from EncodeDbf)

lcData
The string to import into the object.


lcAlias
The name of the cursor to create.

Remarks

Be very careful with mode 5 and 6. If an existing table exists it is overwritten!!! So be sure to copy the data to cursor if you want to append the data to an existing file or cursor. Mode 1,2,3 append data to a cursor if it's already open.

If no Alias name is passed cursors are created as TXMLResult.


See also:

Class wwbusinessObject | wwbusiness::convertdata

© West Wind Technologies, 1996-2022 • Updated: 02/17/19
Comment or report problem with topic