VODBAppend() returns false

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
ArunBerlin
Posts: 33
Joined: Tue Oct 27, 2020 1:19 pm
Location: India

VODBAppend() returns false

Post by ArunBerlin »

Code: Select all

   
LOCAL nRet := 1 AS LONG
nRet := iif((nArea)->(VODBAppend(TRUE)) .and. !NetErr(),1,0)
Edit:

Code: Select all

 
FUNCTION _DictCreate(pszDictName AS PSZ) AS LONG PASCAL
   LOCAL cFile AS STRING
   LOCAL aStruc AS ARRAY
   LOCAL strRDDList AS _RDDLIST
   LOCAL nRet := 0 AS LONG

   SetAnsi(FALSE)
   SetCollation(#CLIPPER)
   SetDateCountry(XSharp.Core.Functions.BRITISH)
   SetCentury(TRUE)
   cFile := Psz2String(pszDictName) + '.DBZ' // Index file
   strRDDList := GetRDDList()
   aStruc := {{"DATA","M",10,0}}
   
   IF VODBCreate(cFile, aStruc, strRDDList, TRUE, "blob", NULL_STRING, FALSE, FALSE)
       nRet := 1
   ENDIF
RETURN nRet

FUNCTION _DictOpen(pszDictName AS STRING,nShare AS LONG,nRO AS LONG) AS LONG PASCAL
   LOCAL cFile,cAlias AS STRING
   LOCAL strRDDList AS _RDDLIST
   LOCAL nRet := 0 AS LONG
  
   SetAnsi(FALSE)
   SetCollation(#CLIPPER)
   SetDateCountry(XSharp.Core.Functions.BRITISH)
   SetCentury(TRUE)
   
   cFile := UPPER(pszDictName) + '.DBZ' // Index file
   cAlias := "__" + Str(100000 + VODBSetSelect(0),6,0)
   strRDDList := GetRDDList()
   IF VODBUseArea(TRUE, strRDDlist, cFile, cAlias, TRUE, TRUE) .and. !NetErr()
       nRet := (cAlias)->(VODBGetSelect())
   ENDIF  
RETURN nRet

INTERNAL FUNCTION GetRDDList() AS _RDDLIST
   LOCAL strRDDList AS _RDDLIST
   LOCAL DIM aRDDNames2[2] AS STRING
   LOCAL DIM aRDDNames3[3] AS STRING
   LOCAL dwRDDs AS DWORD
   
   dwRDDs := iif(Empty(NULL_SYMBOL), 2, 3)

   IF dwRDDs == 3
      aRDDNames3[1] := "CAVODBF"
      aRDDNames3[2] := #DBFNTX
      aRDDNames3[3] := NULL_SYMBOL     
      strRDDList := _RDDList{aRDDNames3}
   ELSE
      aRDDNames2[1] := "CAVODBF"
      aRDDNames2[2] := #DBFNTX
      strRDDList := _RDDList{aRDDNames2}
   ENDIF
RETURN strRDDList
nRet is returning 0, eventhough the nArea(LONG) is having a valid handle (2) of DBT file opened.
What could be the reasons for VODBAppend() returning always false ?
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

VODBAppend() returns false

Post by Chris »

Hi Arun,

That's too hard to tell, without any other information about the RDD used, how the file is opened etc. Can you please post a (compilable) full sample (including necessary dbfs) that demonstrates this problem?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ArunBerlin
Posts: 33
Joined: Tue Oct 27, 2020 1:19 pm
Location: India

VODBAppend() returns false

Post by ArunBerlin »

Hi, Thankyou for looking into this issue. I've edited the Question with explanatory functions
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

VODBAppend() returns false

Post by Chris »

Hi Arun,

Thanks for sending the code! In this particular case, the problem is caused because the dbf is opened in read only mode (the last TRUE argument in the call to VoDbUseArea(). Is this the same in your real code?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ArunBerlin
Posts: 33
Joined: Tue Oct 27, 2020 1:19 pm
Location: India

VODBAppend() returns false

Post by ArunBerlin »

Yes, The ReadOnly Param in VoDbUseArea() was causing the issue. Thankyou Chris !!!
Post Reply