开发者

MsiDatabaseOpenView returns 1615 with 2 transforms

I found MsiDatabaseOpenView returning 1615 (ERROR_BAD_QUERY_SYNTAX) with seemingly valid query but that doesn't seem to be quite the same issue - in that one, the query was modified and worked without a particular insertion. I also found a post somewhere that discussed the same error but the cause there was that the table being queried didn't exist.

In my case, the query should be truly simple: SELECT * FROM Property (Doesn't have to be the Property table, any table gives the same result). The code used to do the query is also simple:

IntPtr dbhandle = IntPtr.Zero;
IntPtr vie开发者_Go百科whandle = IntPtr.Zero;
int result = 0;

MsiOpenDatabase(@"<base MSI path goes here>", (IntPtr)2, ref dbhandle);

// Apply transforms 1 and 2
MsiDatabaseApplyTransform(dbhandle, @"<first transform path>", 0);
MsiDatabaseApplyTransform(dbhandle, @"<second transform path>", 0);

viewhandle = IntPtr.Zero;
result = MsiDatabaseOpenView(dbhandle, "SELECT * FROM `Property`", ref viewhandle);

The wierd part: I only get the return of 1615 when there are two transforms. Either transform individually works and the package installs correctly with both transforms in place. We've got several apps that have two transforms and they all have the same behavior.

Both of the MsiDatabaseApplyTransform calls seem to be working (at least they return 0). Turning on MSI logging does not create any logs.

Anyone have any idea what's happening/where to look?


Try looking at what MsiGetLastErrorRecord tells you. Also consider setting the Debug policy to get some deeper information shunted to a log (I believe it shows up in the debug stream viewable with dbgview).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜