Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2004
    Posts
    13

    Unanswered: calling Access from ASP

    Hi guys,
    I am trying to use ASP (vbscript) to bring out Access genereated reports dynamically. The query for the report works fine since the report runs perfectly in Access.
    query looks somethin like this..
    Code:
     sSQL = " SELECT weekendingEmp.WeekEnding, " & _
    	" weekendingEmp.EmployeeID, " & _
    	" Employees.EmployeeName, " & _
    	" Sum(Hours.Hours) AS SumOfHours, " & _
    	" Employees.BaseWeekHours, " & _
    	" Employees.Current " & _
    	" FROM (weekendingEmp LEFT JOIN Hours ON (weekendingEmp.EmployeeID = Hours.EmployeeID) " & _
    	" AND (weekendingEmp.WeekEnding = Hours.WeekEnding)) " & _
    	" INNER JOIN Employees ON weekendingEmp.EmployeeID = Employees.EmployeeID " & _
    	" GROUP BY weekendingEmp.WeekEnding, " & _
    	" weekendingEmp.EmployeeID, " & _
    	" Employees.EmployeeName, " & _
    	" Employees.BaseWeekHours, " & _
    	" Employees.Current "& _
    	" HAVING ((..some condition..) AND (Sum(Hours.Hours)<[BaseWeekHours]) AND ((Employees.Current) = True)) " & _
    	" ORDER BY weekendingEmp.WeekEnding DESC; "
    Interesting thing is, if i take out (Employees.Current = True) statement, i can actually see the report on my asp page..
    but if i keep that statment, i get: "HTTP 404 - File not found" error.. i want to keep that statement because the report is only interested in employees who are currently employeed..
    anybody know wut's wrong?
    any help will be greatly appreciated..
    thanks

  2. #2
    Join Date
    Apr 2004
    Posts
    13
    for more info.. u can check:
    http://www.dbforums.com/showthread.p...51#post3655851

    thanks..

  3. #3
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: calling Access from ASP

    Try using .T. instead of True i.e:

    (Employees.Current = True)

    Does that help?
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  4. #4
    Join Date
    Apr 2004
    Posts
    13
    so u mean..

    Employees.Current = .T.

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by SuNG
    so u mean..

    Employees.Current = .T.
    I vote for Employees.Current = -1

  6. #6
    Join Date
    Apr 2004
    Posts
    13
    damn... gud suggestions.. but for some reason it doesn't work.. it works fine in access, but when it's called from vbscript, no such luck..
    any other syntax suggestions?

    thanks all for ur help..

  7. #7
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    Try converting the field into a integer or string and then do your comparison i.e.

    cstr(Current.Employee)="True"

    or

    cint(Current.Employee)=1

    and see if that works.
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  8. #8
    Join Date
    Apr 2004
    Posts
    13
    damn..
    still not working.. it creates that expression to the query in Access but still doesn't return the data
    maybe i should just give up..
    thanks anyways

  9. #9
    Join Date
    Apr 2004
    Posts
    13
    Hey sup,

    i figured out wut the problem was... u see.. it didn't like "Current" field name because "Current" is actually a key name and is a function...
    so after putting square brackets.. like: [Current] solved the problem..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •