Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

SQL delete statement


1 reply to this topic

Barbara

Barbara
  • Members
  • 89 posts

Posted 01 July 2003 - 11:03

I have a problem executing SQL Delete statments from the InstallScript. The function returns always ERROR_SUCCES, but nevertheless seems not to be working. Here is what I am doing:

Created my private database table with the name ADSDialogs and the fields DisplayName, Index, Display (all strings)

The values are initially filled.

During installation I make the following actions: (in InstallSkript)
hDB = MsiGetActiveDatabase(hMSI);
szQuery = "DELETE FROM ADSDialogs WHERE DialogName='InstallWelcome'";
nRes = MsiDatabaseOpenView(hDB, szQuery, hView);
nRes = MsiViewExecute (hView, NULL);
nRes = MsiViewClose(hView);
nRes = MsiCloseHandle(hRec);
nRes = MsiCloseHandle(hView);

All return values are ERROR_SUCCESS

Afterwards I select for this deleted item and I can see, that the entry has not been deleted from my database table.
Also subsequent insert statements for DialogName = DialogName='InstallWelcome' are failing.
Return code is ERROR_FUNCTION_FAILED

Any ideas whats going wrong ? Or is it not possible to delete database entries at runtime ?

Thanks in advance

Barbara
The difference between theory and practice is larger in practice than in the theory.

Barbara

Barbara
  • Members
  • 89 posts

Posted 01 July 2003 - 11:49

Found the solution:
The database table one likes to work with must be created at runtime, then everything ist working. I used a precreated databasetable and for this you can not do Update and Delete - Statements.

Barbara


The difference between theory and practice is larger in practice than in the theory.