Example of using XDR in SQL2000 query _ MySQL

Source: Internet
Author: User
XDR doesn't know, right? It is simplified XML-Data. Now we will demonstrate how to implement this query SELECTo. OrderID, o. OrderDatefromOrderso, Customersc, WHEREo. CustomerIDc. CustomerIDandc. CompanyName? Code: % @ LanguageVBScript % DimsConnsConnProviderSQLOLEDB XDR will not know? It is simplified XML-Data. Now we will demonstrate how to implement such a query.

SELECT o. OrderID, o. OrderDate from Orders o, Customers c,

WHERE o. CustomerID = c. CustomerID and c. CompanyName =?

Code:

<% @ Language = VBScript %>

<%

Dim sConn

SConn = "Provider = SQLOLEDB; Data Source = (local); Initial Catalog = Northwind; User ID = SA; Password = ;"



Dim adoConn

Set adoConn = Server. CreateObject ("ADODB. Connection ")

AdoConn. ConnectionString = sConn

AdoConn. CursorLocation = 3 'aduseclient

AdoConn. Open



Dim adoCmd

Set adoCmd = CreateObject ("ADODB. Command ")

Set adoCmd. ActiveConnection = adoConn

AdoCmd. CommandText = "Customer [@ CompanyName =" "Tortuga connected ante" "]"

AdoCmd. Dialect = "{ec2a4293-e898-11d2-b1b7-00c04f680c56 }"



AdoCmd. Properties ("Mapping Schema") = "Orders. xml"

AdoCmd. Properties ("Base Path") = "C: \ INETPUB \ WWWROOT \ PBA \"

AdoCmd. Properties ("Output Stream") = Response



Response. write" "

AdoCmd. Execute, 1024 'adexecutestream

Response. write" "

%>



Result:































Orders. xml




Xmlns: SQL = "urn: schemas-microsoft-com: xml-SQL">
































Relation = "Orders"/>





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.