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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp execute an SQL statement for a time

Status
Not open for further replies.

josefidalgo

Programmer
Aug 15, 2015
6
PT
I need to execute a SQL statement of 5 in 5 minutes.
how can I do that in form?
 
Code:
RAND(-1) && init RAND to create different random sequences every time
timetoexecute = Datetime()+5*60
querytoexecute = sqlquery[5*RAND()+1] && assume the 5 queries are stored in an array sqlquery[1] to sqlquery[5]

Also a timer with interval 5*60*1000 could be used, The timer event then occurs in 5 minutes, where the timer can disable itself in the timer event.

Bye, Olaf.

 
in the form, example

sqlexec(lnHandle,"update table set data=getdate()")
 
Perhaps you find a forum in your native mother language, I don't understand your problem and question about this.

Bye, Olaf.
 
Whether or not you look for a forum in a different language, as Olaf suggests, you will need to explain your problem a little more clearly. Do you mean you want to execute a certain state,emt five times, during a five-minute period? Or do you want to keep repeating it constantly for five minutes? Or what?

This is probably a simple problem with an obvious answer, but it's difficult for us to help you without knowing what you are trying to achieve.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I want to develop an event in vfp running this:
"Update table dataset = getdate () "
will occur in 5 to 5 minutes
 
already found the solution , thank you


Public oTimer

Declare Integer Sleep in Win32API integer milliseconds

oTimer = CreateObject("testtimer")

Define Class testtimer as timer
Interval = 300000
Enabled = .T.
Procedure Timer()
u_sqlexec("insert into ocorrencia(id,data) values(left(newid(),25),getdate())")
Sleep(1000)
Doevents Force
Endproc
EndDefine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top