⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usinginnerjoin.asp

📁 25175 教师工资管理系统 v2.01 由25175学生成绩管理系统 v2.10 修改而成
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim rsProduct
Dim rsProduct_numRows

Set rsProduct = Server.CreateObject("ADODB.Recordset")
rsProduct.ActiveConnection = MM_conn_STRING
rsProduct.Source = "SELECT Products.ProductsID,Products.ProductsName,Products.SupplierID,Products.UnitPrice,Suppliers.SupplierName,Suppliers.Phone,Suppliers.Fax,Suppliers.Address FROM Products INNER JOIN Suppliers ON Products.SupplierID=Suppliers.SupplierID WHERE Suppliers.SupplierID = 501"
rsProduct.CursorType = 0
rsProduct.CursorLocation = 2
rsProduct.LockType = 1
rsProduct.Open()

rsProduct_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsProduct_numRows = rsProduct_numRows + Repeat1__numRows
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>关系型SQL语句-INNER JOIN</title>
</head>

<body>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="200">供货商编号</td>
    <td><%=(rsProduct.Fields.Item("SupplierID").Value)%></td>
  </tr>
  <tr> 
    <td>供货商名称</td>
    <td><%=(rsProduct.Fields.Item("SupplierName").Value)%></td>
  </tr>
  <tr> 
    <td>电话</td>
    <td><%=(rsProduct.Fields.Item("Phone").Value)%></td>
  </tr>
  <tr> 
    <td>传真</td>
    <td><%=(rsProduct.Fields.Item("Fax").Value)%></td>
  </tr>
  <tr> 
    <td>地址</td>
    <td><%=(rsProduct.Fields.Item("Address").Value)%></td>
  </tr>
</table>
<div align="center"></div>
<hr>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="200">商品编号</td>
    <td width="200">商品名称</td>
    <td width="200">单价</td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT rsProduct.EOF)) 
%>
  <tr> 
    <td><%=(rsProduct.Fields.Item("ProductsID").Value)%></td>
    <td><%=(rsProduct.Fields.Item("ProductsName").Value)%></td>
    <td><%=(rsProduct.Fields.Item("UnitPrice").Value)%></td>
  </tr>
  <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rsProduct.MoveNext()
Wend
%>
</table>
<hr>
<p align="center"><strong>运用关系型SQL语句-INNER JOIN,查询某供货商信息及其提供的商品</strong></p>
</body>
</html>
<%
rsProduct.Close()
Set rsProduct = Nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -