General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Loosing Cursor Focus
Environment versions
Network:
Windows 2000 Server
For some reason the following code is not retaining my Report Cursor.
The following code is set to a timer to monitor app status. When I pull up a report based on a select statement the report looks okay for a few minutes but eventually looses the focus to the cursor it was based on. The cursor the following code uses becomes the current Alias() permenatly.
Function applicationStatus()
Local apst, lpuseridpc
apst = -1
If Empty(Alias()) Then
If Not Used('app_status') Then
Use app_status Again Shared In 0
EndIf
Select app_status
EndIf
esglobal.current_table = Alias()
Do Case
Case runenviroment = "Test"
esglobal.appStatusConn = SQLSTRINGCONNECT(lcConnection2('UserDataTest'))
Case runenviroment = "Production"
esglobal.appStatusConn = SQLSTRINGCONNECT(lcConnection2('UserData2'))
EndCase
If esglobal.appStatusConn (lessThan)Or = 0 Then
*Cancel
Else
Do Case
Case betaflag = .F.
sflgpro = "Select * From appstatustable Where appname = 'Engineering Schedules'"
Case betaflag = .T.
sflgpro = "Select * From appstatustable Where appname = 'Engineering Schedules-Beta'"
EndCase
=SQLSETPROP(esglobal.appStatusConn, 'Transactions', 2)
apst = SQLEXEC(esglobal.appStatusConn, sflgpro, 'myAppStatusv5')
If reccount('myAppStatusv5') (greaterThan) 0 Then
esglobal.appStatusMessage = myAppStatusv5.appmsg
esglobal.appStatusShutDown = myAppStatusv5.appsd
esglobal.appStatusStopLogon = myAppStatusv5.appslo
esglobal.appStatusTimerSet = myAppStatusv5.timerset
esglobal.appVersion = myAppStatusv5.appver
esglobal.appErrorLog = myAppStatusv5.errorp
EndIf
=SQLDISCONNECT(esglobal.appStatusConn)
Select (esglobal.current_table)
EndIf
EndFunc
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only