Solved

Some data fields are missing from adodb recordset in asp page

Posted on 2007-04-05
5
397 Views
Last Modified: 2007-04-05
This ASP page does the following:
1. Creates an ADODB.Recordset object
Dim rsRequestDetail

Set rsRequestDetail = Server.CreateObject("ADODB.Recordset")
rsRequestDetail.ActiveConnection = connString
rsRequestDetail.Source = "SELECT * FROM vRequestDetails WHERE reqID=" & lngRecordNo  
rsRequestDetail.CursorType = 0
rsRequestDetail.CursorLocation = 2
rsRequestDetail.LockType = 1

2. Open the recordset
rsRequestDetail.Open()

3. Embeds the values inside of basic HTML code.
<tr id="foodRow">
      <td class="td-label">Type of Food & Beverage:</td>
      <td class="td-value" colspan="3"><%=rsRequestDetail("reqFoodDesc")%></td>
</tr>
<tr id="ccNameRow">
      <td class="td-label">Name on Credit Card:</td>
      <td class="td-value" colspan="2"><%=rsRequestDetail("reqCCName")%></td>
</tr>
<tr id="ccNumberRow">
      <td class="td-label">Number:</td>
      <td class="td-value"><%=rsRequestDetail("reqCCNumber")%></td>
</tr>
<tr id="ccTypeExpRow">
      <td class="td-label">Type:</td>                        
      <td class="td-value"><%=rsRequestDetail("reqCCType")%></td>                  
                        
      <td class="td-label">Expiration:</td>
      <td class="td-value"><%=rsRequestDetail("reqCCExpMonth") & "/" & rsRequestDetail("reqCCExpYear")%></td>      
</tr>

The problem is that some data fields are missing from the recordset.  I can query the DB directly and see that they are there.  The query will retrieve records correctly with these missing fields used as criteria, but when those values are used, they are blank/null.  Another anomoly is that the mystery elements are usually, but not always the same fields.

Thanks,
Robert
0
Comment
Question by:neudeal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 16

Accepted Solution

by:
golfDoctor earned 500 total points
ID: 18859642
Remove the other code and try this.

Set rsRequestDetail = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM vRequestDetails WHERE reqID=" & lngRecordNo  
rsRequestDetail.open sql, connString, 2, 3

Same result?
0
 

Author Comment

by:neudeal
ID: 18859667
Worked perfectly... Thanks so much!!  What was the problem with the original code by the way?

Thanks,
Robert
0
 
LVL 16

Expert Comment

by:golfDoctor
ID: 18859685
CursorType and CursorLocation you use prevent proper movement through recordset.
0
 
LVL 16

Expert Comment

by:golfDoctor
ID: 18859690
0
 
LVL 16

Expert Comment

by:golfDoctor
ID: 18859698
CursorType 1, 2, or 3 would most like work in your original code, instead of 0.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBScript on Html 15 65
CREATE DATABASE 3 46
MS SQL + date 6 54
StoredProcedure to JSON query faulty syntax 2 45
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question