Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2005, 10:55 AM
Registered User
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Duplicate Records

I'm using DWMX and SQL2K and would like to find out how to check if a record already exists for a particular field when a user submits the form. I'm using stored procedures and the command object in Dreamweaver. Also how would I redirect the user to another page if there is a duplicate record? Thanks!

 
Old April 15th, 2005, 11:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

To find out if a record exists, you can use IF EXISTS in a stored procedure.
Alternatively, just fire a normal SELECT query. If there are any records (the recordset is not EOF) then don't allow the insert, otherwise execute the INSERT statement.


HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Sabotage by Beastie Boys (Track 6 from the album: Ill Communication) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Records in a table i_shahid SQL Language 2 February 7th, 2008 07:40 PM
duplicate records vanitha SQL Server 2000 4 June 2nd, 2007 04:35 PM
duplicate records vanitha Reporting Services 2 May 31st, 2007 01:54 AM
Delete Duplicate Records prasanta2expert SQL Server 2000 9 December 15th, 2006 10:44 PM
Deleting duplicate records ninel SQL Server 2000 3 June 14th, 2006 02:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.