Need Help! Anyone know Active Server Pages (ASP) and MS Access?

nitsuj3580

Platinum Member
Jun 13, 2001
2,668
14
81
Ok, here is my situation.

I have a simple form that I type data into that is then written to an Access Database.

one of the inputs on the form is a unique ID number. when I submit the form to the database, I want to be able to check to see if an ID number I am submitting is already being used? If it is being used, I want to display a message saying so. Anyone know how to do this with ASP? Any ideas anyone? thanks!
 

Boogak

Diamond Member
Feb 2, 2000
3,302
0
0
<%
sSQL = &quot;SELECT id FROM tablename WHERE id = &quot; &amp; request(&quot;id&quot;)
set rs = db.execute(sSQL)
if rs.eof and rs.bof then
response.write &quot;New ID&quot;
else
response.write &quot;ID is already in use&quot;
end if
%>