解析查询时出错:指定的 FROM-ENTITY "<1>" 无效 [文件名、目录名或卷标语法不正确。]
<1>
在 Log Parser 2.2 中的 sql 中使用时正在工作,该文件夹存在。如果我关注文章 - ADO.NE 的 LogParser DataProvider,查询正在工作
try
{
ILogRecord rowLP = null;
ILogRecordset rsLP = null;
LogQueryClass logQuery = new LogQueryClass();
COMW3CInputContextClass comW3CInputContext = new COMW3CInputContextClass();
string strSQL = @"SELECT " +
@"COUNT(*) AS [Requests], " +
@"DIV(DIV(SUM(cs-bytes), 1024), 1024) AS [MBytes received], " +
@"DIV(DIV(SUM(sc-bytes), 1024), 1024) AS [MBytes sent], " +
@"c-ip AS [IP Address], cs(User-Agent) AS [User agent], " +
@"MAX(date) AS [Last visit] " +
@"FROM <1> " +
@"GROUP BY [IP Address], [User agent] " +
@"ORDER BY [Requests] DESC";
// run the query against W3C log
rsLP = logQuery.Execute(strSQL, comW3CInputContext);
rowLP = rsLP.getRecord();
}
catch (System.Runtime.InteropServices.COMException exc)
{
Console.WriteLine("Unexpected error: " + exc.Message);
}