0

I am trying to verify the Email of a new user on the registration form, but am having trouble with memo of Acces database.

if not(TblUsername.locate('Email',EdtMail.Text,[])) then

[EdtMail is the editbox and 'Email' is the column of type memo in microsoft access database]

The trouble seems to be the locate function. I am lost.

  • You cannot use `Locate` for a memo type field. Cast it to a string when fetching your data. – TLama Oct 27 '14 at 16:29
  • @TLama: I think he is using a "Table" component, so that wouldn't work :) The real question is: why is an Email field defined as a Memo field?? – whosrdaddy Oct 27 '14 at 17:00
  • @whosrdaddy Email accounts contain numbers and thus memo, according to my IT teacher – Johan Davids Oct 27 '14 at 17:03
  • @JohanDavids: Memo fields are usually used in a database where one expects to store text of arbitrary length, but they typically have limitations compared with normal character fields, not least the restrictions on searching, which is basically why .Locate doesn't work. Sounds a bit like your IT teacher was hoping to avoid specifying a maximum field size for an email address, when a bit of research might yield a useful answer - see e.g. http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address. – MartynA Oct 27 '14 at 17:14
  • @MartynA : Thank you, I changed the memo to normal text and evrything worked fine. You saved me and my PAT. – Johan Davids Oct 27 '14 at 17:50

1 Answers1

0

Change the Memo filed in the Access Database to a Text field and the Problem will be solved.

Ken White
  • 123,280
  • 14
  • 225
  • 444