Solved

Some data fields are missing from adodb recordset in asp page

Posted on 2007-04-05
5
393 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
  • 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

831 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