<%
'1.创建连接对象 Connection
set cn=Server.CreateObject("ADODB.Connection")
cn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA
SOURCE="&server.MapPath ("/mdb/wssdk.mdb")
'2.创建记录集对象 Recordset
set rs=Server.CreateObject("ADODB.Recordset")
'3.打开计数表,向网站数字段赋值,用Update写入
rs.open"select 网站数 from 计数表",cn,adOpenDynamic,3
rs("网站数")=rs("网站数")+1
rs.Update
rs.close
rs.open"select 网站数 from 计数表",cn,3
Counter=rs("网站数")
Function G_Split(CounterValue,CounterBits)
for i=1 to CounterBits
G=Mid(CounterValue,i,1)
If G="" Then
G=0
ImgTag= "<img src='"&G&".gif' width='15' height='20'>" & ImgTag
Else
ImgTag=ImgTag & "<img src='"&G&".gif' width='15' height='20'>"
End If
Next
G_Split=ImgTag
End Function
%>
计数器:<%=G_Split(Counter,6)%>
<%
rs.close
cn.close
set rs=nothing
%> |