updating document attributes

I am trying to use the PW API functions from C++ to update several attributes of documents. Although the sql calls return legitimate data and the functions called in the following code do not return any errors, the attributes are not changed when I look at the document properties.

//--------------------------------------------------------

targetBuf = aaApi_SelectLinkDataBuffer (fldrID, docID);

if (!targetBuf)

{

fwprintf_s(fpLog,_T("Unable to get buffer for %s\n"),filename);

skipFile = true;

}

else

{

if (!skipFile)

{

sVal = aaApi_DmsDataBufferGetStringProperty (targetBuf, LINK_PROP_COLUMN_VALUE, 0);

if (sVal != "")

{

if ((lColumnID = aaApi_DmsDataBufferGetNumericProperty (targetBuf, LINK_PROP_COLUMNID, 0)) == 0)

{

fwprintf_s(fpLog,_T("Error in aaApi_DmsDataBufferGetNumericProperty\n"));

skipFile = true;

}

else

{

//update all column values in buffer

swprintf_s(sqlQ, MAXQLEN, _T("%s\'%s\'"),sql2,jobStr);

if (aaApi_SqlSelect (sqlQ, NULL, &numCols) > 0)

{

if ((Location = aaApi_SqlSelectGetData(0, 0)) != NULL)

{

if (!aaApi_UpdateLinkDataColumnValue (tabID, location_descID,Location))

{

fwprintf_s(fpLog,_T("Unable to UpdateLinkDataColumnValue:%s\n"),aaApi_GetLastErrorMessage());

skipFile = true;

}

//more sql calls and updates have been omitted from this excerpt

}

}

if (!aaApi_UpdateLinkData (tabID, lColumnID, sVal))

{

skipFile = true;

swprintf_s(msg,MAXLINELEN,_T("aaApi_UpdateLinkData error: %s"),aaApi_GetLastErrorMessage());

fwprintf_s(fpLog,_T("%s\n"),msg);

}

aaApi_DmsDataBufferFree (targetBuf);

}

}

}

}

 

//----------------------------------------------------

Does anyone have some suggestions regarding why this isn't working?

 

 

Thanks,

Stephanie

Parents Reply Children
No Data