Solved

Some data fields are missing from adodb recordset in asp page

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
If-Then-Else ASP problem 6 67
Help with query 3 31
Time Conversions...both ways 2 16
Save ms data to server side. 19 55
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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

828 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