<%@ 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]