Forums

This topic is locked

How I prevent duplicated data entering into databa

Posted 06 May 2003 07:16:52
1
has voted
06 May 2003 07:16:52 James Lee posted:
Hello all,

Just want to ask how do I prevent a user from entering a duplicated data into a database? I know that inside the database, you can set the field to Indexed to No Duplicates, but how am I going to retrieve that and have a customised error page.

Cheers!

Replies

Replied 06 May 2003 15:19:37
06 May 2003 15:19:37 Jonathan Danylko replied:
1). When you click on the submit button, go to another page called addrecord.asp.

2). In that addrecord.asp, use a recordset to find the record that they entered on the previous form.

3). If the recordset is 0, then add it. OPTIONAL: If it finds the record, update it.

4). After you add/update the information, Response.Redirect to a successful or failed page.

Hope this helps.
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

L8R,
Vito

Reply to this topic