by Zahid (7 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Wed 5th April 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Sample ASP code for registering an email address in a database. Registration, Email address. online activity
<%option explicit%>
<%
dim item
dim val
dim oRs
dim Connection
dim vSql
dim Added
Added=False
for each item in Request.Form
if item="EmailId" then
val=Request.Form(item)
end if
next
set Connection=server.CreateObject ("AdoDB.Connection")
Connection.Open "DSN=Dbsname;uid=Admin;pwd=;"
set oRs=server.CreateObject ("AdoDB.RecordSet")
vSql="select * from Account where Email='" & val &"'"
oRs.Open vsql,connection,adOpenDynamic,adLockPessimistic
if oRs.EOF=true and oRs.BOF=true then
oRs.Close
oRs.Open "Account",connection,adOpenDynamic,adLockPessimistic,adCmdTable
oRs.AddNew
oRs("Email")=val
oRs.Update
oRs.Close
Added=True
else
oRs.Close
Added=false
end if
set oRs=nothing
Connection.Close
set connection=nothing
%>
No comments have been posted about Sample ASP code for registering an email address in a database. Registration, Email address. online. Why not be the first to post a comment about Sample ASP code for registering an email address in a database. Registration, Email address. online.