|
8#
楼主 |
发表于 2003-1-8 01:16:12
|
只看该作者
[求助]怎么用ASP向ACCESS数据库写内容呀?
还是应该改这部分呀?- <%
- dim conn
- dim connstr
- connstr="DBQ="+server.mappath("vote.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
- set conn=server.createobject("ADODB.CONNECTION")
- conn.open connstr
- dim rs
- dim sql
- dim selecta
- dim selectb
- dim selectc
- dim selectd
- dim selecte
- dim total
- set rs=server.createobject("adodb.recordset")
- sql="select * from vote where id=1"
- rs.open sql,conn,1,1
- if not rs.eof then
- total=rs("selecta")+rs("selectb")+rs("selectc")+rs("selectd")+rs("selecte")
- selecta=(rs("selecta")/total)*100
- selectb=(rs("selectb")/total)*100
- selectc=(rs("selectc")/total)*100
- selectd=(rs("selectd")/total)*100
- selecte=(rs("selecte")/total)*100
- response.write "<table cellspacing=0 cellpadding=0 border=1 valign='middle' width='100%' height='100%' align='center' bordercolor='#ffffff' ><tr><td bgcolor='#f7f3f7' bordercolor='#808080'>"
- response.write "<p align=center>::: 调 查 结 果 :::</p>" %>
- <br>
复制代码 |
|