PDA

Click to See Complete Forum and Search --> : ADO - FIND!


hyme
Jul 6th, 2000, 12:19 PM
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!!!

Negative0
Jul 6th, 2000, 12:22 PM
Try this out:

username = "ME"
Criteria = "Mnemonic is null"
rs.Find Criteria, , adSearchForward, 1

Hope this helps

hyme
Jul 6th, 2000, 12:30 PM
Nope! Run- Time Error! 3001

Negative0
Jul 6th, 2000, 12:31 PM
What type of DB are you using???

hyme
Jul 6th, 2000, 12:34 PM
Access 97, with all the proper components.
Everything else works fine except the finding a null field in the table.

Thanx

Negative0
Jul 6th, 2000, 12:38 PM
I am not sure why it is not working, you could try a new recordset using:

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

hyme
Jul 6th, 2000, 12:45 PM
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!

hyme
Jul 6th, 2000, 12:48 PM
I got it! Thanx for your help!!!!!