Page 1 of 1

What does the XML record mean?

PostPosted: Tue Aug 01, 2006 9:04 am
by dutch
Dear All,

I would like to know XML record and how to write it.

Best regards,
Dutch

Re: What does the XML record mean?

PostPosted: Tue Aug 01, 2006 10:05 am
by Enrico Maria Giordano
This is an easy way:

Code: Select all  Expand view
#define adOpenForwardOnly 0
#define adOpenKeyset      1
#define adOpenDynamic     2
#define adOpenStatic      3

#define adLockReadOnly        1
#define adLockPessimistic     2
#define adLockOptimistic      3
#define adLockBatchOptimistic 4

#define adPersistXML 1


FUNCTION MAIN()

    LOCAL oRs := CREATEOBJECT( "ADODB.Recordset" )

    FERASE( "TEST.XML" )

    oRs:Open( "SELECT * FROM Test", "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\xharbour; Extended Properties=DBASE III", adOpenForwardOnly, adLockReadOnly )

    oRs:Save( "TEST.XML", adPersistXML )

    oRs:Close()

    RETURN NIL


EMG

PostPosted: Tue Aug 01, 2006 5:59 pm
by James Bott
Enrico,

Is this reading a Jet database or a DBF?

Is this for xHarbour only or will it run under Harbour also?

James

PostPosted: Tue Aug 01, 2006 6:01 pm
by James Bott
Dutch,

There is a DBF to XML conversion program written in Clipper on my website (see button below).

James

PostPosted: Tue Aug 01, 2006 6:06 pm
by Enrico Maria Giordano
James Bott wrote:Enrico,

Is this reading a Jet database or a DBF?


A DBF.

James Bott wrote:Is this for xHarbour only or will it run under Harbour also?


Also for Harbour but you will need to link hbole.lib and use TOleAuto():New() instead of CREATEOBJECT().

EMG

Thanks a lot

PostPosted: Wed Aug 02, 2006 4:03 pm
by dutch
Dear Enrico & James,

Thanks a lot and I will try it.

Best regards,
Dutch