If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Passing recordset objects to XML

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-03, 10:02
bigear bigear is offline
Registered User
 
Join Date: Feb 2003
Posts: 8
Post Passing recordset objects to XML

Hi,
I'm trying to pass ASP recordset to xml, I have no idea how to do this can anyone help, the goal is to send customised text messages from my site at the moment I can send test messages
xml file...
<?xml version ="1.0" encoding="ISO-8859-1"?>
<aspsms>
<Userkey></Userkey>
<Password></Password>
<Recipient>
<PhoneNumber></PhoneNumber>
</Recipient>
<MessageData>Test </MessageData>
<Action>SendTextSMS</Action>
</aspsms>
Reply With Quote
  #2 (permalink)  
Old 03-09-03, 20:50
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
ASP record set --> XML is easy

you would just iterate through the rs ouputting the fields as bellow;

Code:
<%
response.contenttype="text/xml"
'make the rs and query
%>
<?xml version ="1.0" encoding="ISO-8859-1"?>
<aspsms>
<%
while not blah.bof or blah.eof
%>
<Userkey><%=blah.fields("messagedata")%></Userkey>
<Password><%=blah.fields("messagedata")%></Password>
<Recipient>
<%
'make sub query if needed
while not blah2.bof or blah2.eof
%>
<PhoneNumber></PhoneNumber>
<%
 blah2.movenext
wend
%>
</Recipient>
<MessageData><%=blah.fields("messagedata")%></MessageData>
<%
 blah.movenext
wend
%>
<Action>SendTextSMS</Action>
</aspsms>
<%
'clean up etc
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On