QA.TechInterviews.com - your tech questions answered
Validation In SQL Using Like Operand?
I'm stuck on this one and google isn't helping.

Trying to validate data entry using a query in access but running through ADO. It all runs fine until it tries to validate an id number like this:

VAL_member_id: IIf([member_id]<>"" And ([member_id] Like "____-_____" Or [member_id] Like "#-#" Or [member_id] Like "#-##" Or [member_id] Like "#-###" Or [member_id] Like "#-####" Or [member_id] Like "#-#####" Or [member_id] Like "#-######" Or [member_id] Like "#-#######"),True,False)

When it runs in Access it comes up True but when it's run through the ADO/ODBC driver it comes up False. I can't see a problem with it though.

It's probably gonna be something simple. xD
Have you tried to use single quotes, because when you run to ODBC it comes often to a wrong evaluation using double quotes.
I hope it will help you

Helmut
substring the member_id and use the isNumeric on both pieces.
Have you tried to use single quotes, because when you run to ODBC it comes often to a wrong evaluation using double quotes.
I hope it will help you

Helmut
the first step is to find a forum where people actually know what you're talking about. Many of the answers you'll get here are of the "heck, I dunno either" sort, and that's when you're asking questions like, "What is a Server?"

Back to QA. TechInterviews.com. Powered by Yahoo! Answers and TechInterviews.com community.