Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loosing Cursor Focus
Message
From
02/03/2005 10:27:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Loosing Cursor Focus
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00991972
Message ID:
00991972
Views:
64
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
Map
View

Click here to load this message in the networking platform