Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

No recrodset check

Posted on 1998-10-01
6
Medium Priority
?
182 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 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
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
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

Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

Question has a verified solution.

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

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.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

715 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