Hi, Kevin.
>In a 3-tier app, I am creating a form in the front-end and wanted some advice on the best way of handling the data that is received from the middle-tier. My form will contain a grid which lists all records, and then fields that allow the user to amend them.
>
>If the middle-tier returns XML, should this be converted/read to a VFP cursor, an ADO recordset? I'm a bit stuck. Someone has already suggest binding to properties in the business-object, but I wanted some more opinions/views on other ways of approaching this.
If the middle-tier returns XML, then your best approach would be to convert it to a VFP cursor (using XmlToCursor), so you can bind it to the grid. You can bind controls to a BizObj properties as long as it is treated as a single-record entity. You can do this with a grid.
What you have to have in mind is that you'll have to return XML back to the middle-tier, and handle the update there.
This works very good (this is what we use here), althout be aware that this is not efficient if would handle large data sets (thousands of records). In that case, as XML transformation involves the MSXML parser and it loads the whole XML doc in memory, it becomes bloated and *very* slow. We carefully handle our sets to avoid such situation, and resort to simpler (although less standard) means to pass that info (mostly as compressed DBF tables).
Another approach is to use ADO instead of XML. In that case, speed is not an issue, althoug ADO is not as easier to pass across the web, for example. Another issue is that you can't bind an ADO recorset right to a grid (not until VFP 8 CursorAdapter class).
Hope this helps. Tell me if you have further questions.