make a popup html window based on SQL Trigger Values ?

Posted on 2004-11-18
Last Modified: 2012-06-21
i'm trying to make a small popup html window on the right bottom corner of user screen,,

this window is created based on a tigger on a table ,when ever
a row is inserted to a user a window well popup on his/her screen..

i need that to look as an Email Notification, or an alert to the user.

i'm developing in Vb.Net & SQL Server..
is there a way to do that , or any idea,,
Question by:star4
    LVL 5

    Expert Comment

    WWW is a pull technology, the user's web browser has to request a page from the server. There is no way the server can push a message to the client's machine to do the popup.

    So you need to fake it. You would have to have an HTML page that used a javascript timer, or a meta refresh to reload itself. When reloaded, if it needed to alert the user it would have to create a new window via javascript and position it in the bottom corner.

    It would also have to have at least a title bar and close button, you could remove the toolbar and address bar, but it's never going to look quite like an Email Notification alert.

    You can find the screen width and height from the screen object, so you'd create a new window and place it in the corner something like:

    var left = screen.width - desiredwindowwidth;
    var top = screen.height - desiredwindowheight
    var hwnd ='alertwindow.html','alert','left='+left+';top='+top);

    You woun't be able to fire it from the trigger.

    Author Comment

    if it is not possible , how is Microsoft MSN messanger is working ????
    What about Norton AntiVirus Live Update ??????
    LVL 5

    Accepted Solution

    It is not possible to trigger an event on a remote client machine via a SQL Server Trigger.

    MSN Messenger, Microsoft Outlook and Norton etc are client applications running on the users machine. MSN messenger maintains a stateful connection to a remote server, when it receives a message on it's TCP connection that there is a new message/login/whatever it then uses the Win32 API to create a new window with no border, place it in the bottom corner of the screen and then draws it's interface over it.

    To do this, you would have to:
    1) Have the trigger insert a row into some kind of "Notification" table
    2) Write a VB.NET WINDOWS application that sits on the clients machine running constantly
    3) The VB.NET program would have to connect to the database and poll the notification table (do a SELECT on it every x minutes)
    4) When it detects a notification, it would remove it so it doesn't trigger again and then use the Win32 api to create a new window with no border and draw the custom interface over it.

    It's not possible to make an "Email Notification" style window from HTML and have it appear based on a sql server trigger. It's not possible to have any window appear based on a SQL Server Trigger, triggers execute sp's and SQL statements and functions WITHIN the database.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now