<script language = "JavaScript"> var onecount; onecount=0; array1 = new Array(); <%for i=0 to rscount1-1 %> array1[<%=i%>]= array[<%=i%>] </script>
非常感谢大家,我现在把代码贴出来: <% set conn = Server.CreateObject("ADODB.connection") conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\局浏览系统\500\规划定点\db1.mdb;" set RsTmp = Server.CreateObject("ADODB.Recordset") RsTmp.Source ="SELECT 工程编号,工程名称,建设单位名称 FROM 规划定点 ORDER BY 工程名称" RsTmp.activeconnection=conn RsTmp.CursorType = 0 RsTmp.CursorLocation = 2 RsTmp.LockType = 3 RsTmp.Open() arrTmp1=RsTmp.GetRows() RsTmp.Close() conn.close() set RsTmp=nothing %><script language=javascript> var resultarray = new array() </script>因为arrTmp1是一个多维数组,我现在想把它赋给数组 resultarray,这样的代码究竟该怎样写,我刚刚学编程,还没经验,麻烦大家了
<script language=javascript> var resultarray = new Array(3) //字段数 for(var i=0;i<3;i++) resultarray[i]=new Array() <% dim intCount for intCount to ubound(arrTmp1,2) %> resultarray[0][<%=intCount%>]=<%=arrTmp1(0,intCount)%>; resultarray[1][<%=intCount%>]=<%=arrTmp1(0,intCount)%>; resultarray[2][<%=intCount%>]=<%=arrTmp1(0,intCount)%>; <% next %> </script>
var onecount;
onecount=0;
array1 = new Array();
<%for i=0 to rscount1-1 %>
array1[<%=i%>]= array[<%=i%>]
</script>
<%
set conn = Server.CreateObject("ADODB.connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\局浏览系统\500\规划定点\db1.mdb;"
set RsTmp = Server.CreateObject("ADODB.Recordset")
RsTmp.Source ="SELECT 工程编号,工程名称,建设单位名称 FROM 规划定点 ORDER BY 工程名称"
RsTmp.activeconnection=conn
RsTmp.CursorType = 0
RsTmp.CursorLocation = 2
RsTmp.LockType = 3
RsTmp.Open()
arrTmp1=RsTmp.GetRows()
RsTmp.Close()
conn.close()
set RsTmp=nothing
%><script language=javascript>
var resultarray = new array()
</script>因为arrTmp1是一个多维数组,我现在想把它赋给数组 resultarray,这样的代码究竟该怎样写,我刚刚学编程,还没经验,麻烦大家了
var resultarray = new Array(3) //字段数
for(var i=0;i<3;i++)
resultarray[i]=new Array()
<%
dim intCount
for intCount to ubound(arrTmp1,2)
%>
resultarray[0][<%=intCount%>]=<%=arrTmp1(0,intCount)%>;
resultarray[1][<%=intCount%>]=<%=arrTmp1(0,intCount)%>;
resultarray[2][<%=intCount%>]=<%=arrTmp1(0,intCount)%>;
<% next %>
</script>
resultarray[0][<%=intCount%>]=<%=arrTmp1(0,intCount)%>;
resultarray[1][<%=intCount%>]=<%=arrTmp1(1,intCount)%>;
resultarray[2][<%=intCount%>]=<%=arrTmp1(2,intCount)%>;