Solved

Some data fields are missing from adodb recordset in asp page

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
currencylayer API intergrate to ASP 25 65
add custom headers to my mail 2 48
INNER JOIN ? 8 41
Using Classic ASP inside HTML pages 2 56
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

15 Experts available now in Live!

Get 1:1 Help Now