Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

VODBAppend() returns false 17 Aug 2022 17:18 #23346

  • ArunBerlin
  • ArunBerlin's Avatar
  • Topic Author


  • Posts: 14
  • LOCAL nRet := 1 AS LONG
    nRet := iif((nArea)->(VODBAppend(TRUE)) .and. !NetErr(),1,0)
    Edit:
    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 ?

    Please Log in or Create an account to join the conversation.

    Last edit: by ArunBerlin. Reason: Added explanatory functions

    VODBAppend() returns false 17 Aug 2022 17:43 #23350

    • Chris
    • Chris's Avatar


  • Posts: 3539
  • 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?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    VODBAppend() returns false 22 Aug 2022 09:10 #23430

    • ArunBerlin
    • ArunBerlin's Avatar
    • Topic Author


  • Posts: 14
  • Hi, Thankyou for looking into this issue. I've edited the Question with explanatory functions

    Please Log in or Create an account to join the conversation.

    VODBAppend() returns false 22 Aug 2022 10:41 #23436

    • Chris
    • Chris's Avatar


  • Posts: 3539
  • 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?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    VODBAppend() returns false 22 Aug 2022 11:06 #23440

    • ArunBerlin
    • ArunBerlin's Avatar
    • Topic Author


  • Posts: 14
  • Yes, The ReadOnly Param in VoDbUseArea() was causing the issue. Thankyou Chris !!!

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1