Results 1 to 11 of 11

Thread: Need suggestion from vbforums members.

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Need suggestion from vbforums members.

    Hi all,

    I'm going developed a function that the user will get notification message if some event happened. The event happened due with machine breakdown notified by production supervisor. The Production supervison will insert message to database.

    My question is,

    1) it is i need to create a timer to select data from database every predefined interval ?
    2) It is when supervisor insert data to database will send message to server ( Windows Server 2003 ) to ask the server response to selected user ?
    If the second method is better, how can I do with this ?
    3) Any others better suggest mind to give me a hand or guide ?

    Thanks you.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Need suggestion from vbforums members.

    1) Why do you need a timer? You said in preceding paragraph that an event will be the basis for the notification system.

    As to 2) and 3) ... depends entirely by what you mean by a notification system... auto-Email? Notification table exists in database (eg. Private Message feature of VB Forums)? Event triggers GUI update/pop-ups?

  3. #3

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Need suggestion from vbforums members.

    Thans leinad,
    For my limitted knowledge, timer is my first idea to get new message from notification table exists in database.Thus, I wish someone can give me better idea than this. I'm using pop ups from woka.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Need suggestion from vbforums members.

    You can have a stored procedure return the number of notifications (COUNT) for a given user, if COUNT > 0 stop the timer and retrieve first notification record, call another stored procedure that untags the notification so its excluded in next COUNT, and finally display populated pop-up.

  5. #5

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Need suggestion from vbforums members.

    Thanks Leinad,

    This is quite complexity for me and also my first try of using store procedure. I will try myself of your suggested method. Thanks Leinad ....
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  6. #6

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Need suggestion from vbforums members.

    I had done to use store procedure.

    A timer will place at mdiform, when user login to system. The timer will reload every 5 seconds, when found new untag record the form will pop up a message to notify user against event happened.

    This method will cause the system become slower ?

    Leinad is this what you means ...
    Please try to point out my wrong.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Need suggestion from vbforums members.

    Yes. In that scenario application repeatedly checks database using timer. You can disable the timer right before CPU intensive processing in your app then re-enable it after.

    You might also want to consider Email notifications if you don't want to implement timers in your app just like vbforums private messages. But this is more suitable for web applications since email can have clickable links that will take user directly to notifications page in web app.

  8. #8

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Need suggestion from vbforums members.

    You can disable the timer right before CPU intensive processing in your app then re-enable it after.
    How can I do for this ?


    By Email notification still need to use timer for retrieve new mail from server ?
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  9. #9
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Need suggestion from vbforums members.

    Quote Originally Posted by nUflAvOrS
    You can disable the timer right before CPU intensive processing in your app then re-enable it after.
    How can I do for this ?
    Code:
    Private Sub SampleButton_Click()
       Timer1.Enabled = False
       'do long process
       Timer1.Enabled = True
    End Sub
    Quote Originally Posted by nUflAvOrS
    By Email notification still need to use timer for retrieve new mail from server ?
    No but your database has to support/provide the Email feature (additional database package. what is your database btw?) and several other requirements. What happens is when a notification record is inserted an insert trigger will call another procedure... this procedure retrieves recipient email based on userid or some other criteria so those info has to be in the database... procedure then sends email to recipient... procedure finishes, trigger finishes... this all happens in the database so no need for timer.

  10. #10

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: Need suggestion from vbforums members.

    Thanks Leinad :-) very clear explain and guide

    I had done with the 1st method. But i din set timer enabled = false because i need query stored procedure as long system is running.

    I'm Using SQL Express 2005.
    Is my database platforms suitable for email feature you were suggesting ?
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  11. #11
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Need suggestion from vbforums members.

    Research or ask around... with Oracle you can upload a Java SendMail package into the database. I'm not sure if SQL Express has a similar feature.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width