Print Page | Close Window

stop duplicates...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=521
Printed Date: 29 March 2026 at 12:41pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: stop duplicates...
Posted By: skyworld
Subject: stop duplicates...
Date Posted: 25 February 2003 at 5:17pm

i know if i say LIKe and stuff for selecting to the database it will look for the record....

 

is there anyway i can hav it from adding a record wit the same name? and if not in the database to add it if it is to not add again just add 1 value to "hits"




Replies:
Posted By: faubo
Date Posted: 25 February 2003 at 5:30pm

What???

 



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: MadDog
Date Posted: 25 February 2003 at 6:58pm
do you ever research this stuff before you ask?

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: skyworld
Date Posted: 25 February 2003 at 7:32pm

i did. and i found a sql that i do not understand. Can some one explian this 1 to me then?

 

this was made by my friend for my site...

 

If rslogin.EOF Then
 SQL="INSERT INTO Member(Name, Password, Email) VALUES('" & Request.Form("name") & "', '" & Request.Form("password") & "', '" & Request.Form("email") & "')"
 Set InsertNewUser = oConn.Execute(SQL)
 response.redirect "login.asp"
Else
 Response.redirect "error/register.asp"
End If

 

is ther another way then insert into cause i dont like that



Posted By: michael
Date Posted: 25 February 2003 at 7:46pm

You are right it does not look nice LOL
But to answer your question, there is another way using ado e.g.

rs.addnew
rs("FirstName") = request("FirstName")
rs("LastName") = request("LastName")
rs("FavoriteColor") = request("FavoriteColor")
rs.update
Look into ADO and you find how it's done (dont just apply that to your script...)

 



Posted By: skyworld
Date Posted: 25 February 2003 at 7:58pm

yea but back to the orig question how do i stop duplicates... lol that just adds on...

 

 



Posted By: michael
Date Posted: 25 February 2003 at 10:07pm
you were the one straying off your questions. there are several ways, make the field an identity field, run a select first and if no result THEN insert or buy a book on sql/asp...


Posted By: skyworld
Date Posted: 25 February 2003 at 10:32pm

ok... can you atleast tell me that code though because i cant go shopping till sunday ...



Posted By: michael
Date Posted: 26 February 2003 at 9:24am
select blah from blah
If RS.BOF OR RS.EOF THE
 recfound = 0
ELSE
.....
END IF

IF recfound = 0 THEN
'Do your insert statement....
END IF


Posted By: skyworld
Date Posted: 26 February 2003 at 4:20pm

thank you michael but wouldnt it be  rsportal ?

 

 

cant test it now cause i am at school



Posted By: michael
Date Posted: 26 February 2003 at 6:46pm
rsportal? that name ever appeared here before. you can name your recordset almost whatever you want.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net