PDA

View Full Version : MsiDatabaseOpenView fails in 10.5



orangedi
01-14-2005, 01:25 PM
I get ERROR_INVALID_HANDLE return when I try to open the database using MsiDatabaseOpenView. I am using it in a dll immediately after


hDatabase = MsiGetActiveDatabase(hInstall);
which returns ERROR_SUCCESS.

and the line looks like this

MsiDatabaseOpenView(hDatabase, "SELECT * FROM ListBox", &hView);
the dll is called from the source directory using an installscript custom action. This is a basic MSI Project.

This most likely points to YET ANOTHER bug in 10.5 since this worked perfectly using an identical dll in an older version of installshield professional. I sadly join the ranks of those that deeply regret upgrading our installshiled products.

oBladeo1
01-18-2005, 11:02 AM
I do this and it works fine

nResult = MsiDatabaseOpenView( ISMSI_HANDLE, "SELECT * FROM ListBox", hView );
if (nResult = ERROR_SUCCESS) then
MsiViewExecute(hView,0);
while (MsiViewFetch(hView, hRec) == ERROR_SUCCESS)
nResult = MsiViewModify(hView, MSIMODIFY_DELETE, hRec);
endwhile;
endif;


can't think why yours doesn't work