| |
Welcome to the dBforums forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact support.
If you prefer not to see double-underlined words and corresponding ads, place your cursor here for ContentLink opt out.
|
 |

06-11-04, 18:53
|
|
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.
|
|

06-14-04, 12:51
|
|
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.
|
|

06-14-04, 13:24
|
|
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
|
|

06-14-04, 13:39
|
|
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.
|
|

06-14-04, 13:49
|
|
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.
|
|

06-14-04, 13:51
|
|
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.
|
|

06-14-04, 14:18
|
|
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?
|
|

06-15-04, 11:51
|
|
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.
|
|

06-15-04, 13:50
|
|
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.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|