I am trying to over write an existing index in a mdb table. I don’t quite have the syntax down. I see the table as a 2X2 array, so I tried to treat it as such. But I am not sure I am parsing the table correctly. Here is the code. Is there an easier way? I tried the RS.Find() but that did not return anything. Any help would be much appreciated.
function onSubmit()
{
var AOI = document.getElementsByName(“AOI”);
var Layer = document.getElementsByName(“Layer”);
var AIOholder = AOI[0];
var Layerholder = Layer[0];
//Path is correct
var myConnect = “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=”+DBPath;
var ConnectObject = new ActiveXObject(“ADODB.Connection”);
var sql=”SELECT * FROM 1_OverView_Board_For_Status;”;
ConnectObject.Open(myConnect);
var RS = ConnectObject.Execute(sql);
var fieldCount = RS.Fields.Count;
alert(“AOI ” + AIOholder.value);
alert(“Layer ” + Layerholder.value);
alert(“Field Count ” + fieldCount);
var recordCount = RS.Fields.Count;
var x = 0;
var header;
var getFieldNames = false;
//RS.Find(“Layer=street”)
while (!RS.EOF)
{
if (x >= recordCount)
{
x = 0
}
if (!getFieldNames)
{
while (x <= recordCount-1)
{
if( RS.Fields(x).Name == Layerholder.value)
{
alert(“Here” + RS.Fields(x).Name);
x=0;
while (x <= recordCount-1)
{
alert(“Looking for ” + RS.Fields(x).Value + ” AOI: ” + AIOholder.value);
if( RS.Fields(x).Value == AIOholder.value)
{
[B]RS.Fields(x).Value= ‘QC’;
[B]Here is where I want to alter the value
return;
}
x++
}
}
x++;
}
}
RS.MoveNext();
}
alert(“Exiting”);
RS.Close();
ConnectObject.Close();
return;
}