Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thermometer/SqlPassthrough Question

Status
Not open for further replies.

jjgraf

Programmer
Joined
Aug 19, 2001
Messages
237
Location
US
IN applications that i write i use SqlPassthrough

What i want to do is use the thermometer to keep the users happy
How do i do that?

I know how to call the thermometer and update it that's not the problem

The problem is when i issue the SqlExec() the code does not move onto the thermometer update code.

I have played with the SQLSETPROP() changing it so to use sqlmoreresults() but this does not work. It moves onto next line but stops and waits for the SQLEXEC() to finish first.



lnConnect = SQLCONNECT("COMP_B")

SET STEP ON
SQLSETPROP(lnconnect,"BatchMode",.F.)
SQLSETPROP(lnconnect,"Asynchronous",.T.)

loTherm = NewObject("_thermometer","_therm","","Retrieving Data")

lcsql = "SELECT job, operation, expd_unit_run_time, work_centre, milestone FROM wip_job_all_lab" + ;
&quot; WHERE opern_complete <> 'Y'&quot;
lnreturn = sqlexec(lnConnect, lcsql, 'file1')

loTherm.Show() &&it stops here
ln = seconds() + 180
DO WHILE lnreturn = 0
lnreturn = SQLMORERESULTS(lnconnect)
lnprecent = SECONDS()/ln*100
lotherm.update(lnprecent)
enddo
lotherm.Complete()

SELECT * from file1 WHERE milestone = 'Y' INTO CURSOR file1


SQLDISCONNECT(lnconnect)



I think the reason this does not work is the Merant backend server complies to nothing.
 
Hi!

It is not possible in VFP. The most time takes to get data from remote database to VFP client, and this operation is done at once without interruptions and any events firing, so you will not be able to update progress bar.

You can organize this only by using remote views. Remote view have option to fetch records as you use them. So, when you do a query by remote view, first 100 (by default) records are queried only, after what you can move record pointer to force getting of next chunks from the query.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Thanks for confirming what i thought.

BTW: Can't use Remote views and do the Fetch one hundred records at a time. It does not work on this Backend Server. Like i said this Backend to Cobol Flat database sucks

It's real fun because you ask it to do any Kind of Uion or Jion it returns nothing and if have more than one where clause it adds 20 to 100 seconds to the query per where clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top