Solved

Some data fields are missing from adodb recordset in asp page

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now