Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Display Dynamic Msg During Intensive SQL Command?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Display Dynamic Msg During Intensive SQL Command?
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01010163
Message ID:
01010163
Views:
57
I am running into a slight problem. I have a section of code that uses an SQL statement which is somewhat CPU intensive. Unfortunatly, there are some end-users that use this application that I have found are very impatient and even though I display a wait message, they still think the program locked up and "Alt+Ctrl+Del" out of the application. This is a problem because doing so when a table is being access has sometimes corrupted the table. I was hoping to be able to display a dynamic message using the WAIT command that scrolled a "." at the end of the message based on a timer. This way at least the message would show some "activity" and the user would not immediatly think that the application "froze". I tried adding a timer control, which I activated immediately before the SQL statement, but it appears that the SQL Statement halts all code from processing, even the timer control. Does anyone have any idea what I could do to get this idea to work?

This is the code I use inside my timer: (Note: Timer Interval = 500)
*************************************************************************************************
* Program/Function: timerMessage.Timer()
* Author: Ben Santiago
* Company: Eastern Suffolk BOCES
* Last Revision: 05/02/2005
* Description:
*	Display dynamic message to the user. (Prevent user from thinking application froze)
*************************************************************************************************

****************************************************
* Initialize Variables
****************************************************
LOCAL lcMsg

****************************************************
* Reset Counter
****************************************************
IF THIS.Tag == "3" THEN
	THIS.Tag = ""
ENDIF

****************************************************
* Increment Counter
****************************************************
IF EMPTY(THIS.Tag) THEN
	THIS.Tag = "1"
ELSE
	THIS.Tag = ALLTRIM(STR(INT(VAL(THIS.Tag) + 1)))
ENDIF

****************************************************
* Set Message
****************************************************
lcMsg = "Extracting Student Histroy. This may take a few minutes." + vfpNewLine + ;
		SPACE(50) + "Please Be Patient" + REPLICATE(".", VAL(THIS.Tag))

****************************************************
* Display Message
****************************************************
WAIT WINDOW lcMsg NOWAIT
________________________
Ben Santiago, MCP & A+
Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS)
Eastern Suffolk BOCES - Student Data Services


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rich Cook
Next
Reply
Map
View

Click here to load this message in the networking platform