<iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-4490194096475053&dt=1225678076031&lmt=1219829520&prev_slotnames=1891601125&output=html&slotname=3685991503&correlator=1225678075937&url=http%3A%2F%2Fwww.corange.cn%2Farchives%2F2008%2F08%2F1434.html&ea=0&ref=http%3A%2F%2Fwww.corange.cn%2Fhtml%2Fcorange__71.html&frm=0&ga_vid=794657364.1225360561&ga_sid=1225676616&ga_hid=939561934&ga_fc=true&flash=9.0.124.0&u_h=768&u_w=1024&u_ah=715&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="300" scrolling="no" height="250" allowtransparency></iframe>
'定义变量
Dimcn,rs,Sql
Sql="selectCustomerIDfromOrders"
'记录总数
DimTotalNumbe
Setcn=Server.CreateObject("ADODB.Connection")
cn.Open"Provider=SQLOLEDB.1;UserID=sa;InitialCatalog=NorthWind;DataSource=.;Password=;"
Setrs=Server.CreateObject("ADODB.Recordset")
rs.OpenSql,cn,3,1
TotalNumber=rs.RecordCount
IfTotalNumber=0Then
Response.Write"没有记录输出。"
Else
Dimjj,nLeft,cCol
jj=0
nCol=415
nLeft=nCol-(TotalNumberModnCol)
IfnLeft=nColThennLeft=0
Response.Write"<tableborder><tr>"&vbCrLf
Whilenotrs.EOF
Response.Write"<td>"&rs("CustomerID")&"</td>"&vbCrLf
'If(jjModnCol)=(nCol-1)Andjj<>TotalNumber-1ThenResponse.Write"</tr><tr>"&vbCrLf
'If(jjModnCol)=(nCol-1)Andjj=TotalNumber-1ThenResponse.Write"</tr>"&vbCrLf
If(jjModnCol)=(nCol-1)Then
Ifjj<>TotalNumber-1Then
Response.Write"</tr><tr>"&vbCrLf
Else
Response.Write"</tr>"&vbCrLf
EndIf
EndIf
jj=jj+1
rs.MoveNext
Wend
IfnLeft<>0AndnLeft<>nColThen
IfnCol<TotalNumberThen
Fori=1tonLeft
Response.Write"<td> </td>"&vbCrLf
Next
EndIf
Response.Write"</tr>"&vbCrLf
EndIf
Response.Write"</table>"
EndIf
rs.Close
Setrs=Nothing
cn.Close
Setcn=Nothing
Response.End