I am working on a custom dialog to display a list of the settings that
the user has selected so that they can check them, and go back if necessary,
before they click on Install to begin the actual installation.
I have got a Custom Action written in InstallScript that determines the
current settings and then calls another function to do the insert.

function ListBoxInsert(hMSI, sProperty, nIndex, sText)
STRING sTemp, sQuery;
NUMBER nResult, hDatabase, hView;
NumToStr(sTemp, nIndex);

sQuery = "INSERT INTO ListBox (Property, `Order`, Value, Text) VALUES
('" +
sProperty + "', " + sTemp + ", '" + sTemp + "', '" + sText + "')";

hDatabase = MsiGetActiveDatabase(hMSI);
nResult = MsiDatabaseOpenView(hDatabase, sQuery, hView);
if (nResult = ERROR_SUCCESS) then
nResult = MsiViewExecute(hView, NULL);
nResult = MsiDatabaseCommit(hDatabase);

return nResult;

This seems to be OK, but at runtime it does not put any data into the
ListBox table. Instead the call to MsiViewExecute() returns error numner

The Custom Action function that uses the above function is called by the
previous dialog to the one containing the relevant ListBox object, in the
"Next" button's event list, before the NewDialog call. The ordering is
correct (I have checked with ORCA).

Does anyone know what the problem is? Is it a) a problem with my code,
or b) a Windows Installer problem. I am using ISWI 1.10.