« Previous Next »

Thread: ASP Problems Creating Chart Output

Last post 08-16-2005 7:31 AM by LogParser User : Igor Shastitko. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 08-12-2005, 4:12 AM

    ASP Problems Creating Chart Output

    Hi there, Not 100% sure if this right section of forum to post but I'm after some help

    Am trying to create a web-based interface for log parser using ASP.

    With the following code, the .GIF file is not created for some reason and I get an error of:

    Task aborted.

    Statistics:
    -----------
    Elements processed: 0
    Elements output: 0
    Execution time: 0.36 seconds

    If I copy & paste the name query produced to the command prompt it runs fine, however doesn't work running from asp.

    Running command from there for creating a .txt file works fine, just have problems doing a .GIF.

    Any ideas would be greatly appreciated.

    <%
    dim name
    dim site
    dim date
    dim day
    dim month
    dim year
    dim csusername
    dim groupby
    dim orderby


    csusername = (request.Form("cs-username"))
    day= (request.Form("day"))
    month= (request.Form("month"))
    year=(request.Form("year"))
    site= (request.Form("site"))
    groupby = (request.Form("groupby"))
    orderby = (request.Form("orderby"))
    date=""& year &"-"& month &"-"& day &""


    name="C:\logparser.exe -o:CHART ""SELECT date, count(c-ip) INTO c:\NoscoStats\ISStrategyTrend.gif FROM c:\NoscoStats\Temporary.txt WHERE date > '" & date & "' AND cs-uri-stem LIKE '"& site &"' AND cs-username NOT LIKE '" & csusername & "' GROUP BY " & groupby & " ORDER BY " & orderby & """ -groupSize:800x400 -i:iisw3c -chartType:ColumnStacked -chartTitle:""IS Strategy Since Feburary 2005"""

    response.write(name>

    Response.Write ("<br>")

    Set objWShell = CreateObject("WScript.Shell")
    Set objCmd = objWShell.Exec(name)
    strPResult = objCmd.StdOut.Readall()
    set objCmd = nothing: Set objWShell = nothing
    response.write ".<br>" & replace(strPResult,vbCrLf,"<br>")

    %>

  • 08-12-2005, 12:20 PM In reply to

    RE: ASP Problems Creating Chart Output

    Hi,

    Maybe, problem is in IIS security. What account use IIS to run asp code? Maybe, this user account doesn't have any permissions to run CHART object.
    BTW, what IIS version are you use?
    why are you call LP directly using WShell.exec? You can use code likes this:

    Set oLogQuery = CreateObject("MSUtil.LogQuery")
    Set oInputFormat = CreateObject("MSUtil.LogQuery.IISW3CInputFormat")
    Set oOutputFormat = CreateObject("MSUtil.LogQuery.ChartOutputFormat")

    strQuery = "SELECT  blah-blah-blah INTO chart.gif FROM ...."
    oLogQuery.ExecuteBatch strQuery, oInputFormat, oOutputFormat

  • 08-15-2005, 8:03 AM In reply to

    RE: ASP Problems Creating Chart Output

    Hey, Thanks for the help. Changed it as you suggested and the chart now works fine when i run it locally from the server box. However, when I try and run the .asp page remotely i get the error message:

    CLogQueryClass error '80020009'

    Error executing query: Unexpected internal error calling chart object method ExportPicture: Exception occurred. [Exception occurred.]

    /Code/Stats/stat.asp, line 64

    Would this be due to IIS security settings or something? Any ideas? We are running IIS 6.

    <%
    dim name
    dim site
    dim date
    dim day
    dim month
    dim year
    dim csusername
    dim groupby
    dim orderby


    csusername = (request.Form("cs-username"))
    day= (request.Form("day"))
    month= (request.Form("month"))
    year=(request.Form("year"))
    site= (request.Form("site"))
    groupby = (request.Form("groupby"))
    orderby = (request.Form("orderby"))
    date=""& year &"-"& month &"-"& day &""

    Set oLogQuery = CreateObject("MSUtil.LogQuery")
    set oInputFormat = CreateObject("MSUtil.LogQuery.IISW3cInputFormat")
    set oOutputFormat = CreateObject("MSUtil.LogQuery.ChartOutputFormat")

    strQuery = "SELECT date, count(c-ip) INTO c:\NoscoStats\ISStrategyTrend.gif FROM c:\NoscoStats\Temporary.txt WHERE date > '" & date & "' AND date < '" & date1 & "' AND cs-uri-stem LIKE '"& site1 &"' AND cs-username NOT LIKE '" & csusername & "' AND cs-username NOT LIKE '" & csusername1 & "' AND cs-username NOT LIKE '" & csusername2 & "' AND cs-username NOT LIKE '" & csusername3 & "' GROUP BY " & groupby & " ORDER BY " & orderby & ""
    oLogQuery.ExecuteBatch strQuery, oInputFormat, oOutputFormat

    %>

  • 08-16-2005, 7:31 AM In reply to

    RE: ASP Problems Creating Chart Output

    Hi,

    Check NTFS security permissions on c:\NoscoStats directory. If you use Default web site IIS6 your application runs as Network Service. This user might hasn't NTFS permissions to create files there. The first solution is change NTFS permissions (using Windows Explorer), the second is change (or create new pool with different settings) AppPool's identity user (using IIS Manager). You can set DefaultAppPool's identity as Local System for example.

Page 1 of 1 (4 items)
Microsoft Communities