Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:19:29+00:00 2026-05-26T15:19:29+00:00

I’m having some issues with some javascript/jquery and a database connection. Basically I am

  • 0

I’m having some issues with some javascript/jquery and a database connection.

Basically I am trying to:

connect to a database -
update progress bar -
open a recordset - 
update progress bar.

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.

The code I have at the moment is:

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

My JavaScript 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;
    }
}

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.

Some quick things for Variables:
CrntAItem is a <span> in the code and the function above works off the click.
agnttype can equal either “agnt” or “dept”

Any help would be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:19:29+00:00Added an answer on May 26, 2026 at 3:19 pm

    Try running the “heavy” tasks asynchronously by using timers.

    Change the relevant block of code to this:

    //....no change here....
    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"); 
    
    //change to use timer:
    window.setTimeout(function() {
        cn.Open(strConn);
        pgrssvalue = pgrssvalue + startvalue;
        $("#progressbar").progressbar({value: pgrssvalue});
        window.setTimeout(function() {
            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");
            else {
                rs.movefirst
                var x=rs.recordcount;
                //logic using x here......
            }
        }, 100);
    }, 100);
    

    Note the “logic using x here” comment – by using asynchronous code you will have to change the logic as well and do everything in the timer itself – post the code using the recordcount if you need further guidance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.