updating a progress bar during an import.

meacho

Registered User.
Local time
Today, 11:54
Joined
Oct 17, 2007
Messages
13
is ther any way of making a progrss bar that will "Grow" during the import of a text file? the files i'm bringing across are about 30 Mb (over a LAN) so i want the user to know that the import is working. i havent found any way doing this ideas?

i did have a thought that it it might be possible to monitor the amount of data coming over the network and periodically compare this to the size of the file being imported.? but i cant find anything like that on the net

any help is much appreciated

Matt
 
if you are using vba that reads and writes files a line at a time then you can do it, as you can add things to the program loop

if you are using a docmd.transfertext then you can't do it that way, as the line of code is "atomic"

perhaps you can use a form timer event during the transfertext to intercept the operation and measure and compare the amount of data transferred, but i am not sure how you would be able to measure the data tranfer.

i presume there must be some way of doing it, as access itself draws a progress bar during a long query, for example
 
yep i'm using transfertext but have had no luck finding a way to measure the amount of data transfered? very annoying because as you point out access seems to do it in the progress bar. i'll keep hunting for an answer there must be a way!
 
When a question appears to be out of the ordinary for an MS Access program, but obviously something that someone wants/needs, then I find that searching the VB6 forums is useful. I did this and found this thread:

I am not sure if the code is suitable for conversion into VBA but it may give you some ideas.
 
because i'm running a transfertext i don't think i can use that code. is there any way i can get the little acccess progress bar to apear in a form?

when i run my forms it hides the access window so that it doen't look like an access database. this means that the status bar is also hidden if i could get that to display on the form that would be problem solved

thanks for the help
 
One of the problems with Access and progress bars is that the program is single threaded and most programs when using progress bars for certain operations require a second thread so that it can update while the other process is still running.
 
Another problem is that Access doesn't COMMIT the import until it has it all and can do sanity checks on it. The temp table created for this process isn't closed yet so you can't even get its size or record count from a Timer-based routine.

You could open the file directly and do the import in a VBA loop, from which the progress bar is trivial. But... VBA loops vs. the .Transferxxx methods are inordinately slow. The built-in methods are compiled to machine code. VBA is semi-compiled and interpreted at best, so you take a huge performance hit this way.

I'm afraid I don't have a lot to offer, either.
 

Users who are viewing this thread

Back
Top Bottom