peteschulte
IS-IT--Management
Thanks to Olaf, Tamar, Stfaprc, MikeLewis and others
I've arrived at the question how to use xmlAdapter and append from its tables collection to a batch of files. Some of their data types have been converted from Memo.
There's more background and detail in thread 184-1517016 "xmlToCursor()--how to use?" This new thread recaps what I posted onto the end of that one yesterday, since it created no response.
Also, I have searched Tek-Tips VFP Forum through several pages on "Append From." So I will appreciate any assistance that works!
Here is the original module that works well, but results in tables with too many memo fields. It's followed by my program development language, trying to code a match between the xmlAdapter tables and the folder of tables.
PDL
Here is the list of files to append to.
They are in \\Gmc\d\Stmt\Monterey\UB_Test_1231\RevisedDataTypes. This list would also form the string to search for xmlAdapter.alias table name "is contained in."
ACCOUNT.DBF, agencyinfo.dbf, BILLINGSUMMARY.DBF, billingsummarydetail.dbf,
BILLSUMMARY.DBF, consumptionhistory.dbf, customer.DBF, fees.dbf,
locationsummary.dbf, mailto.dbf, meterhistory.dbf, notessummary.DBF,
service.dbf, trans.DBF.
Standing by,
Peter
I've arrived at the question how to use xmlAdapter and append from its tables collection to a batch of files. Some of their data types have been converted from Memo.
There's more background and detail in thread 184-1517016 "xmlToCursor()--how to use?" This new thread recaps what I posted onto the end of that one yesterday, since it created no response.
Also, I have searched Tek-Tips VFP Forum through several pages on "Append From." So I will appreciate any assistance that works!
Here is the original module that works well, but results in tables with too many memo fields. It's followed by my program development language, trying to code a match between the xmlAdapter tables and the folder of tables.
Code:
SET DEFAULT TO \\Gmc\d\Stmt\Monterey\UB_Test_1231
Local lcXML, loXMLAdapter, loXMLTable
Close Tables All
xmlfile="BPtestXML.txt"
xmlcontent = FILETOSTR(xmlfile)
lcXML = xmlcontent
loXMLAdapter = CreateObject("XMLAdapter")
loXMLAdapter.LoadXML(lcXML,.F.,.T.)
&& XMLAdapter.LoadXML( cXMLDocument [, lFile [, lValidateOnParse ]] )
For Each loXMLTable in loXMLAdapter.Tables
loXMLTable.ToCursor()
COPY TO (loXMLTable.Alias+".dbf")
ENDFOR
SET
PDL
Code:
Set default DIR
(Other code precedes this)
For Each loXMLTable in loXMLAdapter.Tables
IF loXMLTable.Alias is contained in string (file name list)
USE table from file list
APPEND FROM loXMLTable.Alias
ELSE
WAIT 'File not found' WINDOW TIMEOUT 200
ENDIF
ENDFOR
Here is the list of files to append to.
They are in \\Gmc\d\Stmt\Monterey\UB_Test_1231\RevisedDataTypes. This list would also form the string to search for xmlAdapter.alias table name "is contained in."
ACCOUNT.DBF, agencyinfo.dbf, BILLINGSUMMARY.DBF, billingsummarydetail.dbf,
BILLSUMMARY.DBF, consumptionhistory.dbf, customer.DBF, fees.dbf,
locationsummary.dbf, mailto.dbf, meterhistory.dbf, notessummary.DBF,
service.dbf, trans.DBF.
Standing by,
Peter