ade_oddeletefield

Land Desktop Development ARX CPP SDK

Up a level
ade_oddeletefield
 
 

Deletes fields from a table.

int

ade_oddeletefield(

char* tabname,

struct resbuf* fieldList);

Returns RTNORM or an error code.

tabname The table name, which can be up to 25 characters long. It must be unique, contain no spaces, and start with an alphanumeric character.
fieldlist A list of field names.

The function deletes the fields from the table and from each of its records. The data contained in these fields is also deleted. In other words, it deletes the fields and their data from each set of object data defined by the table and attached to an object.

Note  The fieldlist argument for ade_oddeletefield is a list of field names only. In the companion functions, ade_odaddfield and ade_odmodifyfield, it is a list of field definitions.

The ade_oddeletefield function affects all active drawings in the drawing set. There should not be any queried objects for this operation.

Note  This function will not operate unless your end user has superuser privileges.

The following sample creates a resbuf containing the fields to delete. ade_oddeletefield() uses this resbuf and returns a result code indicating a successful operation. Then it releases the resbuf, as required.

struct resbuf* pDeleteFieldsRb = NULL;
char* pszOdTable = "table1";
pDeleteFieldsRb = acutBuildList(
                                RTSTR, "field1",
                                RTSTR, "field2",
                                RTSTR, "field3",
                                0 );
int nResultCode = ade_oddeletefield(pszOdTable, pDeleteFieldsRb);
if (RTNORM == nResultCode) {
    acutPrintf(
        "\nThe fields specified have been successfully deleted.");
}
else {
    acutPrintf(
        "\nThe fields specified have not been deleted.");
}
acutRelRb(pDeleteFieldsRb);