I want to implement one function which checks if one file (e.g. 'test.exe'

To check the file version of the installed file 'test.exe' is not the problem, but how can I get the file version from the file to be installed ('test.exe'

My idea is to open the installer database with this code:
hDatabase=MsiGetActiveDatabase(hMSI);
strQuery="SELECT Version FROM File WHERE FileName='test.exe'";
nResult = MsiDatabaseOpenView(hDatabase,strQuery,hView);
So I get a database view called "hView", but I can't get the "version" from this view because I don't know how to extract information from a view and I couldn't also find any information about that.
Maybe my way is wrong and anyone knows another solution for my problem, this would be really great.
Otherwise if anybody could help me with the extraction from a view...
Thanks for everything and for your help.
mat