PDA

View Full Version : Usage of '_Tables' table in Standard Project



lokshin
04-09-2002, 07:00 AM
Hi,

My question is: are there any opportunities to use '_Tables' Table in run-time for Standard Project?

RobertDickau
04-09-2002, 04:12 PM
Yes, it's available if you want to use it; for example, to determine if a table exists:

function OnBegin( )
HWND hDB, hView, hRec;
begin

hDB = MsiGetActiveDatabase(ISMSI_HANDLE);

MsiDatabaseOpenView(hDB, "SELECT * FROM `_Tables` WHERE `Name`='Feature'", hView);
MsiViewExecute(hView, 0);
if (MsiViewFetch(hView, hRec) == ERROR_SUCCESS) then
MessageBox("Found the Feature table...", INFORMATION);
else
MessageBox("No Feature table, I guess...", WARNING);
endif;

// call MsiViewClose, MsiCloseHandle, etc.

end;

lokshin
04-10-2002, 02:58 AM
Thanks Robert,

But I have another problem. I added some custom tables to my project and I have to check whether these tables present in run-time. As far as I understand '_Tables' contains only built-in tables and not the all tables.

RobertDickau
04-10-2002, 07:39 AM
No, _Tables includes custom tables, too.

lokshin
04-11-2002, 03:14 AM
Thanks. I works.