这是我的原码,请帮忙看一下。
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="6" colspan="2"></td>
</tr>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Connstr = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../database/newtraining.mdb")
Conn.Open Connstr
set rs=server.CreateObject("ADODB.recordset")
sql="select distinct(trainingname),http,trainingcode,day,price from training"
rs.open sql,conn
num=rs.recordcount
%>
<tr>
<td width="778"><table width="100%" border="1" cellpadding="0" cellspacing="0" bgcolor="#B1D9D9" class='a'>
<tr>
<td width="5%">编号</td>
<td width="24%">研讨会项目名称</td>
<td width="7%">价格(元)</td>
<td width="4%"><div align="center">天数</div></td>
<td width="5%"><div align="center">1月</div></td>
<td width="5%"><div align="center">2月</div></td>
<td width="5%"><div align="center">3月</div></td>
<td width="5%"><div align="center">4月</div></td>
<td width="5%"><div align="center">5月</div></td>
<td width="5%"><div align="center">6月</div></td>
<td width="5%"><div align="center">7月</div></td>
<td width="5%"><div align="center">8月</div></td>
<td width="5%"><div align="center">9月</div></td>
<td width="5%"><div align="center">10月</div></td>
<td width="5%"><div align="center">11月</div></td>
<td width="5%"><div align="center">12月</div></td>
</tr>
<tr>
<%do while not rs.eof%>
<td><a href=<%=rs("http")%> class='a' target='_blank'><%=rs("trainingcode")%></a></td>
<td><a href=<%=rs("http")%> class='a' target='_blank'><%=rs("trainingname")%></a></td>
<td><div align="center"><%=rs("price")%></div></td>
<td><div align="center"><%=rs("day")%></div></td>
<%
set rs6=server.CreateObject("adodb.recordset")
sql= "select * from training"
rs6.open sql,conn
%>
<%
strdate=trim(rs6("trainingdate"))
ipos=instr(strdate,"月")
ipos1=instr(strdate,"日")
ilen=ipos1-ipos-1
n=month(rs6("truedate"))
for i=1 to n-1
response.write("<td width=?> &nbsp;</td>")
next
response.write("<td width=?>") &Mid(strDate, iPos + 1, iLen)
response.write("</td>")
for i=n+1 to 12
response.write("<td width=?>&nbsp;</td>")
next
%>
</tr>
<%
rs.movenext
loop
%>
</table></td>
</tr>
</table>