VB Timer Control - HELP!! 
Author Message
 VB Timer Control - HELP!!

Hi,

Does anyone here know WHY the timer control VB5 stops ticking at midnight?
I've searched everywhere for info on this and can't find anything about it.

Is this normal behaviour for the timer or what???

I'm using the timer to perform a regular database update from various remote
terminals, everything works perfectly until midnight, when the timer stops.
At the moment I'm having to restart the damned program every morning, but if
I'm not at work, it doesn't get restarted because I AM the entire computer
department and no-one else has access!!

BTW: If it's any help, the program is running under NT4 server (SR3), which
is usually locked out.

Any ideas people???

Regards

Lorne Smith



Tue, 22 May 2001 03:00:00 GMT  
 VB Timer Control - HELP!!
More than likely, the timing code needs some attention.

What does it look like?

LFS

Quote:

> Hi,

> Does anyone here know WHY the timer control VB5 stops ticking at midnight?
> I've searched everywhere for info on this and can't find anything about it.

> Is this normal behaviour for the timer or what???

> I'm using the timer to perform a regular database update from various remote
> terminals, everything works perfectly until midnight, when the timer stops.
> At the moment I'm having to restart the damned program every morning, but if
> I'm not at work, it doesn't get restarted because I AM the entire computer
> department and no-one else has access!!

> BTW: If it's any help, the program is running under NT4 server (SR3), which
> is usually locked out.

> Any ideas people???

> Regards

> Lorne Smith



Tue, 22 May 2001 03:00:00 GMT  
 VB Timer Control - HELP!!
Hi,

I've never seen this.  Can you be more specific (as Larry says, post your
code)?

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition (355 pages).
For information look on my homepage at
http://ourworld.compuserve.com/homepages/richard_grier.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com.



Tue, 22 May 2001 03:00:00 GMT  
 VB Timer Control - HELP!!
I'm in agreement with Richard and Larry here....

...sounds like you may be doing a check on the time (ie: if Now >
anothertime).

If you are doing this, it's gonna fail at midnight because the time
effectively is resetting to 00:00:00

HTH

Steve

http://nt1.pncl.co.uk/sbutler

Quote:

>Hi,

>I've never seen this.  Can you be more specific (as Larry says, post your
>code)?

>--
>Richard Grier
>Hard & Software
>12962 West Louisiana Avenue
>Lakewood, CO  80228
>303-986-2179 (voice)
>303-986-3143 (fax)
>Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
>Edition (355 pages).
>For information look on my homepage at
>http://ourworld.compuserve.com/homepages/richard_grier.
>Use the Books link to order.  For faster service contact the publisher at
>http://www.mabry.com.



Thu, 24 May 2001 03:00:00 GMT  
 VB Timer Control - HELP!!

Hmm, you may be right Steve,  Anyway, here's the code....

Private Sub timerAutoScan_Timer()
    ' This routine checks if it's time to scan for active paperwork
    ' If it's time, then control is passed to the scan routine
    timerAutoScan.Enabled = False
    If Time >= AutoScanCheckTime Then    ' Compare the current time with the time to scan variable
        ' Trigger the update scan procedure
        InitiateScan                    
        ' Update the next scanning check time.  The variable 'AutoScanDelay' contains a numeric value for minutes, default value is 10 (minutes)
        AutoScanCheckTime = DateAdd("n", AutoScanDelay, Time)
        cSysTray1.TrayTip = App.Title & " -  Active List last updated on: " & Time
    End If
    timerAutoScan.Enabled = True
End Sub

The 'InitiateScan' procedure is in a .bas module.  All this does is actually performs the scan for updates and triggers the update procedure if new records found.

The variable 'AutoScanCheckTime' simply holds the time the next scan is to be performed... As Steve's suggestion, I suspect this may be the problem, as you can see when this variable is updated.

If that's the case, any suggestions for reworking this bit of code?

Regards

Lorne



Fri, 25 May 2001 03:00:00 GMT  
 VB Timer Control - HELP!!

This is a real rookie posting this but can you qualify your time by saying

If Time >= AutoScanCheckTime AND AutoScanCheckTime <> 00.00.00 Then
    etc

The code is most probably rubbish but if you can get a check into your code that identifies the time that's causing the problem and get it to ignore it then it may sort it out.

Pete

    Hmm, you may be right Steve,  Anyway, here's the code....

    Private Sub timerAutoScan_Timer()
        ' This routine checks if it's time to scan for active paperwork
        ' If it's time, then control is passed to the scan routine
        timerAutoScan.Enabled = False
        If Time >= AutoScanCheckTime Then    ' Compare the current time with the time to scan variable
            ' Trigger the update scan procedure
            InitiateScan                    
            ' Update the next scanning check time.  The variable 'AutoScanDelay' contains a numeric value for minutes, default value is 10 (minutes)
            AutoScanCheckTime = DateAdd("n", AutoScanDelay, Time)
            cSysTray1.TrayTip = App.Title & " -  Active List last updated on: " & Time
        End If
        timerAutoScan.Enabled = True
    End Sub

    The 'InitiateScan' procedure is in a .bas module.  All this does is actually performs the scan for updates and triggers the update procedure if new records found.

    The variable 'AutoScanCheckTime' simply holds the time the next scan is to be performed... As Steve's suggestion, I suspect this may be the problem, as you can see when this variable is updated.

    If that's the case, any suggestions for reworking this bit of code?

    Regards

    Lorne



Fri, 01 Jun 2001 03:00:00 GMT  
 VB Timer Control - HELP!!

Thank's for the info Pete.

BTW: I'm NOT a rookie with VB, I just haven't used the timer control much...

Regards

Lorne

    This is a real rookie posting this but can you qualify your time by saying

    If Time >= AutoScanCheckTime AND AutoScanCheckTime <> 00.00.00 Then
        etc

    The code is most probably rubbish but if you can get a check into your code that identifies the time that's causing the problem and get it to ignore it then it may sort it out.

    Pete



Sun, 03 Jun 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Benefits of the timer object, bompared to the timer control

2. Calling a sub from a the timer event of a timer control

3. System.Timers.Timer in VB .NET ignores errors

4. Waitable Timer / Timer HELP

5. VB Timer control seems to hang

6. vb Timer Control

7. Timer Control in VB 2.0

8. VB Timer Control - Any better method?

9. VB Timer Control

10. VB Timer Control

11. Timer Control... HELP

12. Please TIMER CONTROL HELP!

 

 
Powered by phpBB® Forum Software