Re: how closing open dbf file?
- From: "Stefan Wuebbe" <stefan.wuebbe@xxxxxx>
- Date: Thu, 27 Mar 2008 17:58:27 +0100
IMO, there would be no disadvantage including performance
issues, when you'd turn the approach around and let each client
Select your desired result on its own.
IOW, either use "Select ... Into Cursor xy" to get a local temp
cursor result for each client on demand or use a Local View.
gdstart = ctod(str(year(date()))+'.'+ str(month(date()),2)+'.'+ '01')
gdend=ctod(IIF(month(date())=12,str(year(date())+1),str(year(date())))+'.'+
It's almost always easier/better not to convert date types to character
and back, e.g.
gdStart = Date( Year(Date()), Month(Date()), 1 )
gdEnd = GoMonth(m.gdStart,1)
And I'd probably make them Local variables.
hth
-Stefan
"Patrick Tura" <patrick@xxxxxx> wrote in message news:9DA8E747-288C-4495-8398-06566DF2BEDB@xxxxxxxxxxxxxxxx
Hello guys,
I'm very sorry for a bit confusing in my description about closing a file..
well, this is my code;
SET ENGINEBEHAVIOR 70 && VFP 8.0 adjustment to run SQL-Select with grouping without problem
set safety off
set century on
set exclusive off
open database c:\kffmaindbf\client shared
SET DATE ANSI
public gdstart,gdend
gdstart=date()
gdend=date()
gdstart = ctod(str(year(date()))+'.'+ str(month(date()),2)+'.'+ '01')
gdend=ctod(IIF(month(date())=12,str(year(date())+1),str(year(date())))+'.'+ IIF(month(date())=12,'01',str(month(date())+1,2))+'.'+ '01')
*Collection Performance 2008.02.24
select kffstaff.gname,kffstaff.fname,book.staff_id,DATUM,KTO,sum(INN),TEXT ;
from book,biodata,kffstaff ;
nowait ;
where book.client_id = biodata.client_id ;
and biodata.B = "B" ;
AND book.staff_id=kffstaff.staff_id ;
and KTO='Cust';
AND text= 'Payment' ;
AND datum >=gdstart ;
AND datum <=gdend ;
AND kffstaff.position='Collector' ;
group by book.staff_id ;
ORDER BY book.inn descending INTO table c:\checker_dbf\cperformance
I have this code compiled into an exe. I run in our server on schedule and the result of this will produce 'c:\checker_dbf\cperformance.dbf'
This freetable is viewed in a grid from other users thru a vfp form in the network to see the figures of their performance. So this file will be open from time to time.
So when the above code is run, it cannot overwrite 'c:\checker_dbf\cperformance' if they are still open.
At the same time, I wanted to re-run this code every hour to keep the figures updated in the c:\checker_dbf\cperformance.dbf to make the users see the result of what they are doing.
As far, as I can see, my problem is how to close the open 'c:\checker_dbf\cperformance'. Maybe I need to use low level command but I don't how to do it.
Assistance please...Thanks in Advance..
/patrick
"Patrick Tura" <patrick@xxxxxx> wrote in message news:9C6F6992-9DBC-4BBA-B0C4-484C4AFDE293@xxxxxxxxxxxxxxxxHi!
I have a freetable that is open by more than one users to look at result of thier performance.
I wanted this table to be updated every hour in our server but however, if somebody is keeping this freetable file open my sql query that will save and update the result into freetable cannnot overwrite the .dbf file while it is open.
cannot overwrite freetable file(.dbf)
I need to close this freetable before starting my sql-query to be able to update the freetable every hour...
Anybody, can help me.
Our server is Windows Server 2003. I have my foxpro sql-query prg running on schedule...
Thanks.
/patrick
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
.
- Follow-Ups:
- Re: how closing open dbf file?
- From: Patrick Tura
- Re: how closing open dbf file?
- References:
- how closing open dbf file?
- From: Patrick Tura
- Re: how closing open dbf file?
- From: Patrick Tura
- how closing open dbf file?
- Prev by Date: Re: how closing open dbf file?
- Next by Date: Re: Window on top
- Previous by thread: Re: how closing open dbf file?
- Next by thread: Re: how closing open dbf file?
- Index(es):
Relevant Pages
|