asp中如何用Access数据库中的数据控制柱形图,请给出详细代码,谢谢!!! 请问asp中怎样通过access数据库里面的数据做统计图表?

\u8bf7\u9ad8\u624b\u5e2e\u4f5c\u4e00\u4e2a\u5e26Access\u6570\u636e\u5e93\u80fd\u63a7\u5236\u7684ASP \u67f1\u72b6\u56fe\u4ee3\u7801\u3002

Asp\u751f\u6210\u67f1\u72b6\u56fe\u5b9e\u4f8b\u4ee3\u7801\u4e0b\u8f7d\u5730\u5740
http://down.chinaz.com/soft/25526.htm
http://www.94x.net/so.php?word=asp

Access\u7684\u6570\u636e\u900f\u89c6\u529f\u80fd\u6bd4Excel\u8fd8\u8981\u5f3a\u608d\u4e00\u4e9b\u3002\u503c\u5f97\u5b66\u4e60\u638c\u63e1\uff5e

<script language=javascript>
function table1(total,table_x,table_y,thickness,table_width,all_width,all_height,table_type){
//参数含义(传递的数组,横坐标,纵坐标,柱子的厚度,柱子的宽度,图表的宽度,图表的高度,图表的类型)
//纯JAVASCRIPT代码生成图表函数1——柱状图
//运行环境为IE 6.0

//注意:倒立柱状图dataArray显示顺序错了, -- William

//***************************************************************************************
var tmdColor1 = new Array();
tmdColor1[0] = "#d1ffd1"; tmdColor1[1] = "#ffbbbb"; tmdColor1[2] = "#ffe3bb";
tmdColor1[3] = "#cff4f3"; tmdColor1[4] = "#d9d9e5"; tmdColor1[5] = "#ffc7ab";
tmdColor1[6] = "#ecffb7";
var tmdColor2 = new Array();
tmdColor2[0] = "#00ff00"; tmdColor2[1] = "#ff0000"; tmdColor2[2] = "#ff9900";
tmdColor2[3] = "#33cccc"; tmdColor2[4] = "#666699"; tmdColor2[5] = "#993300";
tmdColor2[6] = "#99cc00";
var tb_color = new Array(tmdColor1,tmdColor2);
var line_color = "#69f";
var left_width = 70;
var length = thickness/2;
var total_no = total[0].length;
var temp1 = 0;
var temp2,temp4,temp4;
for(var i = 0;i<total_no;i++) {
if(temp1<total[0][i]) {
temp1 = total[0][i];
}
}
temp1 = parseInt(temp1.toString());
if(temp1>9){
temp2 = temp1.toString().substr(1,1)
if(temp2>4) {
temp3 = (parseInt((temp1/(Math.pow(10,(temp1.toString().length-1)))).toString())+1)*Math.pow(10,(temp1.toString().length-1));
}
else {
temp3 = (parseInt((temp1/(Math.pow(10,(temp1.toString().length-1)))).toString())+0.5)*Math.pow(10,(temp1.toString().length-1));
}
}
else{
if(temp1>4)
temp3 = 10;
else
temp3 = 5;
}
temp4=temp3
document.write("<!--[if gte vml 1]><v:rect id='_x0000_s1027' alt='' style='position:absolute;left:" + (table_x+left_width) + "px;top:" + table_y + "px;width:" + all_width + "px;height:" + all_height + "px;z-index:-1' fillcolor='#9cf' stroked='f'><v:fill rotate='t' angle='-45' focus='100%' type='gradient'/></v:rect><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width) + "px," + (table_y+all_height) + "px' to='" + (table_x+all_width+left_width) + "px," + (table_y+all_height) + "px'/><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width) + "px," + table_y + "px' to='" + (table_x+left_width) + "px," + (table_y+all_height) + "px'/><![endif]-->");

switch (table_type){
case "A":
var table_space = (all_width-table_width*total_no)/total_no;
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length) + "px,"+ table_y + "px' to='" + (table_x+left_width+length) + "px," + (table_y+all_height-length) + "px' strokecolor='" + line_color + "'/><![endif]-->");

for(var i=0;i<=all_height-1;i+= all_height/5) {
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width)+ "px," + (table_y+all_height-length-i) + "px' to='" + (table_x+left_width+length) + "px," + (table_y+all_height-i) +"px' strokecolor='" + line_color + "'/><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length) + "px," + (table_y+all_height-length-i) + "px' to='" + (table_x+all_width+left_width) + "px," + (table_y+all_height-length-i) + "px' strokecolor='" + line_color + "'/><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+(left_width-15)) + "px," + (table_y+i) + "px' to='" + (table_x+left_width) + "px," + (table_y+i) + "px'/><![endif]-->");
document.write("<!--[if gte vml 1]>");
document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + table_x + "px;top:" + (table_y+i) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + temp4 + "</td></tr></table></v:textbox></v:shape><![endif]-->");
temp4 = temp4-temp3/5;
}
for(var i=0;i<total_no;i++) {

var temp_space = table_x + left_width + table_space / 2 + table_space * i + table_width * i;
document.write("<v:rect id='_x0000_s1025' alt='' style='position:absolute;left:");
document.write(temp_space);
document.write("px;top:");
document.write(table_y + all_height * (1 - (total[0][i] / temp3)));
document.write("px;width:" + table_width + "px;height:" + all_height * (total[0][i] / temp3) + "px;z-index:1' fillcolor='" + tb_color[1][i] + "'>");
document.write("<v:fill color2='" + tb_color[0][i] + "' rotate='t' type='gradient'/>")
document.write("<o:extrusion v:ext='view' backdepth='" + thickness + "pt' color='" + tb_color[1][i] + "' on='t'/>");
document.write("</v:rect>");
document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + temp_space + "px;top:" + (table_y+all_height*(1-(total[0][i]/temp3))-table_width) + "px;width:" + (table_space+15) + "px;height:18px;z-index:1'>");
document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='center'>" + total[0][i] + "</td></tr></table></v:textbox></v:shape>");
document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (temp_space-table_space/2) + "px;top:" + (table_y+all_height+1) + "px;width:" + (table_space+table_width) + "px;height:18px;z-index:1'>");
document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='center'>" + total[1][i] + "</td></tr></table></v:textbox></v:shape>");
}

break;
case "B":
var table_space = (all_height - table_width * total_no) / total_no;
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length) + "px," + (table_y+all_height-length) + "px' to='" + (table_x+left_width+all_width) + "px," + (table_y+all_height-length) + "px' strokecolor='" + line_color + "'/><![endif]-->");
for(var i=0;i<=all_width-1;i +=all_width/5) {
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+i) + "px," + (table_y+all_height-length) + "px' to='" + (table_x+left_width+length+i) + "px," + (table_y+all_height) + "px' strokecolor='" + line_color + "'/><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+length+i) + "px," + (table_y+all_height-length) + "px' to='" + (table_x+left_width+length+i) + "px," + table_y + "px' strokecolor='" + line_color + "'/><![endif]-->");
document.write("<!--[if gte vml 1]><v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='" + (table_x+left_width+i+all_width/5) + "px," + (table_y+all_height) + "px' to='" + (table_x+left_width+i+all_width/5) + "px," + (table_y+all_height+15) + "px'/><![endif]-->");
document.write("<!--[if gte vml 1]>");
document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x+left_width+i+all_width/5-left_width) + "px;top:" + (table_y+all_height) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + temp4 + "</td></tr></table></v:textbox></v:shape><![endif]-->");
temp4 = temp4 - temp3 / 5;
}

for(var i=0;i<total_no;i++) {
var temp_space = table_space/2 + table_space * i + table_width * i;
document.write("<v:rect id='_x0000_s1025' alt='' style='position:absolute;left:");
document.write(table_x + left_width);
document.write("px;top:");
document.write(table_y + temp_space);
document.write("px;width:" + all_width * (total[0][i] / temp3) + "px;height:" + table_width + "px;z-index:1' fillcolor='" + tb_color[1][i] + "'>");
document.write("<v:fill color2='" + tb_color[0][i] + "' rotate='t' angle='-90' focus='100%' type='gradient'/>");
document.write("<o:extrusion v:ext='view' backdepth='" + thickness + "pt' color='" + tb_color[1][i] + "' on='t'/>");
document.write("</v:rect>");
document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x + left_width + all_width * (total[0][i] / temp3) + thickness / 2) + "px;top:" + (table_y + temp_space) + "px;width:" + (table_space + 15) + "px;height:18px;z-index:1'>");
document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='center'>" + total[0][i] + "</td></tr></table></v:textbox></v:shape>");

document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + table_x + "px;top:" + (table_y + temp_space) + "px;width:" + left_width + "px;height:18px;z-index:1'>");
document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>" + total[1][i] + "</td></tr></table></v:textbox></v:shape>");
}

}
}
</script>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:* { behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
.shape { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>
<%
Dim a(3,2)
a(0,0)="aaaa"
a(0,1)="20"

a(1,0)="bbb"
a(1,1)="30"

a(2,0)="ccc"
a(2,1)="40"
%>
<script language=javascript>
//=============调用方法=====================
var dataArray = new Array()

var nameArray = new Array()
<%
for i=0 to ubound(a)-1%>
nameArray[<%=i%>]="<%=a(i,0)%>"; ///这里是列名
dataArray[<%=i%>]=<%=a(i,1)%>; ///这里是数据大小
<%
next%>
var total= new Array(dataArray,nameArray)
table1(total,200,20,20,30,400,200,"A"); ///这里是主状图大小
</script>
</body>
</html>

  • 鎬庝箞鏍烽氳繃asp鎶婂啓鍏Access鏁版嵁搴撶殑鍐呭,鍐欏叆server鏁版嵁搴撲腑鐨勮〃
    绛旓細from user where id=10",鑰屽SQL SERVER鏁版嵁搴撹繘琛屽垹闄ゆ槸鐢細"delete user where id=10".4.鏃ユ湡鍑芥暟涓嶇浉鍚岋紝鍦ㄥACCESS鏁版嵁搴撳鐞嗕腑锛屽彲鐢╠ate()銆乼ime()绛夊嚱鏁帮紝浣嗗SQL SERVER鏁版嵁搴撳鐞嗕腑锛屽彧鑳界敤datediff,dateadd绛夊嚱鏁帮紝鑰屼笉鑳界敤date()銆乼ime()绛夊嚱鏁般5.鍦ㄥACCESS鏁版嵁搴撳鐞嗕腑,sql璇彞涓...
  • ASP濡備綍瀹炵幇璇诲彇骞朵笖鏄剧ずACCESS?
    绛旓細棣栧厛閾炬帴鏁版嵁搴 dataaccess = server.mappath("data/xxxx.mdb")'杩炴帴OLEDB Set oConn = Server.CreateObject("ADODB.CONNECTION")oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dataaccess 鍏舵鎵撳紑琛ㄥ苟璇诲彇璁板綍 sql = "select top 100 * from [tablebb] where 1=1"Set oRs ...
  • 濡備綍鐢╝sp缁access鏁版嵁搴撴彃鍏ユ暟鎹?
    绛旓細1銆ASP杩炴帴ACCESS鏁版嵁搴擄紝杩炴帴瀛楃涓叉槸鍏抽敭 2銆佽繛鎺ュ悗鎵цSQL璇彞 3銆佸叧闂暟鎹簱杩炴帴瀵硅薄 绀轰緥浠g爜锛歞im Conn,strConn,strSQL strConn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("\db\myaccess.mdb")Set Conn = Server.CreateObject("ADODB.Connection")strSQL="insert ...
  • asp濡備綍璋冪敤ACCESS鏁版嵁搴?
    绛旓細dim ConnStr dim conn ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " &dbpath Set conn = Server.CreateObject("ADODB.Connection")conn.open ConnStr 杩欐牱灏辫繛鎺ヤ笂ACCESS鏁版嵁搴撲簡銆傘傜劧鍚庡彲浠ユ牴鎹渶姹 鎵ц璇彞 鎴栬呰幏寰楄褰曢泦 ...
  • 绠鍗曠殑asp鍔access璇诲彇鏁版嵁搴鎬庝箞鍋?
    绛旓細鏂板缓access鏁版嵁搴撴椂锛屼换鎰忔墦寮涓涓猘ccess鏁版嵁搴擄紝鐐瑰嚮鈥滄枃浠垛--鈥滄柊寤衡---"绌烘暟鎹簱" 鏁版嵁搴撳氨鍒涘缓濂戒簡锛佸湪鏁版嵁搴撲腑鍙互閫夋嫨濡備綍鍘诲垱寤鸿〃锛佹濊矾锛1.鍋氫竴涓敞鍐岄〉闈,鍖呭惈涓涓〃鍗曘傝〃鍗曚腑涓や釜鏂囨湰妗嗙敤鏉ヨ緭鍏ョ敤鎴峰悕瀵嗙爜 2.涓涓敞鍐岄獙璇侀〉闈傜敤鏉ュ垽鏂敤鎴峰悕鏄惁瀛樺湪锛屽苟灏嗘敞鍐屼俊鎭啓鍏ヨ〃 鎴鐨娉ㄥ唽...
  • 濡備綍鎶access鏁版嵁搴撲腑鏌愪釜鏁版嵁搴旂敤涓asp缃戦〉涓?
    绛旓細鐩存帴<%=rs("瀛楁鍚")%> 褰撶劧鍓嶆彁鏄綘瑕佺‘淇濆凡缁忛摼鎺ヤ簡鏁版嵁搴擄紝锛屾墦寮浜嗚褰曢泦銆傜粰浣犱釜绠鍗鐨渚嬪瓙锛<% Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("data/user.mdb") set rs=server.CreateObject("...
  • asp濡備綍鑾峰彇access鏁版嵁搴撶殑鏁版嵁??璇烽珮鎵嬫寚鏁
    绛旓細sql="select*from tablename where data=data"銆'绗簩涓猟el涓轰綘鎯宠鏌ヨ鐨勬暟鎹,涔熷彲涓哄涓紝鐢ㄢ滐紝鈥濆彿鍒嗗紑 rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "鏁版嵁涓嶅瓨鍦"else rs.delete response.write rs("data")銆'濡傛灉鏈夊涓浉鍚岀殑鏁版嵁锛岃繖鍙敤for 鈥︹ext 寰幆璇彞 ...
  • ASP鎬庢牱璁块棶access鏁版嵁搴撶殑鏁版嵁
    绛旓細鐒跺悗灏卞彲浠ユ搷浣鏁版嵁搴鐨鏌ヨ 淇敼 娣诲姞 鏇存柊绛 濡傦細sql="select * from 琛"set rs=server.creatObject("adodb.recordset")rs.open sql,conn,1,1 do while not rs.eof response.write rs(0)&"br/>"rs.movenext loop rs.close set rs=nothing 杩欎釜渚嬪瓙灏辨槸鏌ヨ鏌愪竴涓〃鐨勬墍鏈夌殑琛岀殑 绗竴涓...
  • 濡備綍鐢ˋSP鎿嶄綔ACCESS鏁版嵁搴
    绛旓細< '浠ヤ笅涓鸿繛鎺鏁版嵁搴鐨浠g爜锛屼笉鐢ㄧ悊瑙o紝copy灏辫 set conn = server.CreateObject("ADODB.Connection")str = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.MapPath("database.mdb")conn.open str '鏋勯燬QL璇彞,鍋囪name,sex,position涓烘枃鏈瓧娈碉紝age涓烘暟瀛楀瓧娈 sql = "INSERT INTO...
  • 鐢ASP鍚鏁版嵁搴(ACCESS)涓坊鍔犳暟鎹
    绛旓細濡傝繕鏄棤娉曟洿鏂伴偅鏄洜涓轰綘鐨勬暟鎹搴撴枃浠舵墍鍦ㄧ殑鐩綍鏉冮檺瀵圭壒瀹氱殑鐢ㄦ埛娌℃湁寮鍚冻澶熺殑鏉冮檺锛屼綘鍙兘杩涜鍙璁块棶锛屼竴鑸嚭鐜拌繖绉嶆儏鍐电殑鏂囦欢绯荤粺涓篘TFS锛岄偅鎬庝箞瑙e喅鍛紵棣栧厛锛屼綘鎵惧埌鏁版嵁搴撴墍鍦ㄧ洰褰曪紝涔熷彲浠ユ槸涓婂眰鐩綍锛岀劧鍚庤缃枃浠跺す 瀹夊叏 灞炴э紝鏈绠鍗曠殑鏄妸everyone鐨勬潈闄愯缃垚瀹屽叏鍗冲彲锛岄偅瀵逛簬杩欎釜闂锛屽簲璇ヤ娇...
  • 扩展阅读:永久免费access进销存软件 ... access入口 ... 免费进入access ... autodesk access ... access视频 ... access免费永久激活 ... access上机考试题库 ... access最新版 ... 怎么自学access编程 ...

    本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网