Validationrule - Works in Access, not in .NET

  • Thread starter Thread starter ZippyV
  • Start date Start date
Z

ZippyV

I have a table with users and a column that contains the emailadresses. A
user doesn't need to have an emailadress but if he enters one, it should be
valid. My validationrule looks like this:
Is Null Or Like "?*@?*.?*"
While I enter data in Access there is no problem and the rule works like it
should but when I try to enter data using my vb.net application I get an
OleDbException which gives me the validationmessage ("Please insert a valid
emailadress").

What is wrong with my rule and why does it give only problems when using
..net? If I change the rule to
="TEST"
then there is no problem in both Access and .net
 
Where do you set the validation rule? In the JET Table design?

Note that JET uses * and ? as wild cards but for most others, % and _ are
the more common wild cards.
 
I designed my table in Access.
I think I tried using % instead of * but it didn't solve my problem. What
does _ stand for?
 
_ stands for any single character, equivalent to ? in JET.

Do you mean you set the Validation rule in the design of the JET Table? If
you do, the * and ? are correct and the problem is in the .net component or
the comms between .net and JET. You may need to check out the .net
newsgroups and see if there were similar problems posted.
 
I asked it yesterday in a .net forum but those people aren't so fast as you
guys.

To access an Access database in .net I have to use OleDb which could be the
possible problem because maybe it doesn't understand ? and *.
 
Do check out the link I posted earlier, if you haven't already done so -
that solution worked with 'classic' ADO and I would expect it to work with
ADO.NET also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top