Results 1 to 8 of 8

Thread: ADO - FIND!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148

    I am using ADO and I am trying to find a Null value in my database. This works fine for searching for a field with a value

    username = "ME"
    Criteria = "Mnemonic = '" & UCase(username) & "'"
    rs.Find Criteria, , adSearchForward, 1

    But, soon as I search for a null value it can't find it. Help someone please!!!

    Thanx!!!

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Try this out:

    Code:
    username = "ME" 
    Criteria = "Mnemonic is null"
    rs.Find Criteria, , adSearchForward, 1
    Hope this helps

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148
    Nope! Run- Time Error! 3001

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    What type of DB are you using???

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148
    Access 97, with all the proper components.
    Everything else works fine except the finding a null field in the table.

    Thanx

  6. #6
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    I am not sure why it is not working, you could try a new recordset using:

    Code:
    SQL = "SELECT * FROM table where field1 is null"
    rs.Open SQL,DB,adOpenForwardOnly, adLockReadOnly
    if rs.eof = false then
      'NULL VALUES
    end if
    Hope this helps

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148

    Angry

    I get the same error when using your code!

    Run-time error 3001!

    The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

    Maybe the problem lies somewhere else if your code didn't work?. Thanx for your time on this!

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    148
    I got it! Thanx for your help!!!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width