Groups | Blog | Home
all groups > flash data integration > september 2005 >

flash data integration : From ASP to XML - from XML to Flash


Mgala
9/22/2005 12:00:00 AM
Try,

<?xml version="1.0" ?>

I am using the standard deamweaver recordset and repeat region to create my
xml.

Marty

Here is an example:

<%
Dim rsCustomers__MMColParam
rsCustomers__MMColParam = "0"
If (Request("e") <> "") Then
rsCustomers__MMColParam = Request("e")
End If
%>
<%
Dim rsCustomers__MMColParam1
rsCustomers__MMColParam1 = "8"
If (Request("m") <> "") Then
rsCustomers__MMColParam1 = Request("m")
End If
%>
<%
Dim rsCustomers__MMColParam2
rsCustomers__MMColParam2 = "21"
If (Request("d") <> "") Then
rsCustomers__MMColParam2 = Request("d")
End If
%>
<%
Dim rsCustomers__MMColParam3
rsCustomers__MMColParam3 = "2005"
If (Request("y") <> "") Then
rsCustomers__MMColParam3 = Request("y")
End If
%>
<%
Dim rsCustomers
Dim rsCustomers_numRows

Set rsCustomers = Server.CreateObject("ADODB.Recordset")
rsCustomers.ActiveConnection = MM_connDB_STRING
rsCustomers.Source = "SELECT * FROM moecustomer WHERE
moecustomer.custExpress = " + Replace(rsCustomers__MMColParam, "'", "''") + "
AND ((Month(custAddDate) = " + Replace(rsCustomers__MMColParam1, "'", "''") +
") AND (Day(custAddDate) = " + Replace(rsCustomers__MMColParam2, "'", "''") +
") AND (Year(custAddDate) = " + Replace(rsCustomers__MMColParam3, "'", "''") +
")) ORDER BY custAddDate DESC, custID DESC"
rsCustomers.CursorType = 0
rsCustomers.CursorLocation = 2
rsCustomers.LockType = 1
rsCustomers.Open()

rsCustomers_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsCustomers_numRows = rsCustomers_numRows + Repeat1__numRows
%>
<%
Response.Write("<?xml version=""1.0""?>")
Response.Write("<results_packet>")
%><%
While ((Repeat1__numRows <> 0) AND (NOT rsCustomers.EOF))
%><%
if rsCustomers.Fields.Item("custCompany").Value <> "" then
mycompany = rsCustomers.Fields.Item("custCompany").Value
else
mycompany = rsCustomers.Fields.Item("custLname").Value & "," &
rsCustomers.Fields.Item("custFname").Value
end If
Response.Write("<rec
CustID="&Chr(34)&rsCustomers.Fields.Item("custID").Value&Chr(34)&"
Company="&Chr(34)&mycompany&Chr(34)&" />")
%><%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsCustomers.MoveNext()
Wend
%><%
Response.Write("</results_packet>")
%>
<%
rsCustomers.Close()
Set rsCustomers = Nothing
%>
chaos58
9/22/2005 12:17:49 PM
Hi people! (or in Croatian - Bok!)

So I'm trying to output XML formated data from ASP (plain ASP, not .NET). You
can have a look at my output XML http://codeave.com/asp/code.asp?u_log=149
solutions that are easy to implement but require modification for each new SQL
query. It's flexible all right but obviously not Flash friendly enough.

I have loads of questions more for you but there's always next week for that.


Thanx in advance for any help and/or comments. Enjoy the weekend!
AddThis Social Bookmark Button