VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Sample ASP code for registering an email address in a database. Registration, Email address. online

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

Rate Sample ASP code for registering an email address in a database. Registration, Email address. online



<%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

%>

Download this snippet    Add to My Saved Code

Sample ASP code for registering an email address in a database. Registration, Email address. online Comments

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.

Post your comment

Subject:
Message:
0/1000 characters