xsharp.eu • What could be the reasons for VODBUseArea() returning false ?
Page 1 of 1

What could be the reasons for VODBUseArea() returning false ?

Posted: Fri Apr 30, 2021 6:20 am
by ArunBerlin

Code: Select all

FUNCTION _DictOpen(pszDictName AS PSZ,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 := Psz2String(pszDictName) + ".DBZ"
   cAlias := "__" + Str(100000 + VODBSetSelect(0),6,0)

      strRDDList := GetRDDList()
      IF VODBUseArea(TRUE, strRDDlist, cFile, cAlias, (nShare == 1), (nRO == 1)) .and. !NetErr()
         nRet := (cAlias)->(VODBGetSelect())
      ENDIF
RETURN nRet

INTERNAL FUNCTION GetRDDList() AS _RDDLIST
    Local X_RDDMAIN := #DBFNTX 
   LOCAL strRDDList AS _RDDLIST
   LOCAL DIM aRDDNames2[2] AS STRING
   LOCAL DIM aRDDNames3[3] AS STRING
   LOCAL dwRDDs AS DWORD

   aRDDNames2[1] := "CAVODBF"
   aRDDNames2[2] := X_RDDMAIN
   strRDDList := _RDDList{aRDDNames2}

RETURN strRDDList
pszDictName contains full path of the file but VODBUseArea is always returning false. What could be the reasons ? How can I debug it ?

What could be the reasons for VODBUseArea() returning false ?

Posted: Fri Apr 30, 2021 7:49 am
by Chris
Hi Arun,

You can call _VoDbErrInfoPtr(), this will return an Exception object for the last error that happened, if there was any, it should give you all the info you need. Try _VoDbErrInfoPtr():Message first maybe.

What could be the reasons for VODBUseArea() returning false ?

Posted: Fri Apr 30, 2021 8:04 am
by ArunBerlin
Got the error "Could not find file 'File.DBT".
Yeah, DBT file is missing in the path. But I'm expecting to open a DBZ file, as per the code. Is there any way to open .DBZ files ?

What could be the reasons for VODBUseArea() returning false ?

Posted: Fri Apr 30, 2021 11:55 am
by Chris
Hi Arun,

What is the dbz file format? I searched for it but only found references for a compressed file format which does not seem to be relevant to xBase, or am I wrong about this?

Or are your files regular .dbf files that simply use the .dbz extension? In that case, I think your dbf includes a memo field, is that right? So you get the error when trying to open the .dbt file for this memo.

What could be the reasons for VODBUseArea() returning false ?

Posted: Fri Apr 30, 2021 12:40 pm
by ArunBerlin
No, DBZ is a different kind of files containing pointer values to the DBV (Memo files). The problem is solved. I missed some RDD drivers related to working with DBV and DBZ files. Thankyou Chris for your replies