阅读背景:

asp sql server连接和表

来源:互联网 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
 <title>SOP</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="left">

<%
selectdata= "Select * from dbo.sop"


set RScontest = Server.CreateObject("ADODB.Recordset")
RScontest.ActiveConnection = "dsn=test123 ;uid=test123;pwd=test123"
RScontest.Source = SelectData
RScontest.CursorType = 3
RScontest.CursorLocation = 2
RScontest.LockType = 1
RScontest.Open()
if not(rscontest.bof) and not(rscontest.eof) then%>
%>

<table BORDER="1" align="center" width="640">
<caption>SOP</caption>
<tr>
<td>Order</td>
<td>Department</td>
<td>DOC Type</td>
<td>Title</td>
<td>Revision</td>
<td>DOC</td>
<td>Active</td>

<%
 while not rscontest.eof
%>

<tr>
<td>
<%= rs("order") %>
</td>

<td>
<%= rs("Department") %>
</td>

<td>
<%= rs("[DOC Type]") %>
</td>

<td>
<%= rs("Title") %>
</td>

<td>
<%= rs("Revision") %>
</td>

<td>
<%= rs("DOC") %>
</td>

<td>
<%= rs("Active") %>
</td>

 <%
' Move to the next record
rs.movenext
' Loop back to the do statement
loop %>
</table>

</body>
</html>

<%
' Close and set the recordset to nothing
rs.close
set rs=nothing
%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: