浅谈如何建立三层体系结构的ASP应用程序
2006-04-08 11:59:20 来源:WEB开发网3、注册动态链接库
启动Web Server 上的Microsoft Transaction Server (Start--Windows NT Optionpack4--Internet Information Server--Internet Service Manager),展开Microsoft Transaction Server--Computer--My Computer--Package Installed,点鼠标右键选New--Package--Create Empty Package,输入包名Test(这里Test是任选的名字,不一定要与DLL同名),OK-Interactive User-the current Logon user--Finish。双击Test--Component,右键选Component-New-Component-Install New component(s)-- Add File,选择你刚编译好的DLL文件,MTS会发现DLL中有两个类Employee和Employees。至此DLL注册完毕。
4、编写ASP程序
<HTML><Body>
<p>Qualified Employee List</p>
<table border=1 cellspacing=0 cellpadding=0>
<tr>
<td>Employee ID</td>
<td>Name</td>
<td>Gender</td>
<td>Score</td>
</tr>
<%
set oEmployees=server.createobject("Test.Employees")
oEmployees.GetQualifiedList
set oEmployee=oEmployees.GetFirst()
do while not oEmployee is nothing
%>
<tr>
<td><%=oEmployee.EMPLID%></td>
<td><%=oEmployee.Name%></td>
<td><%=oEmployee.Gender%></td>
<td><%=oEmployee.Score%></td>
</tr>
<%
set oEmployee=oEmployees.GetNext()
loop
%>
</table>
</body></html>
更多精彩
赞助商链接