C Examples: DbiDeleteTable

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiDeleteTable

Return to chapter overview

Delete a table.

Must have sufficient rights. This example uses the following input:
         fDbiDeleteTable(hDb, "dBASE_TBL.DBF");

DBIResult fDbiDeleteTable(hDBIDb hDb, pCHAR TblName)

{

  DBIResult   rslt;

  rslt = Chk(DbiDeleteTable(hDb, TblName, NULL));

  return rslt;

}

Delete an opened table.

Once executed, the cursor is closed and the table deleted. This example uses the following input:
         fDbiDeleteTable(hDb, &hCur);

DBIResult fDbiDeleteTable(hDBIDb hDb, phDBICur phCur)

{

   DBIResult   rslt;

   CURProps    Props;

 

   rslt = Chk(DbiGetCursorProps(*phCur, &Props));

   if (rslt != DBIERR_NONE)

      return rslt;

 

   rslt = Chk(DbiCloseCursor(phCur));

   if (rslt != DBIERR_NONE)

      return rslt;

 

   rslt = Chk(DbiDeleteTable(hDb, Props.szName, Props.szTableType));

 

   return rslt;

}