Forums
This topic is locked
Stop duplicate values in DB
17 Jul 2001 10:16:31 Bec C posted:
Within my Access database I have forced the username field to allow no duplicate values.When using the Insert server command in Ultradev I get an error if I enter a duplicate username.
How do I trap this error and redirect the user to a page stating the username has been taken?
Replies
Replied 17 Jul 2001 10:40:30
17 Jul 2001 10:40:30 Viktor Farcic replied:
Submit form with user and pass to other page. There you can use If Then statement.
1. Open recordset and filter user name with Url value you passed from previous page.
2. Use something like:
If RecordsetName BOF Or RecordsetName EOF Then
...
End If
Between If Then and End If use command to insert date into DB.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Within my Access database I have forced the username field to allow no duplicate values.
When using the Insert server command in Ultradev I get an error if I enter a duplicate username.
How do I trap this error and redirect the user to a page stating the username has been taken?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
1. Open recordset and filter user name with Url value you passed from previous page.
2. Use something like:
If RecordsetName BOF Or RecordsetName EOF Then
...
End If
Between If Then and End If use command to insert date into DB.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Within my Access database I have forced the username field to allow no duplicate values.
When using the Insert server command in Ultradev I get an error if I enter a duplicate username.
How do I trap this error and redirect the user to a page stating the username has been taken?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>