Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 372777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:14:37+00:00 2026-05-12T14:14:37+00:00

I have a classic ASP page with some code to check if an email

  • 0

I have a classic ASP page with some code to check if an email exists in the table as follows;

<%
    '' //Check the submitted email against existing ones in the database
    set CmdCheckEmail = server.CreateObject("ADODB.Command")
    CmdCheckEmail.ActiveConnection = MM_dbconn_STRING
    CmdCheckEmail.CommandText = "SELECT COUNT(ReferredEmail) AS 'CountEmail' FROM TenantReferral WHERE ReferredEmail = '" & Request("Email") & "'"
    Response.Write(CmdCheckEmail.CommandText)
    CmdCheckEmail.CommandType = 1
    CmdCheckEmail.CommandTimeout = 0
    CmdCheckEmail.Prepared = true
    CmdCheckEmail.Execute()

    countEmail = CmdCheckEmail("CountEmail")

    set CmdCheckEmail = nothing
    conn.close
    set conn = nothing

    If(countEmail >= 1) Then
        Message = Message & "<p>This email address has already been referred.</p>"
    End If
%>

However, the page is reporting the following error;

SELECT COUNT(ReferredEmail) AS 'CountEmail' FROM TenantReferral WHERE ReferredEmail = 'test@xyz.com'

ADODB.Command error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/default2.asp, line 19

Line 19 is as follows;

countEmail = CmdCheckEmail("CountEmail")

The email does exist in the table and the table simply has the following columns; ReferredEmail and ReferredCode

I wondered if anyone might be able to shed any light on this error?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:14:37+00:00Added an answer on May 12, 2026 at 2:14 pm

    Note sure what database you are using but try changing your sql to:

    SELECT COUNT(ReferredEmail) AS CountEmail FROM TenantReferral WHERE ReferredEmail = 'test@xyz.com'
    

    Then change

    CmdCheckEmail.Execute()    
    countEmail = CmdCheckEmail("CountEmail")
    

    to

    set rs = CmdCheckEmail.Execute()
    countEmail = rs("CountEmail")
    

    Also, you have a SQL injection issue with that query. You should be using parameterized queries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code on a classic ASP page that is attempting to get
NET and VB.net code behind. I have a classic ASP page that connects to
If I have the following jscript code on a classic asp page, how do
I have an ASP Classic page with a table. Is it possible to allow
I have a classic ASP page that calls in some other ASP files using
I have a Classic ASP page that contains the following code to attempt a
So I have visual basic code in a classic asp page where I want
I have a select box on a classic ASP page which looks like this:
I have a login page written in classic asp. I want to set the
I have a SQL interface page in my classic ASP web app that allows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.