Retain Same SQL Statement

I still have the weirdest problem. I posted that couple of weeks ago and I got too busy to follow up. When I was back, I redid the whole page from scratch and still got the same problem:

I have an Access database containing list of activities for my students, and each activity can be searched by a number of criteria and is linked to a file they can download... The search dn diplay of the results as well as downloading the file from the database work all fine... The problem starts when I have results that would span more than one page... When I click next, the new page displays a list of all records. I Response.write the query to know what is hapenning and I found out that the query reverts to Select * from table and loses the WHERE statement.

I will attach the code that I tried to document as possible.... Most of the code is created by Macromedia Dreamweaver except for the form variables and SQL statement... The code is long so ignore HTML and CSS.

View Replies


ADVERTISEMENT

Retain Whitespaces

When a Button is clicked in a Form, the JavaScript 'prompt' dialog
pops-up for users to enter any text. When the user clicks OK in the
prompt dialog, the text is populated in a TextBox & the Form posts. I
then retrieve the text using Request.Form.

The problem I am facing is in retaining whitespaces in the text the
user has entered. Assume that the user has entered the following text
in the JavaScript prompt dialog (note the whitespaces in the string):

"abc def ghi jkl"

The double quotes have been added just to show where the string ends;
they aren't a part of the string.

Now when I retrieve the string using Request.Form, this is what I get
(once again please neglect the double quotes):

"abc def ghi jkl"

i.e. irrespective of the number of whitespaces a user has inserted in
between the words in the JavaScript prompt dialog, Request.Form always
replaces all the whitespaces in between the various words in the string
with a single whitespace.

How do I ensure that the whitespaces entered by the user in the
JavaScript prompt dialog are retained by ASP?

View Replies View Related

Retain Variable Value

I have got a page called view_month which displays records and allows users to update records then returns back to the view_month page. Because my view_month page uses an SQL with the table name as a variable which retrieves its value from the form in the previous page. My problem is that the table name disappears whenever I finish updating and tries to return to the view_month page. How can I retain the variable value so that whenever I updates and return the SQL will still contain the value.

View Replies View Related

How To Retain QUERY_STRING Value ?

I have an asp application where there are two pages. The first page pulls some data from a database and displays it in a tabular format with hyperlinks. When the user clicks on a particluar link, he/she is taken to page 2, where the specifics of that item come up with various text fields and drop down boxes, etc Code:

View Replies View Related

Retain Check Box Value

I have a form, which has various text boxes,check boxes etc. The problem is, when the user hits the submit button, if the form validation finds an error,say, the user forgot to fill in a field,the ticks from the check boxes dissapear.

as if the check boxes have reset themselves. How to I stop this? Is there a way to retain check box values if the form is submitted? This is also occurring with my list boxes,too.

View Replies View Related

Retain The Contents Of The Form

I am having 14 textboxes on the form and One data grid control and one
Button That button allows to open new web page (in new window) where in I can
select some products from the list.

The products selected in the list are added in the Grid of my original
form. I use response.redirect by passing parameters for that purpose.
but that wipes out the contents of the textboxes. how can i retain
them.

View Replies View Related

Retain Value Of Pulldown List

I have one .asp page with a SELECT pulldown list on it and some INPUT fields. When SUBMIT is clicked the form data is submitted to that same page and validated. If INPUT fields are empty the asp code will insert a visual indicator (e.g. *) to convey that the field must be filled in.

However, if the user has made a selection in the pulldown list and has left an INPUT field empty, when the form reappears after validation, the pulldown menu looses its selection and returns to its default value.Would anyone be able to provide a solution to this?Or do you need to see the code first?

View Replies View Related

Retain The Textfield Values

how do i retian values in the textfield even after it is submitted ? Like for example, when you fill out most application forms, after submitting if there is an error it redirects you back to the first page alerting you of the error but the other values still remain. I would like to incoporate this function. where i can find them ?

View Replies View Related

Retain Checkbox Status

I have a form which submits data to a new page based on the checkboxes that are clicked corresponding to each row of data. My next page has a cancel button which takes me back to the first page I have to retain the status of the checkboxes that were checked.

How do I do that? The no of checkboxes depends on the no of rows of data returned
I have them named in a for loop as strcheck0, strcheck1 and so on . the data that is submitted to the next page is assigned to the value attribute of checkbox.

View Replies View Related

How Is It Possible To Retain The Textfield Values ?

how do i retian values in the textfield even after it is submitted ?

Like for example, when you fill out most application forms, after submitting
if there is an error it redirects you back to the first page alerting you of the error but the other values still remain..

View Replies View Related

Retain The Field Information

Can anyone tell me on how to retain the information that was being key in previously and mark which field was being filled in incorrectly rather than reset all the field to previous value?

I have done checking like this but i think it is not quite user friendly:

function verifyBlank(thisForm){
if (thisForm.TeachersName.value == "none" || thisForm.Lab.value == 0 || thisForm.Class.value == 0 || thisForm.Subject.value == 0 || thisForm.PeriodFrom.value == 0 || thisForm.PeriodTo.value == 0 || thisForm.Day.value == "none" || thisForm.Month.value == "none" || thisForm.Year.value == "none")
{
alert('Incomplete information');
return false;
}
return true;
}

View Replies View Related

Asp....login...store And Retain Information

I have an asp driven website using an Access database.

Basically the user arrives to the site selects the product from a list. From their they are directed to another page where they see the starting price and then they can customize the product from a list of options that is also database derived. The result is a final price.

What I would like to do is have the ability for the user to save that product and on their next visit bring it back up along with any other products they saved.

(note...all I have is done using asp classic, access database, and some javascript)

Could someone direct me to a good or source or help me get started on how to create a user logon and retain their user info and how to do the above?

View Replies View Related

Session Variables Retain Values Even After The .Abandon

I am developing a membership based website for car auctions. It uses the session object on many pages, most importantly on user personal pages. When the user session ends, i.e., on logout, I use the Session.Abandon to destroy a session object associated with a particular user, and also turn a boolean variable session("Valid_User")=False (which was turned ON at the time of successful login and used on user personal pages for authentication).

But, when I go BACK and browse the previous pages, they still appear with the specific user's data, who logged in last time on the same browser. Why is it so? When I refresh the pages, only then the session variables' values are erased.

Secondly, my site doesn't allow me to login as a different user, even after logout, because I have put a check on the login page so that it doesn't allow a user to login again during his current session, which again means that the logout process doesn't destroy his session.

View Replies View Related

Retain Values On The Form When Posting Back To Itself

I have simple form where user enter the search criteria and the form is
posted back to itself and runs a query based on the values that are entered.

Everything is expect the values that the user enters disappears everytime
the form is refreshed when posting it to itself.

Is there anyway I can retain the values that were entered on the form?

View Replies View Related

Possble To Retain Orig Request.ServerVariables("HTTP_REFERER") Thru Svrl Refreshes?

I have a "Email this page to a friend" form that submits to itself and contains the hidden input value="<%= Request.ServerVariables("HTTP_REFERER") %>".

The value="<%= Request.ServerVariables("HTTP_REFERER") %>" is to obtain the URL of the page that the person wishes to send.

The problem is, if someone creates an error in any of the input fields, the page submits to itself again and displays the errors. When this happens, the original HTTP_REFERER url address is lost and now replaced with the url of the "Email this page to a friend" page.

Is there a way to retain the original HTTP_REFERER value even though the user refreshes the page?

View Replies View Related

If Statement

If a user enters in this to search a db

"Jon Doe" James Doh

return all of the exact matches Jon Doe (user uses quotes to clarify an exact search)
along with that: return all of the James and all of the Doh as well
qry to look like this as soon as I am able to divide up the string entered in by the user
select * from table where (NAME LIKE '%Jon Doe%') or
(NAME LIKE '%James%') or (NAME LIKE '%Doh%')

Thinking of using the instr to find the " but then what do I do to find the string inside of the two quotes, One quote would be easy. there is a couple of checks to preform:anyone run into this before or have any ideas/samples, etc

View Replies View Related

Sql Statement ?

I have created a query wizard page with ddl as your choice to find info. now each ddl has a default of a dash.

The thing is I want to do is have the sql statement to look through the database even when some of the ddl have a dash on them. or just ignore the ones with a dash and look for the ones that are selected. Is there any suggestions for this.

View Replies View Related

ASP If Statement

Below is my code for a question system i have created. However, i need to insert an if statement that redirects the user to test.asp if the value of q_id is not in my database, but i dont know how to do it?

<%
q_id = request("q_id")

sql = "SELECT * FROM questions WHERE PARENT_ID = 1"
Set objRS2 = Server.CreateObject("ADODB.Recordset")
objRS2.Open sql, objConn

sql_sql = "SELECT * FROM questions WHERE PARENT_ID = " & q_id
Set objRS3 = Server.CreateObject("ADODB.Recordset")
objRS3.Open sql_sql, objConn

%>

View Replies View Related

AND Statement

my AND statement is not working and I dont know why????

sql = "SELECT * FROM calls WHERE tech=" & userID "AND status = Open"

tech and status are the DB fields

userID is a variable

Open is just a word

View Replies View Related

If..Else Statement

i make a form with an AccountId box on it , when u enter the accountid in the box , and submit it will send u to a page that show u all the data for this accountid(retreive data)

until here everything is ok , and when i enter for ex. accountid : 5 , all the aacountid fiel data will be show to me , but the problem when i enter am unvalid accountid , it will give the error page that

what iwant to do that i want when i enter an unvaildaccountid an error text show to me like

response.write("The Id that u entered is unvaild , Try Again")

and this is the code , if u can change on it Code:

View Replies View Related

IF Statement

I am trying to use the following IF statement, and whenever I use a
single or double quote, I receive a syntax error. When using no
quotes, the syntax is accepted, but the statement does not perform
properly.

***The problem line***
<% if violation_type=''Tardy'' THEN %>
***rest of the statement***
TARDY VIOLATIONS
<% if rs2.Fields(0) = 0 THEN %>
This is the first unexcused Tardy violation for this employee. A
coaching is required. Click <A HREF=blah>HERE</Ato issue the
coaching.
<% ELSE %>
This employee has <%response.write(rs2.Fields(0))%previous
violations.
<% END IF %>
<% ELSE %>
The <%response.write(violation_type)%violation has been recorded.
<% END IF %>

Variables defined:
violation_type = request.form("violation_type")

View Replies View Related

If/Then Statement

On a page with a form (post method) and a hidden field "Process value = true", why would this statement not work:

<%
if request.Form("Process") = "true" THEN
The code in here sends an email to the user via CDOSYS
End IF
%>

This is what I have going on and it does not send the emal when the form is posted. Removing the If statement obviously sends the email the moment the form page is accessed, but thats not right.

View Replies View Related

Statement Not Following

i have a couple of if statements and it goes something like this, the user will try entering their username and password in the login page then they will be taken to a verify page, then it will decided if the user can be send to the login page again or to the invalid page. The problem is that after 3 times the user is still send to the login page and not the invalid page My verify page code is :-
<%
session("try") = try
if try = "" then
try = 0
else
try = try + 1
end if
if try <> 3 then
response.redirect("login.asp")
else
response.redirect("invalid.asp")
end if

View Replies View Related

My Sql Statement

Recordset1.Source = "SELECT `bestsellerslists`.`itemnumber`, `bestsellerslists`.`list`, `products`.`Product_ID`, `products`.`Product_Name`, `products`.`Price`, `products`.`Sale_Price`, `products`.`Smallpic` FROM `bestsellerslists` INNER JOIN `products` ON (`bestsellerslists`.`itemnumber` = `products`.`Product_ID`) WHERE (`bestsellerslists`.`list` = "girlinfant")"

In Macromedia, the recordset tests fine. When I start the page, I get an error. Do you see anything wrong with this? If I delete the WHERE clause it works.

View Replies View Related

If Statement

I'm having a problem with my variables. They print to screen fine, but when I try comparing them, they don't work. Can anyone tell me what I'm doing wrong?


If Category <> CurrentCategory then
response.write "<tr><td>Category:" & Category & "</td></tr>"
response.write "<tr><td>CurCategory:" & CurrentCategory & "</td></tr>"
else
response.write "<tr><td>hello</td></tr>"
End If

Code:

View Replies View Related

If Statement

I am passing in values either customer id (key) or their names (name) from a form .
You don't have to use both the id and the name to search for the customer however I don't know how to do this!
If the keyform = "" then , use the name to find the customer
else
can't find it! this is what I have at the moment :

keyForm = Trim(request("key"))
name Form = Trim(request("name "))
Dim name , cyfeiriad, tref, sir, codpost, ebost, ffon, cyfrif, dyddiad
Set dnsSQL = g_con.Execute("SELECT key_user_accounts,name ,cyfeiriad,tref,sir,codpost,ebost,ffon,cyfrif,dydd iadcreucyfrif from cwsmeriaid Where key_user_accounts = " & keyForm & "
if not name = "" then and name = '" & nameForm & "'")
else ")
end if

View Replies View Related

End Of Statement

ii am using a statement to send a query to the SQL server and i am getting errors like expected end of statement.
what might be the problem and do i use a statement like this for dynamically assign values or it's better to use stored procedures.

dim mySQL="Select * from logindetails where loginname='" & logname & "'"

View Replies View Related

SQL - Like Statement

what am i doing wrong:

SELECT * FROM Tablename WHERE Content LIKE '%Netcapa%';

this is the error im getting

ADODB.Recordset error '800a0bb9'

View Replies View Related

SQL Statement How To Do It

I was wondering how do you arite an SQL statement that only displays the list of projects from the last 30 days (i do have a date field as well)

View Replies View Related

If Statement

I have this code:

<%=strContent%><br><%=getData("News", "TOP 5 *", 1, 0, "News_title", "News_Date", "News_Id", "news.asp", "100%")%>

which brings back news data from the db

how can I write an IF statement to check if the news page is displaying an id and if it so not display the code... ie Code:

View Replies View Related

If.. Else.. Statement

I'm fairly new to coding in asp and i'm trying to create a simple if.. else... condition.
It's for asp web page, and is linked to my database, but i figured since it's a basic question, it would belong in the General newsgroup.

All i am trying to, is, on my web page I have a table cell, that feeds off my database.
If there's something in the database in that particular field, then I want it to be displayed, If not, then rather the cell return a blank field, I want a picture from another field.....

View Replies View Related

IF Statement

How can I do the following:

If recordset is empty, redirect to page1 but if recordset has something in,
redirect to page 2.

View Replies View Related

IF Statement

How can I use an "IF" statement to decide what to write depending on the content of a field. I've usually been just designing my database around using

if isnull(rs_events.Fields.Item("f_register")) then response.write("")

But I would like to change my current schemas so that I can make a smaller database, so that

if (rs_events.Fields.Item("f_register")) = "Yes" then response.write("Yes") else response.write("No")

How can I acheive this?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved