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 8660921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:22:41+00:00 2026-06-12T16:22:41+00:00

Here is a record set. … Set adoCommand = CreateObject(ADODB.Command) Set adoConnection = CreateObject(ADODB.Connection)

  • 0

Here is a record set.

...
 Set adoCommand = CreateObject("ADODB.Command")
 Set adoConnection = CreateObject("ADODB.Connection")
...
 adoCommand.CommandText = strQuery
 Set adoRecordset = adoCommand.Execute

And I need to check this recordset has some value or not.

If adoRecordset.Fields("userid").Value Then 
   'do something...
Else
   'do something...
End If

I just tried to check but this code makes occurs an error.
(The Error message below is translated by Google)

ADODB.Recordset Error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal

If possible, I want to use Ternary operator.
I don’t know which part is wrong.

userid = adoRecordset.Fields("userid").Value ? adoRecordset.Fields("userid").Value : sw

Please understand that I’m a very newbie to asp, 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-06-12T16:22:42+00:00Added an answer on June 12, 2026 at 4:22 pm

    You need to check for the existence of any rows in the resultset before attempting to access them by name:

    If adoRecordset.eof Then 
      '//no rows
    else
      '//
    

    There is no ternary operator in VBScript.

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

Sidebar

Related Questions

I need to find all patrons that have at least 1 circulation record. Here's
Here is my code to get Notes from AddressBook. +(NSString*)getNote:(ABRecordRef)record { return ABRecordCopyValue(record, kABPersonNoteProperty);
I have a master record which I'd like to use with. Here's a very
I'm attempting to use a record in a guard as described here[1]. If I
I'm trying to record sound by creating an android application. here is the code:
I want to insert a date record to an Access database. Here is my
I am trying to insert a record into my database. here is my php
It compiles, it seems to run, but the record is not changed. Here's my
I have an Oracle function that returns a record set. I introduced parameters to
There is a very handy set of 2d geometry utilities here. The angleBetweenLines has

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.