Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Why does this only work the second time I click Submit?!

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,39133
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Why does this only work the second time I click Submit?!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Why does this only work the second time I click Submit?! - 10/25/2006 2:42:11 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Migration Search</title>
</head>
<%
If Request.Form("Submit") = "" Then
%>
<body>
<p>Enter the user name to search for.</p>
<form name="form1" method="post" action="search.asp">
<input type="text" name="txtUserName">
<p><input type="submit" name="Submit" value="Submit"></p>
</form>
</body>
<%
Else
Q = Chr(34)
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.RecordSet")
Set objQuery = CreateObject("ADODB.RecordSet")

objConnection.Open "DSN=PS4Migrations;"
objRecordSet.CursorLocation = adUseClient
objRecordSet.Open "SELECT * FROM PS4Migrations" ,objConnection, _
 adOpenStatic, adLockOptimistic

strSearchCriteria = "[User Name] = '" & Request("txtUserName") & "'"
objRecordSet.Find strSearchCriteria

If objRecordSet.EOF Then
 UserResult = "Not found."
 DateResult = "Not found."
Else
 UserResult = objRecordSet("User Name").Value
 DateResult = objRecordSet("Date Migrated").Value
End If

objRecordSet.Close
objConnection.Close
End If
%>
<body>
<p>Enter the user name to search for.</p>
<form name="form1" method="post" action="search.asp">
<input type="text" name="txtUserName">
<p><input type="submit" name="Submit" value="Submit"></p>
</form>
<p></p>
<% Response.Write UserResult & " " & DateResult %>
</body>
</html>
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Why does this only work the second time I click Submit?! Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts