如何把Recordset转换成彩色的XML文件

网络编程 2021-07-05 11:26www.168986.cn编程入门

<%@ codepage="65001" %>

<!-- #INCLUDE FILE="ADOVBS.INC" -->

<%

Response.ContentType = "text/xml"

' 如果不在 adovbs.inc ,则设置一个常量.

 

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

Con.Open "Provider=sqloledb;UID=sa;DATABASE=Pubs"

' 建立数据库连接,如到SQL.

 

Set RS = Server.CreateObject( "ADODB.Recordset" )

' 建立并打开Recordset.

RS.ActiveConnection = Con

RS.CursorType = adOpenStatic

RS.Open "select from titles"

 

Response.Write "<?xml version='1.0' encoding='ISO-8859-1'?>" & vbCRLF

' 发送给Response对象.

RS.Save Response, adPersistXML

%>

[1]

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by