If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Web Queries Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-11-04, 17:53
rd_dragon rd_dragon is offline
Registered User
 
Join Date: Jun 2004
Posts: 6
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.
Reply With Quote
  #2 (permalink)  
Old 06-14-04, 11:51
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 06-14-04, 12:24
rd_dragon rd_dragon is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 06-14-04, 12:39
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #5 (permalink)  
Old 06-14-04, 12:49
rd_dragon rd_dragon is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 06-14-04, 12:51
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #7 (permalink)  
Old 06-14-04, 13:18
rd_dragon rd_dragon is offline
Registered User
 
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?
Reply With Quote
  #8 (permalink)  
Old 06-15-04, 10:51
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #9 (permalink)  
Old 06-15-04, 12:50
rd_dragon rd_dragon is offline
Registered User
 
Join Date: Jun 2004
Posts: 6
Quote:
Could it be that you're computer is caching the page?
No I checked this before, and erased the browser cache.

Quote:
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.

Quote:
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On