Simple ASP loads an Access database and generates an XML file, a simple ASP loads an Access database, generates XML, and then loads the XML data into the list component paradigm to learn .
ASP code:
<% @language = "VBScript" @codepage = "65001"%>
<%
' Open an explicit variable declaration
Option Explicit
' Set Output type
Response.contenttype= "Text/xml"
' Defines three variables, conn (Connection object), ConnStr (ConnectionString), SQL (an SQL statement)
Dim conn,connstr,rs,sql,i
' Defines the value of the ConnectionString
I=1
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" &server.mappath ("Test.mdb") & ";"
' Establish a Server connection object
Set Conn=server.createobject ("ADODB. Connection ")
' Set up DataSet objects
Set Rs=server.createobject ("ADODB. RecordSet ")
' Open Data connection
Conn.Open ConnStr
' The meaning of this sentence is to get the values of the first 100 Song1name,dong1url fields in ascending order of the ID field values in the word datasheet. Values are attached to a DataSet object as a property of the dataset.
Sql= "SELECT top [Song1name],[dong1url] from [test] ORDER by id DESC"
' Cursor type and lock type are set to 1, which is a forward-only read-only behavior, the fastest read
Rs.Open sql,conn,1,1
Response.Write ("<?xml version= ' 1.0 ' encoding= ' utf-8 '?>< ', Amoy >")
' Do a while loop, and the condition loops to the last item that meets the criteria
Do as not rs.eof
' This is the modified section so that the output file can be identified by the Loadvars object in Flash.
Response.Write ("< song information >< song name >" &rs ("Song1name") & "</song name >< address >" &rs ("Dong1url")) & "</address ></song information >"
' Record Move Down
Rs.movenext
I=i+1
' Loop method with Do while echoes, the main loop body
Loop
Response.Write ("</Amoy >")
' Close the DataSet object
Rs.close
' Close the database connection
Conn.close
' Releasing DataSet resources
Set rs=nothing
' Free database connection resources
Set conn=nothing
%>
The first chastity in Flash plus the following code
//Definition component
Var my_TextArea:mx.controls.TextArea
var my_List:mx.controls.List;
var my_xml:xml = new XML ();
My_xml.load ("Http://www.111cn.net");
My_xml.onload = function (Ok:boolean) {
if (OK) {
for (i=0; I[TD] My_list.additem ({Label:this.firstChild.chil Dnodes.childnodes[0].childnodes[0].nodevalue, Data:this.firstchild.childnodes.childnodes[1].childnodes[0]. NodeValue});
}
}
};
var my_object:object = new Object ();
My_object.change = function (eventobj:object): Void {
My_textarea.text + = eventobj.target.selecteditem.label+ " \ n ";
};
My_list.addeventlistener ("Change", my_object);