Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    return false in SQL (2000)

    I use this sql to set a where statement in table...
    Is possible to return "false" if the where not is found without to open a rset?

    SQL1 = "SELECT SPORT FROM SPORTELLI WHERE '" & SP_AGENZIA & "' = SPORT"
    CNSQL.Execute SQL1

    in effect:

    if where statemnent is thrue then
    ...
    elsle
    ...
    end if

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: return false in SQL (2000)

    The result of Execute is a recordset. You will have to check whether this recordset has any records.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: return false in SQL (2000)

    not completly undesrtand...;-(
    example?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: return false in SQL (2000)

    Dim rst As ADODB.Recordset
    SQL1 = "SELECT SPORT FROM SPORTELLI WHERE '" & SP_AGENZIA & "' = SPORT"
    Set rst = CNSQL.Execute(SQL1)
    If rst.EOF Then
    ' No records that satisfy the condition
    Else
    ' At least one record satisfies the condition
    End If

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: return false in SQL (2000)

    "I LOVE YOU"....
    i'M sorry Marry Christmas and a very good New Year!
    Sal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •