Hi
I have some problem to delete record from LIstBox table and I don't know what is wrong
Here is part of my code
UINT DeleteFromListBox(MSIHANDLE hInstall, MSIHANDLE hDatabase, LPCTSTR strPropertyValue)
{
UINT nRetval = ERROR_SUCCESS;
TCHAR* strQuery = _T("DELETE FROM `ListBox` WHERE `ListBox`.`Value`='?' AND `ListBox`.`Property`='?'");
MSIHANDLE hView = 0;
MSIHANDLE hRecord = 0;
DWORD dwLen;
TCHAR strValue[128];
dwLen = TSIZEOF(strValue);
nRetval = MsiGetProperty(hInstall, strPropertyValue, strValue, &dwLen);
if (ERROR_SUCCESS != nRetval)
goto cleanup;
nRetval = MsiDatabaseOpenView(hDatabase, strQuery, &hView);
if (ERROR_SUCCESS != nRetval)
goto cleanup;
hRecord = MsiCreateRecord(2);
MsiRecordSetString(hRecord, 1, strValue);
MsiRecordSetString(hRecord, 2, strPropertyValue);
nRetval = MsiViewExecute(hView, hRecord);
if (ERROR_SUCCESS != nRetval)
goto cleanup;
nRetval = MsiCloseHandle(hRecord);
if (ERROR_SUCCESS != nRetval)
goto cleanup;
nRetval = MsiDatabaseCommit(hDatabase);
if (ERROR_SUCCESS != nRetval)
goto cleanup;
cleanup:
if (0 != hRecord)
MsiCloseHandle(hRecord);
return nRetval;
}
I can add records into talble without problems but I can not delete it.
Everything looks be all right because all function always return SUCCESS, I am forgot something?
Thanks for any reply,
Elanius.
FOLLOW US
Get the latest news in Application Packaging