Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 2005 Execute timer in VB 6 code

Status
Not open for further replies.

jadams0173

Technical User
Feb 18, 2005
1,210
I have a program that displays a schedule in a nice visual format that is easy to see and understand that is written in VB6. It updates from a form timer every 5 minutes. I've re-written the actual scheduling program in VB 2005. The 2005 application feeds the database with data that the VB6 application displays.

What I would like to do is when the data is updated by the VB 2005 application, instead of waiting on the timer to fire is it possible to somehow fire the update so the schedule is always as up to date as possible.

So the really problem/question is, Can a vb 2005 app through some means cause a timer event to fire in a VB 6 app?

If this is really vague and hard to understand please let me know and I will try to explain it better.
 

How about a different approach.

Your VB 6 app updates all information displayed every 5 minutes either there is new info to show or not (I assume here). So if no information changes for, let’s say 2 hours, those 5 minutes intervals do not really do anything, just re-display the same data.

You can have a little table (one field, a Date and Time) that you update with current date and time every time you update your DB from your VB.NET 2005 app. Then your VB 6 app can check this field and compare it to some kind of variable stored in your VB 6 app and ‘see’ if there is any new info in your DB just by checking one field in one table. Then your timer in your VB 6 app can run every – well, I don’t know – 30 seconds and as soon as the date changes in your DB, go and fetch new info and remember my new Date/Time in my local variable. If no updates are done for 2 hours, you check one field every 30 seconds and do nothing.

It is not really my idea, somebody else from Tek Tips wrote about this approach some time ago, but I don’t remember who.


Have fun.

---- Andy
 
Hey Andy! Thanks for the response. That approach, I don't think, would work for me. There is more data than just mine in the VB 6 app. It shows estimated completion time, how many pieces are left of the current job, and almost every step the job takes as it moves through a process. That said there is always (95%) new data or different data to display. My main concern that I'm trying to eliminate with my question is the order in which the jobs are ran. If the folks doing the work look up at the monitor and see for example:

Line 1 Line2
Job 1 Job 8
Job 2 Job 9
Job 3 Job 10

and then the vb6 app refreshes. For whatever reason the scheduler puts Job 2 on line 2 and Job 9 on Line 1, the folks that are most impacted could be delayed 5 minutes before seeing the information. What I'm trying to do is as soon as teh scheduler makes the change and hits the UPDATE button in the VB 2005 application. I want the VB 6 app to refresh.
 
Hey RiverGuy. Meaning you would build like a listener into the VB 6 app and some type of "broadcaster" into 2005 app?
 
Yes, I think dilettante has a good idea if it can be done. I haven't done this between .Net and VB6 specifically, but I did have much luck in the past sending commands to a display-only visual application from my control application via UDP (.Net on both apps).
 
Thanks RiverGuy. I think that's what I'm going to try to do. Hopefully I can work something out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top