xsharp.eu • DBServer Difference VO and X#
Page 1 of 1

DBServer Difference VO and X#

Posted: Thu Apr 01, 2021 10:09 am
by HeikoP
Hello,

I´m not sure if you want to get this kind of feedback, but I found a litte difference in the behaviour of x# (Version 2.7 from November 2020) and VO2.8 while using the dbserverclass.

FUNCTION foo() AS LOGIC
LOCAL oDB AS dbserver
LOCAL cFilename AS STRING
cFilename:="c:tempmydbf.dbf"
oDB:=DbServer{cFilename,FALSE,FALSE,"DBFCDX"}
oDB:=DbServer{cFilename,FALSE,FALSE,"DBFCDX"}
IF !oDB:Used
* Print some errorcode
RETURN FALSE
ENDIF
oDB:close()
oDB:=null_object
RETURN TRUE

In VO 2.8 this works. In x# this leads to an error. I know it´s not a good code style, but it´s a difference.

Greetings Heiko

DBServer Difference VO and X#

Posted: Thu Apr 01, 2021 12:50 pm
by Chris
Hi Heiko,

I confirm the incompatibility, in VO when a DBServer cannot be opened due to sharing violation, then no error is reported, just Used returns FALSE, while X# throws an exception. Will take care of this for the next build, thanks for your report!