Results 1 to 5 of 5

Thread: Is this possible!!!!

  1. #1
    Guest

    Post

    An end-user submits a problem, with my program this auto-updates the database of our choice. I want to know if it is possible when the end-user clicks the submit button, a warning (sound file) could play on the PC the database resides on. This would let me know the database has been updated.

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    15

    Post

    you could try this...

    'Leave this program run on the server and when the User sends the
    'update also program to have the user send a message to this program.

    'Module Code
    Public Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" _
    (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long

    'Get login name
    Function GetUserName() As String
    Const lpnLength As Integer = 255
    Dim Status As String
    Dim lpName As String
    Dim lpUserName As String
    lpUserName = Space$(lpnLength + 1)
    Status = WNetGetUser(lpName, lpUserName, lpnLength)
    If Status = "0" Then
    GetUserName = Left$(lpUserName, InStr(lpUserName, Chr(0)) - 1)
    Else
    GetUserName = "Unknown"
    End If
    End Function


    'Form Code
    Private Sub Form_Load()
    ' The control's name is udpPeerA
    With udpPeerA
    ' IMPORTANT: be sure to change the RemoteHost
    ' value to the name of your computer.
    .RemoteHost = "SERVER"

    'Server Machine
    .RemotePort = 1002 ' Port to connect to.
    .Bind 1001 ' Bind to the local port.

    'User Machine
    .RemotePort = 1001 ' Port to connect to.
    .Bind 1002 ' Bind to the local port.

    End With
    End Sub

    Private Sub txtSend_Change()
    'Use this code if you'd like to record the user
    'who updated the file along with the time and date!
    udpPeerA.SendData UCase(GetUserName) & " | " & Date & " | " & Time
    End Sub

    Private Sub udpPeerA_DataArrival _
    (ByVal bytesTotal As Long)
    Dim strData As String
    'Get the string sent to the server machine.
    'udpPeerA.GetData strData

    'Add the retrieved string to the RICHTEXTBOX (this works best)
    'txtOutput.Text = txtOutput.Text & strData & Chr(10)
    Beep
    End Sub


    Please contact me for futher information.

    ------------------
    J.R. Berard
    AutoCAD Programmer/Analyst
    mailto:[email protected]

  3. #3
    Guest

    Post

    Where would I put the 1 minute loop? in the database on the server, or in the program on the users desktop? Please show any code.

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Post

    I create alarms like this all the time using VB or ASP files.

    just stick a 1 minute loop with SQL like
    select count(*) from mytable

    and if it's higher than before then beep. if other things are updating the table then add a new column that users software modifies so you can have
    select count(*) from mytable where isUser = "True"

    ASPs work well for this because the web page can be displayed in your office as an alert where as the DB is often elsewhere.



  5. #5
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Post

    Maybe you miss my point.

    All I do is create a special DB client for myself (either VB or ASP) then do the count() lookup in SQL. all you're really doing is checking if the number of the records in the DB have changed.

    As for the loop, a timer control in VB will work or a REFRESH <META> tag in ASP's HTML will work.

    If you email me a few more details I'll proabably be able to send you some more ideas and code

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