One of my applications needs to run quite heavy select statements on large
tables, and also quite time-consuming indexing operations. How can I:
- Update a progress bar during such a heavy database operation
- Give the user an option to cancel an operation after it has started.
Any ideas would be highly appreciated.
Aaron

Re: Progress bar by Eric

Eric
Mon Feb 14 03:33:38 CST 2005

Hello, Aaron!
You wrote on Mon, 14 Feb 2005 07:32:12 GMT:

AB> One of my applications needs to run quite heavy select statements on
AB> large tables, and also quite time-consuming indexing operations. How
AB> can I: - Update a progress bar during such a heavy database operation
AB> - Give the user an option to cancel an operation after it has started.
AB> Any ideas would be highly appreciated.
AB> Aaron

You can SET TALK ON to display VFP's internal progress dialog during SELECT
SQL and INDEX.
For more info on cancelling operations, take a look at ON ESCAPE and SET
ESCAPE.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: Progress bar by Aaron

Aaron
Mon Feb 14 05:47:08 CST 2005

Maybe I should have mentioned that all database activities happen in a
Foxpro DLL (called by a C++ application), which makes it difficult (or
impossible?) to have a user interface. So I guess I have to hook into the
internal events of VFP's internal processes?
Aaron


"Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
news:Ook69gnEFHA.1936@TK2MSFTNGP14.phx.gbl...
> Hello, Aaron!
> You wrote on Mon, 14 Feb 2005 07:32:12 GMT:
>
> AB> One of my applications needs to run quite heavy select statements on
> AB> large tables, and also quite time-consuming indexing operations. How
> AB> can I: - Update a progress bar during such a heavy database operation
> AB> - Give the user an option to cancel an operation after it has
started.
> AB> Any ideas would be highly appreciated.
> AB> Aaron
>
> You can SET TALK ON to display VFP's internal progress dialog during
SELECT
> SQL and INDEX.
> For more info on cancelling operations, take a look at ON ESCAPE and SET
> ESCAPE.
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
>
>



Re: Progress bar by Fred

Fred
Mon Feb 14 09:08:03 CST 2005

That is correct, you can not have ANY user interface in a VFP .DLL. You'd
have to use a COM .EXE in order to have any visible aspects.

--
Fred
Microsoft Visual FoxPro MVP


"Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
news:0d0Qd.17379$d5.138413@newsb.telia.net...
> Maybe I should have mentioned that all database activities happen in a
> Foxpro DLL (called by a C++ application), which makes it difficult (or
> impossible?) to have a user interface. So I guess I have to hook into the
> internal events of VFP's internal processes?
> Aaron
>
>
> "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
> news:Ook69gnEFHA.1936@TK2MSFTNGP14.phx.gbl...
>> Hello, Aaron!
>> You wrote on Mon, 14 Feb 2005 07:32:12 GMT:
>>
>> AB> One of my applications needs to run quite heavy select statements
>> on
>> AB> large tables, and also quite time-consuming indexing operations. How
>> AB> can I: - Update a progress bar during such a heavy database
>> operation
>> AB> - Give the user an option to cancel an operation after it has
> started.
>> AB> Any ideas would be highly appreciated.
>> AB> Aaron
>>
>> You can SET TALK ON to display VFP's internal progress dialog during
> SELECT
>> SQL and INDEX.
>> For more info on cancelling operations, take a look at ON ESCAPE and SET
>> ESCAPE.
>> --
>> Eric den Doop
>> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
>>
>>
>
>



Re: Progress bar by Aaron

Aaron
Mon Feb 14 10:33:51 CST 2005

Yes - one option would be a EXE, but what I want to do is to control
progress information from the calling application, and I also would like to
be able to break a lengthy process from outside. Would this be possible?
k


"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:OzdU6bqEFHA.3536@TK2MSFTNGP15.phx.gbl...
> That is correct, you can not have ANY user interface in a VFP .DLL. You'd
> have to use a COM .EXE in order to have any visible aspects.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
> news:0d0Qd.17379$d5.138413@newsb.telia.net...
> > Maybe I should have mentioned that all database activities happen in a
> > Foxpro DLL (called by a C++ application), which makes it difficult (or
> > impossible?) to have a user interface. So I guess I have to hook into
the
> > internal events of VFP's internal processes?
> > Aaron
> >
> >
> > "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
> > news:Ook69gnEFHA.1936@TK2MSFTNGP14.phx.gbl...
> >> Hello, Aaron!
> >> You wrote on Mon, 14 Feb 2005 07:32:12 GMT:
> >>
> >> AB> One of my applications needs to run quite heavy select statements
> >> on
> >> AB> large tables, and also quite time-consuming indexing operations.
How
> >> AB> can I: - Update a progress bar during such a heavy database
> >> operation
> >> AB> - Give the user an option to cancel an operation after it has
> > started.
> >> AB> Any ideas would be highly appreciated.
> >> AB> Aaron
> >>
> >> You can SET TALK ON to display VFP's internal progress dialog during
> > SELECT
> >> SQL and INDEX.
> >> For more info on cancelling operations, take a look at ON ESCAPE and
SET
> >> ESCAPE.
> >> --
> >> Eric den Doop
> >> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By
VFP8
> >>
> >>
> >
> >
>
>



Re: Progress bar by Wolfgang

Wolfgang
Mon Feb 14 12:07:59 CST 2005

Hi Aaron!

I think it could be an option to integrate an UDF which is called for every
record. If the VFP comObject knows the calling or the display object it may
send the reccount to the calling object, which has to display the message

***********************************
* SQL-Object
***********************************
function SQL_Display(toDisplayObject as Object)
if vartype(toDisplayObject)#"O"
return
else
toDisplayObject.ValueToDisplay=reccount()
endif


--
----------------------------------------------

Mit freundlichen Grüßen

Wolfgang Schmale



--------------------------------------------
"Aaron Blacksmith" <Aaron@___Nospam.com> schrieb im Newsbeitrag
news:Pp4Qd.130435$dP1.466207@newsc.telia.net...
> Yes - one option would be a EXE, but what I want to do is to control
> progress information from the calling application, and I also would like
> to
> be able to break a lengthy process from outside. Would this be possible?
> k
>
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:OzdU6bqEFHA.3536@TK2MSFTNGP15.phx.gbl...
>> That is correct, you can not have ANY user interface in a VFP .DLL.
>> You'd
>> have to use a COM .EXE in order to have any visible aspects.
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
>> news:0d0Qd.17379$d5.138413@newsb.telia.net...
>> > Maybe I should have mentioned that all database activities happen in a
>> > Foxpro DLL (called by a C++ application), which makes it difficult (or
>> > impossible?) to have a user interface. So I guess I have to hook into
> the
>> > internal events of VFP's internal processes?
>> > Aaron
>> >
>> >
>> > "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
>> > news:Ook69gnEFHA.1936@TK2MSFTNGP14.phx.gbl...
>> >> Hello, Aaron!
>> >> You wrote on Mon, 14 Feb 2005 07:32:12 GMT:
>> >>
>> >> AB> One of my applications needs to run quite heavy select
>> >> statements
>> >> on
>> >> AB> large tables, and also quite time-consuming indexing operations.
> How
>> >> AB> can I: - Update a progress bar during such a heavy database
>> >> operation
>> >> AB> - Give the user an option to cancel an operation after it has
>> > started.
>> >> AB> Any ideas would be highly appreciated.
>> >> AB> Aaron
>> >>
>> >> You can SET TALK ON to display VFP's internal progress dialog during
>> > SELECT
>> >> SQL and INDEX.
>> >> For more info on cancelling operations, take a look at ON ESCAPE and
> SET
>> >> ESCAPE.
>> >> --
>> >> Eric den Doop
>> >> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By
> VFP8
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Re: Progress bar by Aaron

Aaron
Mon Feb 14 13:14:04 CST 2005

Thanx - I'll work on that idea. Probably the best place for it would be in
the having clause in SQL statements, but I think I need to find something
else for the indexing phase...
Danke schön, Wolfgang.
Aaron


"Wolfgang Schmale" <Spamkocher@strang.lt> wrote in message
news:OWylfAsEFHA.1292@TK2MSFTNGP10.phx.gbl...
> Hi Aaron!
>
> I think it could be an option to integrate an UDF which is called for
every
> record. If the VFP comObject knows the calling or the display object it
may
> send the reccount to the calling object, which has to display the message
>
> ***********************************
> * SQL-Object
> ***********************************
> function SQL_Display(toDisplayObject as Object)
> if vartype(toDisplayObject)#"O"
> return
> else
> toDisplayObject.ValueToDisplay=reccount()
> endif
>
>
> --
> ----------------------------------------------
>
> Mit freundlichen Grüßen
>
> Wolfgang Schmale
>
>
>
> --------------------------------------------
> "Aaron Blacksmith" <Aaron@___Nospam.com> schrieb im Newsbeitrag
> news:Pp4Qd.130435$dP1.466207@newsc.telia.net...
> > Yes - one option would be a EXE, but what I want to do is to control
> > progress information from the calling application, and I also would like
> > to
> > be able to break a lengthy process from outside. Would this be possible?
> > k
> >
> >
> > "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> > news:OzdU6bqEFHA.3536@TK2MSFTNGP15.phx.gbl...
> >> That is correct, you can not have ANY user interface in a VFP .DLL.
> >> You'd
> >> have to use a COM .EXE in order to have any visible aspects.
> >>
> >> --
> >> Fred
> >> Microsoft Visual FoxPro MVP
> >>
> >>
> >> "Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
> >> news:0d0Qd.17379$d5.138413@newsb.telia.net...
> >> > Maybe I should have mentioned that all database activities happen in
a
> >> > Foxpro DLL (called by a C++ application), which makes it difficult
(or
> >> > impossible?) to have a user interface. So I guess I have to hook into
> > the
> >> > internal events of VFP's internal processes?
> >> > Aaron
> >> >
> >> >
> >> > "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
> >> > news:Ook69gnEFHA.1936@TK2MSFTNGP14.phx.gbl...
> >> >> Hello, Aaron!
> >> >> You wrote on Mon, 14 Feb 2005 07:32:12 GMT:
> >> >>
> >> >> AB> One of my applications needs to run quite heavy select
> >> >> statements
> >> >> on
> >> >> AB> large tables, and also quite time-consuming indexing
operations.
> > How
> >> >> AB> can I: - Update a progress bar during such a heavy database
> >> >> operation
> >> >> AB> - Give the user an option to cancel an operation after it has
> >> > started.
> >> >> AB> Any ideas would be highly appreciated.
> >> >> AB> Aaron
> >> >>
> >> >> You can SET TALK ON to display VFP's internal progress dialog during
> >> > SELECT
> >> >> SQL and INDEX.
> >> >> For more info on cancelling operations, take a look at ON ESCAPE and
> > SET
> >> >> ESCAPE.
> >> >> --
> >> >> Eric den Doop
> >> >> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By
> > VFP8
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Re: Progress bar by Fred

Fred
Mon Feb 14 19:26:06 CST 2005

Wolfgang's suggestion to call a UDF for each record could work. That UDF
could check a another table's field value that you update from the main app
to indicate you want to stop.

--
Fred
Microsoft Visual FoxPro MVP


"Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
news:Pp4Qd.130435$dP1.466207@newsc.telia.net...
> Yes - one option would be a EXE, but what I want to do is to control
> progress information from the calling application, and I also would like
> to
> be able to break a lengthy process from outside. Would this be possible?
> k
>
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:OzdU6bqEFHA.3536@TK2MSFTNGP15.phx.gbl...
>> That is correct, you can not have ANY user interface in a VFP .DLL.
>> You'd
>> have to use a COM .EXE in order to have any visible aspects.
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
>> news:0d0Qd.17379$d5.138413@newsb.telia.net...
>> > Maybe I should have mentioned that all database activities happen in a
>> > Foxpro DLL (called by a C++ application), which makes it difficult (or
>> > impossible?) to have a user interface. So I guess I have to hook into
> the
>> > internal events of VFP's internal processes?
>> > Aaron
>> >
>> >
>> > "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
>> > news:Ook69gnEFHA.1936@TK2MSFTNGP14.phx.gbl...
>> >> Hello, Aaron!
>> >> You wrote on Mon, 14 Feb 2005 07:32:12 GMT:
>> >>
>> >> AB> One of my applications needs to run quite heavy select
>> >> statements
>> >> on
>> >> AB> large tables, and also quite time-consuming indexing operations.
> How
>> >> AB> can I: - Update a progress bar during such a heavy database
>> >> operation
>> >> AB> - Give the user an option to cancel an operation after it has
>> > started.
>> >> AB> Any ideas would be highly appreciated.
>> >> AB> Aaron
>> >>
>> >> You can SET TALK ON to display VFP's internal progress dialog during
>> > SELECT
>> >> SQL and INDEX.
>> >> For more info on cancelling operations, take a look at ON ESCAPE and
> SET
>> >> ESCAPE.
>> >> --
>> >> Eric den Doop
>> >> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By
> VFP8
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Re: Progress bar by David

David
Mon Feb 14 20:08:54 CST 2005

Aaron,

A call to a COM method in VFP is going to be a totally synchronous modal
activity. There is no way for the COM thread to provide feedback directly to
the caller.

You might be able to in another thread of the calling program to query a
property of the COM object, and if that works you could set a lEndItAll
property that the code inside the worker memthod could poll and terminate.

A sure fire way that will work is to use a semaphore table/file that the
caller and the COM object would have access to. The COM could write a
progress field and read an EndItAll field.

--
df - Microsoft MVP FoxPro http://www.geocities.com/df_foxpro

"Aaron Blacksmith" <Aaron@___Nospam.com> wrote in message
news:0uYPd.17365$d5.138427@newsb.telia.net...
> One of my applications needs to run quite heavy select statements on large
> tables, and also quite time-consuming indexing operations. How can I:
> - Update a progress bar during such a heavy database operation
> - Give the user an option to cancel an operation after it has started.
> Any ideas would be highly appreciated.
> Aaron
>
>



Re: Progress bar by Aaron

Aaron
Tue Feb 15 09:50:57 CST 2005

That's a good point, but I guess that optimization suffers if I put it in
the where clause. Actually I would prefer a solution which relies on some
communicatoin between the application and the dll - so an event in the
calling application could be bound to events in Foxpro's database engine.
But that seems not to be doable - at least noone has come up with an idea on
how to do it.
Aaron


"Dummy Newgroup name" <nospam@nospam.org> wrote in message
news:VA.00000b13.0861d632@atvowleyfarm.dotcodotyou.kay...
> I think you'll be dissappointed if you put it in the "having" clause
> as that is executed last. You'll probably get the result you want
> putting it in the "where" clause.
>
> Mark Stanton
> One small step for mankind...
>