# 我的代码闹鬼了..帮忙看下!

fs2006 2006-04-20 05:47:17
<!--#include file="conn.asp" -->
sql="select * from Chu_ku where spdingdan1='"&request("id")&"'"
rs.open sql,conn,1,1
response.write rs.recordcount
%>
<%
Function daxie(smoney)
Dim x, y
Const zimu = ".sbqwsbqysbqwsbq" '定义位置代码
Const letter = "0123456789sbqwy.zjf" '定义汉字缩写
Const upcase = "零壹贰叁肆伍陆柒捌玖拾佰仟萬億元整角分" '定义大写汉字
Dim temp
Dim i
smoney=Replace(FormatNumber(smoney,2),",","")
temp = Left(temp, InStr(smoney, ".") - 1)
x=smoney
y = ""
For i = 1 To Len(x)-3
y = y & Mid(x, i, 1) & Mid(zimu, Len(x) - 2 - i, 1)
Next
If Right(x, 3) = ".00" Then
y = y & "z"
Else
y = y & Left(Right(x, 2), 1) & "j" & Right(x, 1) & "f"
End If
y = Replace(y, "0q", "0")
y = Replace(y, "0b", "0")
Do While y <> Replace(y, "00", "0")
y = Replace(y, "00", "0")
Loop
y = Replace(y, "0y", "y")
y = Replace(y, "0w", "w")
If Len(x) = 5 And Left(y, 1) = "1" then y=Right(y, Len (y)- 1)
If Len(x) = 4 then
y=Replace(y, "0.", "")
else
y=Replace(y, "0.", ".")
end if
For i = 1 To 19
y = Replace(y, Mid(letter, i, 1), Mid(upcase, i, 1))
Next
daxie = y
End Function
%>
<html xmlns="http://www.w3.org/1999/xhtml">

<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {font-size: x-large}
body,td,th {
font-size: 13px;
}
-->
</style>

<body>
<table width="90%" border="0" align="left">
<tr>
<td align="center"><span class="style1"><font size="90" face="楷体_GB2312">出库单</font></span></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" align="center">
<tr>
<td width="47%">摘要：</td>
<td width="53%" align="right">公司内部出库单号码:      <%=rs("spdingdan1")%> </td>
</tr>
<tr>
<td>购买单位：<%=rs("spout")%></td>
<td align="right">商场订单号:      <%=rs("spchuku2")%> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="573" height="79" border="1" align="center" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td width="165" height="29" align="center">商品全名</td>
<td width="81" align="center">规格</td>
<td width="81" align="center">单位</td>
<td width="81" align="center">数量</td>
<td width="81" align="center">单价</td>
<td width="81" align="center">金额</td>
</tr>
<% do while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td height="16" align="center"><%=rs("spname1")%></td>
<td align="center"><%=rs("spguige")%></td>
<td align="center"><%=rs("spdanwei")%></td>
<td align="center"><%=rs("spshuliang1")%><%=rs("spzhuang1")%></td>
<td align="center"><%=rs("spdanjia1")%></td>
<td align="center"><%=rs("spjiage1")%></td>
</tr>
<%rs.movenext
loop
%>
<tr bgcolor="#FFFFFF">
<td rowspan="2">合计:</td>
<td height="16" colspan="5"><%=rs("sptotal")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="16" colspan="5"><%response.write daxie(rs("sptotal"))%></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22"><table width="100%" border="0" align="center">
<tr>
<td width="36%">出库日期：<%=rs("spchukuday")%></td>
<td width="32%">经手人：<%=rs("spoperator")%></td>
<td width="32%">收货人:</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

<% do while not rs.eof
%>
...

<%rs.movenext
loop
%>

BOF 或 EOF 中有一个是“真”，或者当前的记录已被删除，所需的操作要求一个当前的记录。

...全文
71 8 点赞 打赏 收藏 举报

8 条回复

mhxz568 2006-04-20

• 打赏
• 举报

fs2006 2006-04-20
HOHHOH,还是马小玲强,HOHOHO~~~~
• 打赏
• 举报

mhxz568 2006-04-20

• 打赏
• 举报

fs2006 2006-04-20

• 打赏
• 举报

wanghui0380 2006-04-20

<tr bgcolor="#FFFFFF">
<td rowspan="2">合计:</td>
<td height="16" colspan="5"><%=rs("sptotal")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="16" colspan="5"><%response.write daxie(rs("sptotal"))%></td>
</tr>

• 打赏
• 举报

umbrella1984 2006-04-20
do while的工作原理你还不清楚

• 打赏
• 举报

fs2006 2006-04-20

• 打赏
• 举报

jay_lishijie 2006-04-20
rs.open sql,conn,1,1

• 打赏
• 举报

ASP

2.8w+

ASP即Active Server Pages，是Microsoft公司开发的服务器端脚本环境。

2006-04-20 05:47