Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Retreival Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00948105
Message ID:
00948148
Views:
15
You need to define a table structure that you will allways respect between the UI and the BO (and between the BO and the data layer if you have one). It will be the responsibility of the BO (or preferably the data layer) to do the necessary conversion between the physical structure of the table (VFP or SQL Server) and the struture the UI look for.
*: UI layer
lcData = loBO.getData ()
XMLTOCURSOR (lcData, "curData")   && curData has layout "A"

***********
*: BO layer

FUNCTION getData
lcData = loDL.getData ()   && Allways return layout "A"
RETURN lcData

*************
*: Data layer

FUNCTION getData
SELECT ... FROM <VFP_Table>   && Layout "B"
<Convert layout B to layout A here>

* or

SELECT ... FROM <SQL_Server>   && Layout "C"
<Convert layout C to layout A here>

CURSORTOXML ("curData", "lcData")
RETURN lcData
HTH

>I want to pull a query into XML in my data tier, then return in to the GUI tier.
>
>I'm going to use CURSORTOXML, but I want the resulting table to have a different structure than the source table.
>
>I want to set it up this way so that when I convert from VFP to SQL Server database, I can leave the GUI relativly untouched.
>  ** Pull data in COM object
>  LOCAL sRetVal AS String
>  sRetVal = ""
>
>  SELECT *;
>    FROM Customers;
>    WHERE CustId = cCustId;
>    INTO CURSOR Temp1
>
>  =CURSORTOXML("Temp1", "sRetVal")
>
>  RETURN sRetVal
>
>  ** Convert to desired structure here.
>  sRetVal = oDLL.GetCusters(cCustId)
>
>  =XMLTOCURSOR(sRetVal, "NewTable")
>Anyone know how to do this?
Previous
Reply
Map
View

Click here to load this message in the networking platform