<%
' Определяем константы ADO.
Const adopenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = 1
Const adPersistXML = 1
Const adExecuteStream = &H400
' создание объектов
Dim cmd,conn
Set cmd = Server.CreateObject("ADODB.Command")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "sqloledb"
conn.Open "Data Source=server;Initial catalog=pubs;", "user", "password"
Set cmd.ActiveConnection = conn
cmd.CommandType = adCmdText
cmd.CommandText = "select au_fname, au_lname, address " _
& "from authors where
au_fname like 'M%' for xml auto"
cmd.Properties("Output Stream") = Response
cmd.Properties("xml root") = "root"
cmd.Execute , , adExecuteStream
Set cmd = nothing
Set conn = nothing
%>
|