Pelle
03-25-2005, 02:40 PM
I need to load a recordset into a Java Script array called "My_JS_Array" but don't know how to achieve that. The real problem for me is how I can increase the index of the array evertime the recordset moves to the next record. I hope someone knows and want to tell me how that should be done (and that my thread is placed in the correct forum :) )
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<script language="javascript" type="text/javascript">
var My_JS_Array = new Array();
</script>
</head>
<body>
<%
SQL = "SELECT * FROM MyTable"
rs.open SQL, con
Do while not rs.EOF
' Assume that the recordset now contains 4 records with these values (value0, value1, value2 and value3).
' How can this recordset be loaded into My_JS_Array. The JS-array should adapt dynamically, that is
' the array index should be increased by one every time the recordset loops (index 0 should store "value0" etc.).
%>
<%
rs.movenext
Loop
con.close
%
</body>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<script language="javascript" type="text/javascript">
var My_JS_Array = new Array();
</script>
</head>
<body>
<%
SQL = "SELECT * FROM MyTable"
rs.open SQL, con
Do while not rs.EOF
' Assume that the recordset now contains 4 records with these values (value0, value1, value2 and value3).
' How can this recordset be loaded into My_JS_Array. The JS-array should adapt dynamically, that is
' the array index should be increased by one every time the recordset loops (index 0 should store "value0" etc.).
%>
<%
rs.movenext
Loop
con.close
%
</body>
</html>