Javascript not updating page and progress bar
<p>I'm having some issues with some javascript/jquery and a database connection. </p>

<p>Basically I am trying to:</p>

<pre>
connect to a database -
update progress bar -
open a recordset - 
update progress bar.
</pre>

<p>Only issue is that the progress bar and some other text won't update. I've tried looking around but can't find an answer that suits what I am doing. </p>

<p>The code I have at the moment is: </p>

<pre><code>&lt;link rel="stylesheet" href="serveraddress\jquery.ui.all.css"&gt;
&lt;script src="localaddress\jquery-1.6.2.js"&gt;&lt;/script&gt;
&lt;script src="localaddress\jquery.ui.core.js"&gt;&lt;/script&gt;
&lt;script src="localaddress\jquery.ui.widget.js"&gt;&lt;/script&gt;
&lt;script src="localaddress\jquery.ui.datepicker.js"&gt;&lt;/script&gt;
&lt;script src="localaddress\jquery.ui.progressbar.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="localaddress\jquery.selectBox.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="localaddress\jquery.selectBox.css"&gt;&lt;/script&gt;
</code></pre>

<p>My JavaScript code:</p>

<pre><code>var global = this;
global.CrntAItem = 'Date'
function changeagent(agnttype,aitem){
    global.atype = "agnt"
    var innerHTMLstring = ""
    if(global.CrntAItem!='Date') {
        document.getElementById(CrntAItem).style.color = '#818181';}
    else{global.CrntAItem=aitem;}
    global.CrntAItem=aitem
    if(agnttype=='agnt'){
        document.body.style.cursor = 'wait'
        document.getElementById(CrntAItem).style.color = '#F79433';
        document.getElementById(CrntAItem).innerHTML = 'Loading...';
        var dbConnString =""
        var startvalue = 50
        var pgrssvalue = 0
        var SQL = "select * from 1ccAgentsQuery";
        var rs = new ActiveXObject("ADODB.Recordset"); 
        var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source ='client side database path here';Jet OLEDB:Database Password=passwordhere;Persist Security Info=False"; 
        var cn = new ActiveXObject("ADODB.Connection"); 
        cn.Open(strConn); 
        pgrssvalue = pgrssvalue + startvalue
        $( "#progressbar" ).progressbar({value: pgrssvalue})
        rs.Open(SQL,cn,1,1)
        global.pgrssvalue = global.pgrssvalue + startvalue
        $( "#progressbar" ).progressbar({value: global.pgrssvalue})

        if(rs.eof==true){alert("No Agents in Work Type");return;}
        rs.movefirst
        var x=rs.recordcount;
    }
}
</code></pre>

<p>Sorry if this is basic or a total mess, I'm learning as I am going and I have a few restrictions (which is why I am using certain code over others.</p>

<p>Some quick things for Variables:<br>
<code>CrntAItem</code> is a <code>&lt;span&gt;</code> in the code and the function above works off the click.<br>
<code>agnttype</code> can equal either "agnt" or "dept"</p>

<p>Any help would be great. </p>
