SQLXML code sample in ASP

DETAILS

<%

Response.ContentType = "text/xml"
Dim oCmd, sSQL 

sSQL = "<root><sql:query xmlns:sql='urn:schemas-microsoft-com:xml-sql'>" & _
       "Select Lastname, Firstname, City from Employees order by Firstname FOR XML AUTO </sql:query></root>" 

Set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = ("Provider=sqlxmloledb.3.0;data provider=sqloledb;Data Source=SQL Server;user id=SQL user;password=password;Initial Catalog=database") 

oCmd.CommandText = sSQL
oCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}" 

oCmd.Properties("Output Stream") = Response
oCmd.Execute , , 1024 

Set oCmd = Nothing

%>

  • 0 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

Insert data into a MS SQL database with .NET SQL Data Provider in ASP.NET

 DETAILS  <%@ import namespace="system.data.sqlclient" %><Script...

Send Email in ASP.NET

DETAILS<%@ Page Language="VB" %><script...

Query MS SQL Database with PHP

DETAILSBelow is a simple PHP script to demonstrate how to connect to a MS SQL database using an...

Query MS Access Database in PHP

DETAILSBelow is a simple PHP script to demonstrate how to connect to a MS Access database using...

Send mail using CDO

DETAILS<% set objMessage = createobject("cdo.message")set objConfig =...