Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2004
    Posts
    6

    Unanswered: Web Queries Problem

    I created an ASP page connecting to a Access DB, I have a few queries that present totals based upon entered data in the DB to the ASP page. The queries work just fine in the DB, but give me the same values for each record tied to it on the webpage. For example I have a page displaying deposits and short / overage in cash. I have a query that calcs the short / overage in cash for each record. When I display all the records on the same page, the short / overage in the first record is the same in the rest. When I show them one at a time, the records are correct until I go to a previous record, and all the totals are the same again.

    The totals in the DB are correct, just the totals displayed are wrong, could this just be an HTML issue or an SQL statement problem.

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    It's difficult to diagnose without some code...
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Jun 2004
    Posts
    6
    Here is the display statement:

    <%= FormatCurrency((rsShortOver.Fields.Item("ShortOver ").Value), -1, -2, 0, -2) %>

    Here is the Recordset:

    <% Dim rsShortOver Dim rsShortOver_numRows Set rsShortOver = Server.CreateObject("ADODB.Recordset") rsShortOver.ActiveConnection = MM_connDailyDeposit_STRING rsShortOver.Source = "SELECT * FROM quShortOver" rsShortOver.CursorType = 0 rsShortOver.CursorLocation = 2 rsShortOver.LockType = 1 rsShortOver.Open() rsShortOver_numRows = 0 %>

    Here is the Query from the database:

    ShortOver: (January!DDGeneralDeposit+January!DDVisaMC+January !DDAMEX+January!DDDiscover+January!DDDinersClub+Ja nuary!DDInternetSales)-(January!DDRegisterSales-January!DDPayOut)

    Anything else needed, please let me know.

    Thank you

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Where is the code where you're displaying or calc'ing the values returned in the recordset?
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    Jun 2004
    Posts
    6
    I am displaying it in a HTML table:


    <tr>
    <td height="30" valign="middle">AMEX:</td>
    <td valign="middle">
    <%= FormatCurrency((rsDisplay.Fields.Item("DDAMEX").Va lue), -1, -2, 0, -2)%> </td>
    <td colspan="2" valign="middle">Short / Over:</td>
    <td valign="middle"><%= FormatCurrency((rsShortOver.Fields.Item("ShortOver ").Value), -1, -2, 0, -2) %></td>
    </tr>


    Is this what you mean? I am new to ASP scripting, and using DWMX to do most of it.

  6. #6
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Are you expecting multiple rows to be returned here? If so, you need a loop with a rsShortOver.MoveNext call.
    That which does not kill me postpones the inevitable.

  7. #7
    Join Date
    Jun 2004
    Posts
    6
    No I am displaying one row per page, one record view per page. It seems not to be re running the query for each new record displayed. How can I force the query to re-run when each record is displayed and display the new infomation?

  8. #8
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Could it be that you're computer is caching the page? How are you navigating between previous and next records? Could it be that you're not passing the correct values?
    That which does not kill me postpones the inevitable.

  9. #9
    Join Date
    Jun 2004
    Posts
    6
    Could it be that you're computer is caching the page?
    No I checked this before, and erased the browser cache.

    How are you navigating between previous and next records?
    I am using DWMX Recordset Paging on one page, and I am listing all of the records on another page. I have created two display pages to decide how I want to display the data.

    Could it be that you're not passing the correct values?
    What values would that be, all other fields are updating and displaying correctly. Only the fields that have the queries are not working.

Posting Permissions

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