Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

No recrodset check

Posted on 1998-10-01
6
Medium Priority
?
183 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
  • 3
  • 2
6 Comments
 

Accepted Solution

by:
callapm earned 200 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

916 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