For Programmers: Free Programming Magazines  


Home > Archive > Clipper > March 2007 > Sharing violation - Comix - SBS Server









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Sharing violation - Comix - SBS Server
otto

2007-03-29, 9:55 pm

Hello,

I moved our application from ntx to comix index files.
We have a lot of Memo files and now .ftp files are really much smaller.
I also like the container solution for the indexes. Much less files in this directory now.
The problem is, I have a reindexing procedure who reindex all files and make some check.
For a reason that, one dbf file is remained open. I didn't have had this problem with the ntx files.
If I try to start the procedure who use this dbf files, then I get a "Sharing Violation" error.
But nobody is using this file. I did some check directly with the administrator right on the server and nobody is using this dbf files.
I also download "Filemon.exe" to check with files are used and I get the same result this files are no share on it.
Could somebody help me?
Thanks in advance for any help.
Otto
dlzc

2007-03-29, 9:55 pm

Dear otto:

On Mar 29, 12:20 pm, otto <oha...@freesurf.ch> wrote:
> Hello,
>
> I moved our application from ntx to comix index
> files.


What version of clipper are you using, and what 3rd party
applications?

> We have a lot of Memo files and now .ftp files
> are really much smaller. I also like the
> container solution for the indexes. Much less
> files in this directory now.


> The problem is, I have a reindexing procedure
> who reindex all files and make some check.


Is this "procedure" compiled with your main code, or is it a separate
executable? If separate, did you REQUEST the correct RDD?

Sometimes Clipper will skip over the first occurance of an error,
reporting the first error with neterr() first, and generating a "hard"
error some time later. Can you see at which line of code this occurs?

> For a reason that, one dbf file is remained
> open. I didn't have had this problem with
> the ntx files. If I try to start the
> procedure who use this dbf files, then I get
> a "Sharing Violation" error. But nobody is
> using this file. I did some check directly
> with the administrator right on the server
> and nobody is using this dbf files. I also
> download "Filemon.exe" to check with files
> are used and I get the same result this files
> are no share on it.
> Could somebody help me?


If you write a separate program with the correct RDD, and all it does
is open the dbf and renew all the indexes, do you still have this
problem? If you move / copy all the files to a local drive and run
this special program, do you still this problem?

Are you running Windoze, if so what version?

David A. Smith

otto

2007-03-30, 7:55 am

On 29 Mar 2007 14:18:07 -0700, "dlzc" <dlzc1@cox.net> wrote:

Hello David,

Thanks that you are helping me.

I'm using clipper 5.2e with Comix 3.00.

and here the another lib's.
# CPLWKS52 Lib for Excel
# PSCRIPT Lib for Printing
# CPT52 Lib for CA-Tools
# CLIPPER
# TERMINAL
# DBFNTX
# OSLIB
# CMX52 Lib for Comix

LIB CLPWKS52,PSCRIPT,CTP52,CLIPPER,TERMINAL,
DBFNTX,CMX52

>Is this "procedure" compiled with your main code, or is it a separate
>executable? If separate, did you REQUEST the correct RDD?
>

Yes I have this procedure in the main code.
Reindex a file look like this:

CmxPack(11,"LIEFER",5)
@ 20,60 say ',1'
index on Str(LIEFER->LS_NR,6) tag LIEFNR
@ 20,62 say ',2'
index on Left(Upper(LIEFER->ADR_NAME),10) tag LIEFNAME
@ 20,66 say ',3'
index on Descend(Str(LIEFER->LS_NR,6)) tag LIEFNRD
@ 20,64 say ',4'
index on Str(LIEFER->ADR_NR,6) + Descend(Str(LIEFER->LS_NR,6)) tag LIEFADR
@ 20,68 say ',5'
index on Str(LIEFER->SR_NR,6) + Str(LIEFER->LS_NR,6) tag LIEFSNR
LIEFER->( DbCloseArea() )

CmxPack(15,"AGENDA",2)
@ 20,60 say ',1'
index on Dtos(AGENDA->T_DATUM) + AGENDA->T_ZEIT + AGENDA->KST tag AGDATE
@ 20,62 SAY ',2'
index on Str(AGENDA->LS_NR,6) tag AGLSNR
AGENDA->( DbCloseArea() )


FUNCTION CmxPack(vTxt,vBase,vTIndex)
Local resume
Scroll(8,2,20,77,1)
Color(2)
@ 20,2 SAY ReadTxt(tp,vTxt)
if CmxUse(,vBase,,.F.) // Ouverture en mode exclusif
// go bottom
SetColor("+/W")
@ 20,35 say Str(RecCount(),7)
Color(2,"w+")
@ 20,55 say "PACK"
pack
// go bottom
@ 20,45 say Str(RecCount(),7)
resume := .t.
else
Color(2)
@ 20,55 say ReadTxt(ts,81)
resume := .f.
end
Return resume


FUNCTION CmxUse(new,base,alias,shared)
Local resume,vtxt,t,bError
Private OsErrStr,GenErrStr

if new = NIL
new := .t.
end
if alias = NIL
alias := base
end
if shared = NIL
shared := .t.
end
if select(alias) # 0 // Si ouvert ferme le fichier
close(alias)
end

// Ouverture de la base de donnée
bError := ErrorBlock({|oError| TrapError(oError)}) // Nouveau bloque d'erreur
begin sequence
DbUseArea(new,"COMIX",base,alias,shared)
resume := .t.
recover
resume := .f.
end
errorblock(bError)
if !resume
AlarmBox(,GenErrStr + ": " + base + ".DBF" + ", " + OsErrStr)
Return resume
end
Return resume


In the main procedure I also included the Request COMIX

PROCEDURE START(log)
REQUEST COMIX
set bell off
set date german
set scoreboard on
set confirm on
set delete on
set default to
setcancel(.t.)
setcursor(0)
menu(log)
quit
return


What is really strange every thing work well. Only the dbf files "AGENDA.DBF" stay open!
It is not a big application. I have about 20 dbf files and only one stay open during the reorganisation!


>Are you running Windoze, if so what version?
>

Files are on a Microsoft SBS Server ( Win 2003).
Exe are installed on workstation (Win 2000 and Win XP)

Regards
Otto




>Dear otto:
>
>On Mar 29, 12:20 pm, otto <oha...@freesurf.ch> wrote:
>
>What version of clipper are you using, and what 3rd party
>applications?
>
>
>
>Is this "procedure" compiled with your main code, or is it a separate
>executable? If separate, did you REQUEST the correct RDD?
>
>Sometimes Clipper will skip over the first occurance of an error,
>reporting the first error with neterr() first, and generating a "hard"
>error some time later. Can you see at which line of code this occurs?
>
>
>If you write a separate program with the correct RDD, and all it does
>is open the dbf and renew all the indexes, do you still have this
>problem? If you move / copy all the files to a local drive and run
>this special program, do you still this problem?
>
>Are you running Windoze, if so what version?
>
>David A. Smith

Stephen Quinn

2007-03-30, 6:55 pm

Otto

You shouldn't use the ALIAS in your index expressions, you should use either a FIELD statement or
_FIELD in your expressions.
Eg
FIELD LS_NR IN LIEFER
FIELD LS_NR // no IN - if this field is in more than one DBF
or
_FIELD->LS_NR

This probably isn't the cause of your problem but it may come back and bite you sometime in the
future.

--
HTH
Steve


otto

2007-03-30, 6:55 pm

On Fri, 30 Mar 2007 13:49:40 GMT, "Stephen Quinn" <stevejqNO@SPbigpond.netAM.au> wrote:

Stephen
Thanks for your help.

Do you mean like this:
....
index on Dtos(FIELD->T_DATUM) + FIELD->T_ZEIT + FIELD->KST tag AGDATE
index on Str(FIELD->LS_NR,6) tag AGLSNR
AGENDA->( DbCloseArea() )

Regards
Otto


>Otto
>
>You shouldn't use the ALIAS in your index expressions, you should use either a FIELD statement or
>_FIELD in your expressions.
>Eg
> FIELD LS_NR IN LIEFER
> FIELD LS_NR // no IN - if this field is in more than one DBF
>or
> _FIELD->LS_NR
>
>This probably isn't the cause of your problem but it may come back and bite you sometime in the
>future.

Stephen Quinn

2007-03-30, 6:55 pm

Otto

> index on Dtos(FIELD->T_DATUM) + FIELD->T_ZEIT + FIELD->KST tag AGDATE
> index on Str(FIELD->LS_NR,6) tag AGLSNR


No.

Like this ( _FIELD not FIELD )
index on Dtos(_FIELD->T_DATUM) + _FIELD->T_ZEIT + _FIELD->KST tag AGDATE
index on Str(_FIELD->LS_NR,6) tag AGLSNR
or
a FIELD STATEMENT

FIELD T_DATUM, T_ZEIT, KST , LS_NR IN AGENDA

index on Dtos( T_DATUM) + T_ZEIT + KST tag AGDATE
index on Str( LS_NR,6) tag AGLSNR

--
CYA
Steve


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com