Hi Luigi,
This is [hb_]dbDrop() syntax:
hb_dbDrop( <cTableName> [, <cOrdBagName>] ;
[, <cRDD>] [, <hConnection>] ) -> <lRemoved>
If you want to remove indexes then you should use:
hb_dbDrop( "mydbf", "myindex1", "DBFNTX" )
hb_dbDrop( "mydbf", "myindex2", "DBFNTX" )
...
If you want to remove table, memo file and production
indexes then you should use:
hb_dbDrop( "mydbf",, "DBFNTX" )
In all cases I suggest to not use file name extensions and
allow RDD to use default ones. Such code is portable and
can work with any RDDs. In generic code you can also ignore
3-rd parameter above - if "DBFNTX" is not given then default
RDD set by rddSetDefault() is used.
Please note that when you remove index you should also pass
table name. In case of DBF* RDDs it's ignored by some other
RDDs may need table name to find index, i.e. such situation
happens in SQL RDBMs. Passing index name as first parameter
to [hb_]dbDrop() is a programmer bug. Some RDDs may try to
open table just to locate index storage and they will report
table corruption error or table does not exists.
Similar syntax is used by [hb_]dbExists().
best regards,
Przemek
On Thu, 11 Feb 2016, Luigi Ferraris wrote:
> Hi guys,
> I need a clarification as per subject. I'll assume to use rdd as parameter,
> but related with DBFNTX: give me a cent for this.
>
> 1st scenario.
> There are (they exist) two files:path_filename.dbf and path_filename.ntx. I
> have used hb_DbDrop( path_filename.dbf, NIL, cRdd ).
> It works fine: all files are removed.
>
> 2nd scenario.
> There is (it exist) one file:path_filename.dbf. I have used hb_DbDrop(
> path_filename.dbf, NIL, cRdd ).
> It works fine: the file is removed.
>
> 3rd scenario: *I know can be considered strange, unusual... anyway*
> There is (it exists) one file:path_filename.ntx. I have used hb_DbDrop(
> path_filename.ntx, NIL, cRdd ).
> It doesn't works: the file is not removed.
>
> Is this the normal behaviour? I repeat: the third scenario can be unusual.
>
> TIA
> Luigi Ferraris
>