Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML UpdateGrams
Message
De
10/05/2001 16:01:58
 
 
À
10/05/2001 10:10:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00505758
Message ID:
00505972
Vues:
31
Jerry, I can answer some of these questions for you.

>>>>
I am needing a strategy to update SQL 2000 from VFP. My boss wants me to consider using XML in this process. The XMLUpdategram may be the thing to use but I can't seem to find good documentation on it. I've found almost nothing in the VFP 7 help, SQL 2000 help, and the MSDN site. Is there a document out there that can help me?
<<<<<

This will be documented better in the RTM version of VFP. Here is an excerpt of the current syntax:

XMLUPDATEGRAM( ) FunctionSee
Mirrors changes made in a buffered table or cursor to an XML UpdateGram.

XMLUPDATEGRAM( [cAliasList [, nFlags]])
Returns String.

Parameters

cAliasList
Specifies a comma-separated list of open tables or cursors, by name or work area numbers in any combination, to include in the updategram. If you specify no value or an empty string for cAliasList, Visual FoxPro uses all open tables and cursors in the current datasession that contain buffered changes.

nFlags
Specifies options for the XML to be output.

Here is a short code example:
**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*!* Setup HTTP connection to SQL Server - note can also use ADO.
LOCAL oXMLHTTP as msxml2.XMLHTTP
SET MULTILOCKS ON
DBServer = "http://someServer/"
DBVRoot = "nwind"
HTTPQueryStart = "?template="
oXMLHTTP = createObject("msxml2.XMLHTTP")
*!* Cursor that you need to update
USE customers
*!* turn on buffering, set keyfield list
CURSORSETPROP("Buffering",5,'customers')
CURSORSETPROP("KeyFieldList","customerid",'customers')
*!* update some data
replace contactname with "none"
*!* create updategram
strUpdg = XMLUPDATEGRAM('alltypesxm')
?strUpdg
*!* assemble http request
HTTPUpdg = strUpdg
URL = DBServer + DBVRoot + HTTPQueryStart + HTTPUpdg
*!* update the server
oXMLHTTP.open("POST", URL, .f.)
oXMLHTTP.send("")
?oXMLHTTP.status
?oXMLHTTP.statustext
**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

>>>>>
Also, do you know if the XML Updategram is the primary way Microsoft intends for us to update SQL in the future if we choose to use XML or is there another plan? My boss wants to know.Thanks for any help,
<<<<<

I can't speak for SQL Server on this, but I can give you my impression. I don't think that SQL will be saying that this should be the "primary" way, but rather one of a number of ways to update SQL Server. There are scenarios where this would be the most practical way to do this, and others where it may not be necessary. On the other hand, XML is becoming more and more important going forward, and I suspect that over time XML will become one of the primary communication mediums for SQL Server.

Hope this info helps.

GeneG/Microsoft
Gene Goldhammer
Program Manager
Microsoft Visual Studio Data Team

Content posted here is "AS IS" and confers no rights nor warranties.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform