I'm stressing again, using the code below I am trying to open a window and in the window it says 'you have recieved a private message' if you have a new message otherwise the window won't show.
If the user clicks inside the window it opens Internet Explorer and then closes the window, waits 5 mins and checks the database again.
This is for a company intranet I'm building, I need a way of notifying the end users that they have recieved a new message with out them having to have their browsers continually open, thats where PB and ODBC come in, the data base code is ok and works but repeat loop every 5 mins I need help with.
Code: Select all
Repeat
win = OpenWindow(0, ScreenWidth()-212, ScreenHeight()-170, 200, 100, #PB_Window_SystemMenu, "Database Test")
CreateGadgetList(win)
EditorGadget(1, 0, 0, 190, 90)
x = 0
report$ = "You have recieved a private message !"
If InitDatabase()
If OpenDatabase(0, "database", "user", "password")
UseDatabase(0)
request$ = "select * from pm"
result = DatabaseQuery(request$)
Repeat
result = NextDatabaseRow()
text$ = GetDatabaseString(6)
If text$ = "unread"
x = x + 1
EndIf
Until result = 0
EndIf
Else
MessageRequester("Error","Can't initialize Database",#PB_MessageRequester_Ok)
End
EndIf
If x > 0
HideWindow(0,0)
SetGadgetText(1,report$)
EndIf
Select WaitWindowEvent()
Case #PB_EventGadget; check for a pushed button
Case #WM_CLOSE ; #PB_EventCloseWindow
Quit = 1
EndSelect
Until Quit = 1Please help me before I get totally stressed out !
Kind regards
Andy


