Thread: Asp Code help
View Single Post
Old 03-20-2003, 11:19 AM   #1 (permalink)
catfish696
Registered User
 
catfish696's Avatar
 
Join Date: Mar 2003
Location: MN
Posts: 5
catfish696 is on a distinguished road
Send a message via AIM to catfish696
Post Asp Code help

I'm working on a project and need help.

I am trying to add information to a database which is simple enough. But I am also checking the DB to make sure that the info isn't already in the DB. the code seem to work for the first time, but after i have added 1 record, it thinks everything else is a duplicate.
here is some of the code
Code:
Conn.CommandText = "Select Distinct Item1 from table1 Where Id = '" & Id "'"
set Duplicates = Conn.Execute

IF not Duplicates.EOF then
Sub Debug(Msg)
Msg = Replace(Msg,"'","\'")
Response.Write "<script language='JavaScript'>"
Response.Write "alert('"&Msg&"');"
Response.Write "history.back();"
Response.Write "</script>"
Response.End
End Sub
If Request("Duplicates") = "" Then Msg = "Duplicates Not Allowed" : Debug Msg 
END IF
I am truely an ASP newb. I am learning as i go, so please don't brow beat me too bad for my code.
catfish696 is offline   Reply With Quote