By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,025 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Showing a processing icon while data is being transferred

P: 36
The data is transferred from one table to another when user clicks on a button on the screen. The transfer takes approax 10-15 seconds. During this time I am able to move the mouse but not able to click on any buutons on the screen. It gives me a feeling as if system is hanged.

Is it possible to show some processing icon during this 10-15 seconds when data is being transferred so that user does not doubt whether data transfer is taking place or system is hanged?
Sep 13 '07 #1
Share this Question
Share on Google+
14 Replies


hariharanmca
100+
P: 1,977
The data is transferred from one table to another when user clicks on a button on the screen. The transfer takes approax 10-15 seconds. During this time I am able to move the mouse but not able to click on any buutons on the screen. It gives me a feeling as if system is hanged.

Is it possible to show some processing icon during this 10-15 seconds when data is being transferred so that user does not doubt whether data transfer is taking place or system is hanged?
I think the below link will help you.
Load Gif
Sep 13 '07 #2

QVeen72
Expert 100+
P: 1,445
Hi,

Why not change the Mouse Icon, before starting the transfer:

Expand|Select|Wrap|Line Numbers
  1. Me.MousePointer = vbHourGlass
  2.  
later, after completion :

Expand|Select|Wrap|Line Numbers
  1. Me.MousePointer = vbNormal
  2.  
U can also Load Animated mouse pointer and set it

Regards
Veena
Sep 13 '07 #3

hariharanmca
100+
P: 1,977
  • We have to show progress bar if we know the limit of process or we have to show some .gif file for the indication of process.
  • We have to make the mouse pointer to hourglass is default for all process.
Sep 13 '07 #4

Expert 5K+
P: 8,434
Me.MousePointer = vbNormal
:) Technically, it should be vbDefault. Doesn't really matter much of course, since they have the same value.

Abhishek Bhatt, perhaps you could give us some idea of the actual "data transfer" process that is happening during that 0-15 seconds? For instance, is this a database command of some sort? Is it one big "call" that takes that long to return control to your code, or is your program spending 10-15 seconds going around a loop of some sort? What version of VB are you using? For that matter, what version of windows? (Although the Windows version probably won't make any difference, unless you're stuck in the dark ages with Windows 3.1 or something.)

By the way, it might be worth looking into the Animation control.
Sep 13 '07 #5

P: 36
:) Technically, it should be vbDefault. Doesn't really matter much of course, since they have the same value.

Abhishek Bhatt, perhaps you could give us some idea of the actual "data transfer" process that is happening during that 0-15 seconds? For instance, is this a database command of some sort? Is it one big "call" that takes that long to return control to your code, or is your program spending 10-15 seconds going around a loop of some sort? What version of VB are you using? For that matter, what version of windows? (Although the Windows version probably won't make any difference, unless you're stuck in the dark ages with Windows 3.1 or something.)

By the way, it might be worth looking into the Animation control.

My program is fetching all records from one table and inserting it onto another table.
VB version is 6.3
Sep 13 '07 #6

Expert 5K+
P: 8,434
My program is fetching all records from one table and inserting it onto another table.
VB version is 6.3
Ok, but the question is how?

Does your program just issue one big INSERT (or whatever) statement to the database, then get control back when it's all done? Or does your program loop around and do a database command to copy each record? This will make a difference to what you can do during the process.

Um... 6.3 - does that mean it's VBA, which is built into MS Access? Or is it standalone Visual Basic? I thought the last version of "real" Visual Basic was 6.0.
Sep 14 '07 #7

Expert 100+
P: 303
You could put a spinner gif, or something similar, in a div that starts out hidden. Just before you start the process, such as on button click, you can change the div to visible. When the process ends, switch the div back to hidden. Maybe not the best solution, but it works.
Sep 14 '07 #8

Expert 5K+
P: 8,434
You could put a spinner gif, or something similar, in a div that starts out ...
A "div"? We are talking about VB6 here, right?
Sep 14 '07 #9

Robbie
100+
P: 180
A "div"? We are talking about VB6 here, right?
He could be referring to the link Hari gave in his/her first post.
Even if that's so though, it would be easier and probably look nicer just to hide the entire WebBrowser control.
Sep 14 '07 #10

P: 36
Ok, but the question is how?

Does your program just issue one big INSERT (or whatever) statement to the database, then get control back when it's all done? Or does your program loop around and do a database command to copy each record? This will make a difference to what you can do during the process.

Um... 6.3 - does that mean it's VBA, which is built into MS Access? Or is it standalone Visual Basic? I thought the last version of "real" Visual Basic was 6.0.
Ok. My program reads the data from a table of another database and insert all the records one by one in a table of my database.

Yes it's a VBA.

I have written my code in a module. On click of a menu item in the application the code of the module gets executed.
Sep 14 '07 #11

P: 36
Hi,

Why not change the Mouse Icon, before starting the transfer:

Expand|Select|Wrap|Line Numbers
  1. Me.MousePointer = vbHourGlass
  2.  
later, after completion :

Expand|Select|Wrap|Line Numbers
  1. Me.MousePointer = vbNormal
  2.  
U can also Load Animated mouse pointer and set it

Regards
Veena
Thanks Veena...The solution worked.
I had to put
Screen.MousePointer = 11
at the start of the code

and
Screen.MousePointer = 0
at the end of the code
Sep 14 '07 #12

pureenhanoi
100+
P: 175
Ok. My program reads the data from a table of another database and insert all the records one by one in a table of my database.

Yes it's a VBA.

I have written my code in a module. On click of a menu item in the application the code of the module gets executed.
I have no idea about making animation during the transfer. But there is another way to prevent hanging system from Loop
Its terrible if you select more than several hundreds of rows into recordset and use loop to insert one by one into another table. It take alot of time and hanging the system until transfering completed.
The context here is: you have two database db1.mdb and db2.mdb (db1 is working database, and db2 is external database)
Expand|Select|Wrap|Line Numbers
  1. Dim cnxn As New ADODB.Connection
  2. Dim sql As String
  3.  
  4. 'working with current database
  5. cnxn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\db1.mdb"
  6. cnxn.Open
  7.  
  8. sql = "INSERT INTO tablename1(colunm1,column2...) (SELECT column1,column2... FROM tablename2 IN 'c:\db2.mdb' WHERE condition=True)"
  9. cnxn.Excute sql
  10.  
by selecting and inserting multi-record, u can prevent from loop and save lot of time
Sep 14 '07 #13

P: 36
But my one database is SQL server and another Sybase.
Can I do something to transfer data in bulk instead of fetching it into recordset and then inserting each record one by one?
Sep 17 '07 #14

Expert 5K+
P: 8,434
But my one database is SQL server and another Sybase.
Can I do something to transfer data in bulk instead of fetching it into recordset and then inserting each record one by one?
Perhaps you could invoke an Export function in one, and an Import in the other, and let them do the work for you.
Sep 17 '07 #15

Post your reply

Sign in to post your reply or Sign up for a free account.