Actually I was the one who posted the particular code you are referencing and I do at times populate the the arrays directly from a database.
Perhaps you can use GIGN's example of how each element of the array can be populated in JavaScript straight from the Database and recordset.
The array that I am using is geared for numerous Dropdowns and that is why you see it hold three elements. LeftKey, DropDownValue and RightKey. Once loaded the dropdowns are dynamically changed depending on previous selections and with out having to refresh or reload the page.
LeftKey represent the index of (Parent) item selected
DropDownValue represents the value for the target DropDown
RightKey represents the index for item of the target.
The way I do (May there are easier ways) is to create a UserDefined Type and then create an array based on that type.
Here is some sample code to play with, might give you an idea
//Create a User Defined Type called objArray
function objArray()
{
this.Name = "f";
this.LKey = "f";
this.Value = "f";
this.RKey = "f";
}
//Create an Array based on the objArray and fill it
function Fill_objArray()
{
//var thisRecord = recordCount[j];
this.DDArray = new Array();
//for(var i = 0; i < recordCount; i++)
for(var i = 0; i < 10; i++)
{
//thisRecord = recordCount
;
DDArray = new objArray();
DDArray.Name = "DD3_Array";
DDArray.LKey = 1; //write thisrecord("fieldName"
DDArray.Value = "Sample"; // etc..
DDArray.RKey = i; // etc..
}
}
//Test how it works
function Test_objArray()
{
for(var i = 0; i < 10; i++) {
alert(DDArray.Name + " " + DDArray.LKey + " " + DDArray.Value + " " + DDArray.RKey);
}
}