Write an Active Server Page that dynamically creates an XML data island as part of the HTML page sent to the client.
What will be an ideal response?
```
1 <% @Language = "VBScript" %>
2 <% Option Explicit %>
3
4 <% ' Exercise 27.16 solution %>
5
6 <% Dim objConn, objRS
7
8 Set objConn = Server.CreateObject( "ADODB.Connection" )
9 Call objConn.Open( "productDB" )
10
11 Set objRS = Server.CreateObject( "ADODB.Recordset" )
12
13 Call objRS.Open( "SELECT * FROM products ORDER BY productName", objConn)
14 %>
15
16
17
18
19 Exercise 27.16 Solution
20
21
22
23
24
25
26 <%
27 While Not objRS.EOF
28 %>
29
30 <% =objRS( "productID" ) %>
31 <% =objRS( "productName" ) %>
32
33 <%
34 objRS.MoveNext
35 Wend
36
37 Call objRS.Close
38 Call objConn.Close
39 Set objRS = Nothing
40 Set objConn = Nothing
41 %>
42
43
44
45
46
Computer Science & Information Technology
You might also like to view...
What does it mean when we say a programmer using a function should be able to treat the function like a black box?
a) This is meaningless. One must know how a function does its job to effectively use
it.
b) One must be able to rely on the description of the preconditions (requirements for
use of the function) and the postconditions (promise of behavior to use the
function).
c) If one codes an application that uses a function with a knowledge of the internal
mechanism of that function, then when the function’s maintainer changes its
internal mechanism, the application programmer could be faced with changing the
application code extensively.
d) The most efficient programs are the ones that each function is designed to
maximally use the internal behavior of every other function to speed up the code.