多种方法!!!
<%
Connstr="DBQ="+server.mappath("aaa.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;"
set conn=server.createobject("adodb.connection")
conn.open Connstr
sqlstr="select * from bbb"
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,3
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="toupiao.asp">
<%
dim a,b,c,d
a=rs("text01")
b=rs("text02")
c=rs("text03")
d=rs("text04")
%>
<table width="68%" border="1" align="center">
<tr>
<td width="11%">编号</td>
<td width="15%">竞选人</td>
<td width="12%">性别</td>
<td width="12%">投票</td>
<td width="12%">票数</td>
<td width="38%">百分百</td>
</tr>
<tr>
<td>1</td>
<td>你</td>
<td>男</td>
<td><input type="radio" name="text" value="1"></td>
<td><%=rs("text01")%>票</td>
<td><img src="images/xcvdz.jpg" width="<%=100*left(a/d,5)%>" height="8"><%=left(a/d,5)*100%>%</td>
</tr>
<tr>
<td>2</td>
<td>我</td>
<td>男</td>
<td><input type="radio" name="text" value="2"></td>
<td><%=rs("text02")%>票</td>
<td><img src="images/xcvdz.jpg" width="<%=100*left(b/d,5)%>" height="8"><%=left(b/d,5)*100%>%</td>
</tr>
<tr>
<td>3</td>
<td>她</td>
<td>女</td>
<td><input type="radio" name="text" value="3"></td>
<td><%=rs("text03")%>票</td>
<td><img src="images/xcvdz.jpg" width="<%=100*(1-left(a/d,5)-left(b/d,5))%>" height="8"><%=(1-left(a/d,5)-left(b/d,5))*100%>%</td>
</tr>
<tr>
<td colspan="4">合计票数:</td>
<td><%=rs("text04")%>票</td>
<td> </td>
</tr>
<tr>
<td colspan="6">
<input type="submit" name="Submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>
<%rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
另一个页面是:
<%
Connstr="DBQ="+server.mappath("aaa.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;"
set conn=server.createobject("adodb.connection")
conn.open Connstr
sqlstr="select * from bbb where autoid=1"
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,3
select case request("text")
case 1
rs("text01")=rs("text01")+1
case 2
rs("text02")=rs("text02")+1
case 3
rs("text03")=rs("text03")+1
case else
response.write"<script>window.alert('请选择一项.');window.location.href='default.asp'</script>"
end select
rs("text04")=rs("text01")+rs("text02")+rs("text03")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script>window.alert('恭喜\n\n投票成功,点击返回');window.location.href='default.asp'</script>"
%>
大家看盾有没有别的办法啊!!!