Hi, I have created a web page that accesses an Access databse and everything works fine except one thing. If a form field is blank when someone has pulled up a record to edit, there is an ODBC error upon hitting hte update button. Now, there is a SQL statement written for it and it goes something like this:
UPDATE Results SET
LastName='::LastName::',
FirstName='::FirstName::',
MI='::MI::'
WHERE Email='::Email::'
Now, say the person doesn't have a middle initial, when updating the other information, if it is blank, the error occurs and the rest of the data is not updated. This isn't the only field left blank, and I'm currently working aorund it by forcing a dash to be put in each field by default. What sort of SQL statement will handle a blank field? I was thinking of trying to write one that checked to see if the field was empty and if so, then don't attmpt to update that field. Something like this:
UPDATE Results SET
{IF ('::LastName::' IS NOT NULL)
{LastName='::LastName::'}
ELSE {LastName='-'}},
FirstName='::FirstName::',
MI='::MI::'
WHERE Email='::Email::'
Thanks in advance for any help you can give.
UPDATE Results SET
LastName='::LastName::',
FirstName='::FirstName::',
MI='::MI::'
WHERE Email='::Email::'
Now, say the person doesn't have a middle initial, when updating the other information, if it is blank, the error occurs and the rest of the data is not updated. This isn't the only field left blank, and I'm currently working aorund it by forcing a dash to be put in each field by default. What sort of SQL statement will handle a blank field? I was thinking of trying to write one that checked to see if the field was empty and if so, then don't attmpt to update that field. Something like this:
UPDATE Results SET
{IF ('::LastName::' IS NOT NULL)
{LastName='::LastName::'}
ELSE {LastName='-'}},
FirstName='::FirstName::',
MI='::MI::'
WHERE Email='::Email::'
Thanks in advance for any help you can give.