summaryrefslogtreecommitdiff
path: root/src/sql/xbdrptbl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/xbdrptbl.cpp')
-rwxr-xr-xsrc/sql/xbdrptbl.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sql/xbdrptbl.cpp b/src/sql/xbdrptbl.cpp
index b03ee8f..ee3e325 100755
--- a/src/sql/xbdrptbl.cpp
+++ b/src/sql/xbdrptbl.cpp
@@ -2,7 +2,7 @@
XBase64 Software Library
-Copyright (c) 1997,2003,2014,2022 Gary A Kunkel
+Copyright (c) 1997,2003,2014,2022,2023 Gary A Kunkel
The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.
@@ -86,8 +86,10 @@ xbInt16 xbSql::SqlDropTable( const xbString &sCmdLine ){
dbf = xbase->GetDbfPtr( fDbf.GetFqFileName());
if( !dbf ){
- dbf = xbase->Open( sTableName, iRc );
- if( iRc != XB_NO_ERROR ){
+
+ //dbf = xbase->Open( sTableName, iRc );
+ iRc = xbase->OpenHighestVersion( sTableName, "", &dbf );
+ if( iRc != XB_NO_ERROR ){
if( iRc == XB_FILE_NOT_FOUND && bIfExists ){
return XB_NO_ERROR;
} else {
@@ -106,6 +108,9 @@ xbInt16 xbSql::SqlDropTable( const xbString &sCmdLine ){
iErrorStop = 130;
throw iRc;
}
+
+ delete dbf;
+ // dbf = NULL;
}
catch (xbInt16 iRc ){