Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
<%
Dim oConn, oRs
Dim qry, connectstr, sDSNDir
Dim db_name
Dim dsn_name
dsn_name = "access_atcguild.dsn"
sDSNDir = Server.MapPath("\_dsn")
Dim varUserID
Dim varPassword
varUserID = Replace(Request.Form("UserID"), "'", "''")
varPassword = Replace(Request.Form("Password"), "'", "''")
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM Members Where UserID= '" & varUserID & "'"
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open qry,oConn,2,3
if oRS.EOF then
%>

  
	
  
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td>
	  
	</td></tr></tbody></table>

  
	
  
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td valign="top">
	  
		
		  
		
		
	  	  
		
		
	  	  
		
		
		  
		
		
	  	  
		
		
		  
		
		
		  
		
		
		  
		
 	  <table border="0" width="100%" cellpadding="0" cellspacing="7"><tbody><tr><td width="100%">
			<p style="margin: 3 5">
			  <font face="Verdana">
			  <font size="3" color="#FFFFFF">Members' Domain Login</font>
              </font>
		  </p></td></tr><tr><td width="100%"> </td></tr><tr><td width="100%">
			 <p align="center" style="margin-top: 0; margin-bottom: 0">
				<font size="2" face="Verdana" color="#336699">Username <%=varUserID%> is not found in ATC Guild (India) Members' Domain</font><font face="Verdana">
             </font>
			 </p>
	  	  </td></tr><tr><td width="100%"> </td></tr><tr><td width="100%">
			<p align="center" style="margin-top: 0; margin-bottom: 0">  <a href="../memlog.asp"> 
			<font size="2" face="Verdana" color="#336699"> Try to login again</font></a></p>
			<p align="center" style="margin-top: 0; margin-bottom: 0"> <font size="2" face="Verdana" color="#336699">OR</font></p>
		    <p align="center" style="margin-top: 0; margin-bottom: 0">
		    <font face="Verdana">
		    <a href="join.asp">
		    </a>
            </font>
		  </p></td></tr><tr><td width="100%">
			<p style="margin-left: 5; margin-right: 5" align="center">
			 <font size="1" color="#336699" face="Verdana">RESTRICTED to ATC Guild (India) Members only</font></p>
		  </td></tr><tr><td width="100%"> </td></tr><tr><td width="100%" colspan="2">
			<p align="center" style="margin-top: 5; margin-bottom: 5">
			<font face="Verdana">
			 <a href="forgotpwd.asp" style="text-decoration: none">
			<font color="#FFFFFF">Forgot Password? Click here</font></a>
            </font>
		  </p></td></tr></tbody></table>
	</td></tr></tbody></table>
<%
ElseIf oRS("Password") <> varPassword Then
%>

  
	
  
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td>
	  
	</td></tr></tbody></table>

  
	
  
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td valign="top">
	  
		
		  
		
		
		  
		
	  	
	  	  
		
		
		  
		
		
	  	  
		
		
		  
		
		
		  
		
	  <table border="0" width="100%" cellpadding="0" cellspacing="7"><tbody><tr><td width="100%">
			<p style="margin: 3 5">
	  		<font face="Verdana">
	  		<font size="3" color="#FFFFFF">Members' Domain Login</font>
            </font>
		  </p></td></tr><tr><td width="100%"> </td></tr><tr><td width="100%">
			<p align="center"><font size="2" face="Verdana" color="#336699">Password is Incorrect for <%=varUserID%></font></p>
		  </td></tr><tr><td width="100%"> </td></tr><tr><td width="100%">
			<p align="center">  <a href="../memlog.asp"> 
			<font size="2" face="Verdana" color="#336699"> Try to login again</font></a></p>
		  </td></tr><tr><td width="100%">
			<font face="Verdana">  </font>
		  </td></tr><tr><td width="100%">
			<p align="center" style="margin-top: 5; margin-bottom: 5">
            <font face="Verdana" size="2">
			<a href="forgotpwd.asp" style="text-decoration: none">
			<font color="#FFFFFF">Forgot Password? Click here</font></a>
            </font>
		  </p></td></tr></tbody></table>
	</td></tr></tbody></table>
<%
ElseIf oRS("NoVisits")=0 Then
		Email=oRS("Email")
		Session("User") = "Yes"
		Session("UserID") = varUserID
		session.timeout=20
				oRS("NoVisits")=(oRS("NoVisits")+1)
				oRS("LastVisit") = Now()
				oRS.Update
				Session("Logintime") = oRS("LastVisit")
				response.redirect "memupdt.asp"
else
		Email=oRS("Email")
		Session("User") = "Yes"
		Session("UserID") = varUserID
		session.timeout=20
%>

  
	
  
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td>
	  
	</td></tr></tbody></table>

<center>


  
	
   
  
	
  
  
	<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td width="100%">
	  <p style="margin: 3 5">
	  <font size="3" color="#FFFFFF" face="Verdana">Members' Domain Login</font></p>
	</td></tr><tr><td valign="top">
  	  		<font face="Verdana">  </font>
  	</td></tr><tr><td valign="top">
	  <div align="center">
	  <center>
	  
		
		  
		
		
		  
		
		<%
		oRS.Close
		Set oRS=Nothing
		%>

What I have tried:

It was working earlier.
I tried the following code with the same database, it is woking.
<pre><%
Dim Conn
Dim RSUser
Dim SQL
Dim varUserID
Dim varPassword
Dim connectstr, sDSNDir
Dim db_name
Dim dsn_name

dsn_name = "access_atcguild.dsn"

sDSNDir = Server.MapPath("\_dsn")

		  connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
		  Set Conn = Server.CreateObject("ADODB.Connection")
		  Conn.Open connectstr
		  
Set RSUser = Server.CreateObject("ADODB.Recordset")
varUserID = Replace(Request.Form("admuser_id"), "'", "''")
varPassword = Replace(Request.Form("admpassword"), "'", "''")

ABCD=request.form("admuser_id")
SQL = "Select * from Minister Where LogInName='" & varUserID & "'"
RSUser.Open SQL,conn,2,3 
If RSUser.EOF Then
	response.redirect ("../index.asp")
ElseIf RSUser("Password") <> varPassword Then
	response.redirect ("../index.asp")
else
	Session("Adm") = "Yes"
RSUser.Close
Set RSUser=Nothing
Conn.Close
Set Conn=Nothing
%>



Hi <%=oRS("FirstName")& " " & oRS("LastName")%>,



Welcome to Members' Domain of atcguild.com

<%
dim diff
dim d,h,m,s
dim day,hour,minute,second
diff=DateDiff("s", oRS("LastVisit"),now)
day=(diff)\86400
d=diff mod 86400
hour= d\3600
h= d mod 3600
minute=h\60
m= h mod 60
second= m
oRS("NoVisits")=(oRS("NoVisits")+1)
oRS("LastVisit") = Now()
oRS.Update
Session("Logintime") = oRS("LastVisit")
%>





Your last visit was <%=day%> days <%=hour%> hours <%=minute%> minutes <%=second%> seconds ago


Posted
Updated 9-Jan-17 23:36pm
Comments
OriginalGriff 10-Jan-17 3:34am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So tell us what error(s) you get, what happens that you didn't expect, or doesn't happen that you did. And tell us what you have tried to fix it!
Use the "Improve question" widget to edit your question and provide better information.
Suvendu Shekhar Giri 10-Jan-17 3:58am    
We don't know.
F-ES Sitecore 10-Jan-17 4:40am    
If the code used to work and now it doesn't then the problem isn't the code as that hasn't changed, the problem will be something network related or similar, something we obviously can't help you with. You're going to have to do some debugging or investigation to try and isolate the issue. Dumping 100 lines of code and saying it "doesn't work" doesn't give anyone enough info to help you.

1 solution

Quote:
What is wrong with this code?
Nothing, this code is doing exactly what it should.
The problem is that it don't match your expectations, but you did not described them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900