Solved

No recrodset check

Posted on 1998-10-01
6
177 Views
Last Modified: 2013-12-25
I was wondering if there is a way to do a check on a SQL table and if the check came back with the No Current Record error to display one thing, but if the check did find a record to display another thing. Here is what I tried and mean.

<% If Not IsEmpty(rsDBC("vchCardNumber")) Then%>
<table>
      <tr>
            <td>Credit Card Number:</td>
            <td><input type="text" name="CC" size="20" value="<% = rsDBC("vchCardNumber")%>"></td>
            <td><img src="../images/required.gif"></td>
      </tr>
      <tr>
            <td>Expiration Date</td>
            <td><input type="text" name="Expiration" size="6" value="<% = rsDBC("vchExpDate")%>">
            <img src="../images/required.gif"></td>
      </tr>
<% Else %>
<table>
      <tr>
            <td>Credit Card Number:</td>
            <td><input type="text" name="CC" size="20"></td>
            <td><img src="../images/required.gif"></td>
      </tr>
      <tr>
            <td>Expiration Date</td>
            <td><input type="text" name="Expiration" size="6" >
            <img src="../images/required.gif"></td>
      </tr>
<% End If %>
 Thanks
0
Comment
Question by:yolish
[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
  • 3
  • 2
6 Comments
 

Accepted Solution

by:
callapm earned 50 total points
ID: 1855396
Have you tried the RecordCount property of the RecordSet object?  

<%   DIM varCount
        varCount = rsDBC.RecordCount
        If varCount >0 Then%>

of course, for this to work, you would have to execute an SQL statement that would select that field only from the database you are working with.  Create a new recordset, and use the code above - replacing the recordset name, though.  

hope this helps
0
 
LVL 28

Expert Comment

by:sybe
ID: 1855397
If Not RS.EOF
0
 

Author Comment

by:yolish
ID: 1855398
The If Not rs.eof worked, thank you very much for the help
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 28

Expert Comment

by:sybe
ID: 1855399
Thanks, but you gave the points to callapm
0
 

Author Comment

by:yolish
ID: 1855400
Sorry, how would I have gave you the points, if callapm had a lock on the question?
0
 
LVL 28

Expert Comment

by:sybe
ID: 1855401
you could have rejected the answer, then the question is open again.

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 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