[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

is any alternative of "history.back()" in ASP?

Posted on 2000-03-30
3
Medium Priority
?
266 Views
Last Modified: 2012-08-14
hello expert,
 i am working in web site development for b2b application in ASP. In this application i am facing one problem as follow:
      There is one form for Customer Master. In this form i ask user to give User Name, Password, First Name etc. Now on submit button i check database for Unique User Name. if user name is already exist then  i want to show same form with given data. Is there any function in ASP like " history.back() " in javascript.
      If you find any solution then give me reply as soon as possible . i am awaiting for your positive reply.

kamal
0
Comment
Question by:Aurokripa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
FRehman earned 150 total points
ID: 2668804
<%
loginName=Request.QueryString("Uname")
pwd       =Request.QueryString("pwd")
set Myconn=server.CreateObject("ADODB.connection")
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./website.mdb")
set rs=server.CreateObject("ADODB.recordset")
rs.open "Select * from Login where usrName='" &loginName& "' and pwd='" &pwd& "'" ,Myconn ,adOpenDynamic,adLockOptimistic
if  rs.eof then
rs.AddNew
rs.Fields("usrName")=loginName
rs.Fields("pwd")=pwd
rs.Update
else
response.rediect("previouspage.asp")
end if
      %>
0
 
LVL 4

Expert Comment

by:jkunal
ID: 2669107
Kamal you have to write Response.Buffer=True which FRehman missed.So your code will look something like this


<%
Response.Buffer=True
loginName=Request.QueryString("Uname")
pwd =Request.QueryString("pwd")
set Myconn=server.CreateObject("ADODB.connection")
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./website.mdb")
set rs=server.CreateObject("ADODB.recordset")
rs.open "Select * from Login where usrName='" &loginName& "' and pwd='" &pwd& "'" ,Myconn ,adOpenDynamic,adLockOptimistic
if  rs.eof then
rs.AddNew
rs.Fields("usrName")=loginName
rs.Fields("pwd")=pwd
rs.Update
else
response.rediect("previouspage.asp")
end if
%>


;->

Kunal
0
 
LVL 4

Expert Comment

by:ruperts
ID: 2669901
Actually you don't need it if you don't write anything to the browser first!

Response.Buffer=True
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question