Forums
This topic is locked
insert record - ? how do i make user friendly if r
Posted 07 Apr 2002 08:52:53
1
has voted
07 Apr 2002 08:52:53 nigel smith posted:
i am using the insert record behaviour - but get an error in if the user tries to add a record which already exists (field is primary key) - how do i trap this error and make more user friendly ? Replies
Replied 07 Apr 2002 19:43:11
07 Apr 2002 19:43:11 Dave Clarke replied:
The problem could be that you cannot have duplicates entries in a primary key field, the whole point of a primary key is that it is unique, the database uses it to indentify individual records.
hope that helps
Dave
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
i am using the insert record behaviour - but get an error in if the user tries to add a record which already exists (field is primary key) - how do i trap this error and make more user friendly ?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
hope that helps
Dave
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
i am using the insert record behaviour - but get an error in if the user tries to add a record which already exists (field is primary key) - how do i trap this error and make more user friendly ?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 07 Apr 2002 21:18:09
07 Apr 2002 21:18:09 nigel smith replied:
thanks dave ... but i realise that ... and i accept that trying to insert a duplicate will cause an error .... but how do i return a "user friendly" error message to report the problem .... i'm sure that this can be done and is probably fairly simple ... but how ... i guess that on submission of the form i compare the contents of the formfield to be inserted (to see if it exists) ... and if it does then re-direct to friendly error page .... can anybody help ??
Replied 07 Apr 2002 21:48:03
07 Apr 2002 21:48:03 Dave Clarke replied:
Sorry Nigel, lol
I imagine there will be a ready made behaviour out there somewhere to do that but I haven't got one and have no idea how you would do it.
Sorry
Dave
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
thanks dave ... but i realise that ... and i accept that trying to insert a duplicate will cause an error .... but how do i return a "user friendly" error message to report the problem .... i'm sure that this can be done and is probably fairly simple ... but how ... i guess that on submission of the form i compare the contents of the formfield to be inserted (to see if it exists) ... and if it does then re-direct to friendly error page .... can anybody help ??
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
I imagine there will be a ready made behaviour out there somewhere to do that but I haven't got one and have no idea how you would do it.
Sorry
Dave
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
thanks dave ... but i realise that ... and i accept that trying to insert a duplicate will cause an error .... but how do i return a "user friendly" error message to report the problem .... i'm sure that this can be done and is probably fairly simple ... but how ... i guess that on submission of the form i compare the contents of the formfield to be inserted (to see if it exists) ... and if it does then re-direct to friendly error page .... can anybody help ??
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>