Run A Series Of If Statements Against The Sql Result
Just got back from a half marathon and my brain is leaking more than my shower. I've got me an sql statement that uses the count facility, hence im expecting a numeric value to be returned when the query is executed.
However, I want to run a series of if statements against the result - so I guess I need to get the result into a variable or such, to do the work on. Problem is, I dont know how. Worse still, it seems that nowhere on the web is a tutorial telling you how.
View Replies
ADVERTISEMENT
it is possible to compare the result of 2 recordset and
filter those similiar results,and display only the remaining results
View Replies
View Related
Does anyone know how i could print multiple records in a database using a series of check boxes on a webpage? i.e it prints all the records that have been ticked?
View Replies
View Related
i'm developing a site but i'm still new to ASP..i could only
code a simple DB [add/edit/remove] coding..
i need to creat accounts for users, so i must have a LOGIN page
contains all the standard such as: Logout, register new user,remember password ,,
users who should register in my site , are previously stored in DB by a KEY field..not to allow any user to register..a new user should only insert that key,if it is exist in my record,i shall allow him to view some pages.
View Replies
View Related
I need some help with some if statements in an asp page I got. My sql statement is:
sql = "select * from courseDesc"
I want to logically diplay all the information on the page. So I inserted this if statement to choose the information I want to dispaly:
<% if rs("courseName") = "whatIsCist" then
response.write(rs("description"))
end if %>
Other courseName titles I need to display the information for further down the page, include: wdt, lan, wan, programming, admissionReq1,2,&3. Does anyone see where my problem is?
View Replies
View Related
I'm having problems getting some ASP code to work with a form I'm using. I'm using the script with a multiple page form and want to print a javascript onsubmit value for just one of the forms. I'm getting errors because of the multiple IF statements and I'm not sure how to do this and have the "s show up properly in the output. Can someone tell me how to do this properly?
Code:
<% If step < 5 Then Response.Write " <form action="/script.asp" method="post" name="theForm" id="theForm" & If step < 1 Then Response.Write " onsubmit=""" & "return checkForm(this);" & End If %> & ">" & End If %>
Here is how I want it to output:
<form action="/script.asp" method="post" name="theForm" id="theForm" onsubmit="return checkForm(this);">
View Replies
View Related
is there a way to use "or, and" statements in asp,
what i want to do it do 2 seperate checks on the database and if one is true or the other one is true then display some text is this possible and also the same check again on the database but the first statement and the second statement has to be true then display some text is this possible, if yes how would i do it?
View Replies
View Related
I have a field on an asp form called hotelYesNo (YesNo value-pulldown) and a field called roomMate.
I want to do an If Then statement likeso: If hotelYesNo = Yes Then roomMate is required, but if hotelYesNo = No Then roomMate is not required.
I don't know how to get this accomplished in the asp code.
I know how to do this in Microsoft Access but not on a webpage.
How would this be done?
View Replies
View Related
I want to run a query and need to use If then statements such as: If this is output, then run this query. Is there a way to do this?
View Replies
View Related
I didn't really get a direct answer in the .net forum so I guess I'll just post it here where it should be anyway. Instead of .net I'm just going to probaly stick with 3.0. I want to have several different templates for users to browse a site in.
Since I can't use include files in ASP is there a way I can ONLY load coding in an if statement as it applys to that certain user? I want to enclose multiple images and coding into one file but only load the ONE image/code that pertains to the user. Is this possible using if statements?
View Replies
View Related
i am trying to find out if three feilds in a record match, if so send it to another page. basically see code.
Quote: rs.Open "Rental", cs, adOpenDynamic
Do Until rs.EOF
If rs.Fields("MemberID").Value=person And rs.Fields("DVDID").Value=dvd And rs.Fields("Current").Value=true then
Response.redirect "copy.asp?memberid=" & person
End If
rs.MoveNext
Loop
this does not bring up a problem just does not do it any ideas on if staemenst etc in asp thingy.
View Replies
View Related
I have a (hopefully) simple question that has been giving me some problems. I'm trying to use a simple Select statement to access some data in an access database. In access, the sql statement is as follows:
SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master
However, when I try to do this on an ASP Page, it always causes an error. I'm assuming this is because of the [] around the field name 1. (I would change the field names, but I don't have control over that).
I know when trying to use a * in the statement Where field LIKE 'A*' I needed to replace the * with a %. I was wondering if something similar had to be done in this case.
I hope my description is clear enought to follow.
View Replies
View Related
We have currently launched a website in ASP and now want to add some tracking functions.
We have banner ads and emails that we are launching.I would like to create code that will allow me to change the an image and a text link based on where the user is linking in from.
I.e If they clicked on banner xy - then the index page the images would be xy and the text box in another page would be xy. if they clicked on banner zz - then the index page the images would be zz and the text box in another page would be zz.
View Replies
View Related
I have a database setup and the results come out as
Product 1: Shorts
Size: M
Price: £2.99
Product 2: T-Shirt
Size: XL
Price: £3.99
Total: "TOTAL HERE"
What I need to do is total these up
The Cells are called:
Product
Size
Price
View Replies
View Related
I want to do some checking for my table for eg:
I want to check if the table for which year then if same year then do something.....
View Replies
View Related
I have been avoiding this issue but it keeps popping up and I cannot figure out a solution. Include statements pathed two or more folders deep they break.
This works:
<!--#include file="../includes/mo_security.asp" -->
This does not work:
<!--#include file="../../includes/mo_security.asp" -->
So basically my site files are limited to one folder deep.
Ex: ROOT/parentFolder/files.htm
One I move another level down the includes do not work anymore:
Ex: ROOT/parentFolder/childFolder/files.htm
I am on a Windows IIS server. Is there any solution to this or is it just a limitation of the include statement?
View Replies
View Related
I have a project to do that requires that I use mysql as the database. I have only used MS Access. The sql will be simple searches.
Is there a drastic difference, or just different punctuation?
Can I find a copy of mysql on the web? If so, is there any advice on installing?
View Replies
View Related
Is it possible to wirte a VBScript If statment that outputs different HTML? IE: If **** = True then do this HTML else do this HTML?
How do you do something like that?
View Replies
View Related
Basicly I pull the whole column contents and what to test to see if the username is that list. How can I do this in an if statement. I know how to do this kind of thing in SQL (LIKE operator) but I need to test agains two recordsets. Code:
View Replies
View Related
Question 1: How can have th asp script automatically convert the date generated by the system to a format which is acceptable by Sybase SQL (yyyymmdd)
Question 2: If the user were to insert a a string containing " ' ", how can I convert it into a special character so that it won't be treated by Sybase SQL as the start/end of a variable?
View Replies
View Related
I am using the ASP include statements for some HTML code, and I have the <body></body> tags included in an outside <!--#include--> file. Is this OK? Or could it mess something up not having the <body></body> tags in the actual page HTML?
View Replies
View Related
I am getting an error on my sql update statement and I can't find where it is. I am getting the message, "syntax error in update statement". when I do a response.write on my sql statement this is what I get back
update tblUser set lastname='Ray', firstname='David', address='petal ms', email='david@ray.com', pass='dray', where username='dray'
View Replies
View Related
Is it possible to use If Then statements in an a href tag? What I am trying to do is I am using a server side include page of navigation inside of a content management system. I have limitations on what I can manipulate and change. So just using style sheets won't do me the trick. I want to have a navigation link change a different color when you are on that section. I have the menu expanding also using if then statements. When a variable is passed somewhere else on the page as true, the menu expands. I figured I could use this in the same way to make the link change colors. I want to do something like:
<A href="#" <% If Variable_name then%> id="link <% end if %>>Link Here </a>
Is that possible? I know that i can do an If then statement and have 2 different links, one with the id and one without, but I wanted to see if I could simplify it at all. I'm not the best with ASP so there might even be better ways then that...I was just using from the little that I knew.
View Replies
View Related
I'd like to combine if possible these two statements drawing from a total of 3 tables.
sql = "SELECT p.Sub_ID, p.Cat_ID, p.Sub_Name, COUNT(c.Sub_ID) as ct FROM
Subs p LEFT JOIN Links c ON p.Sub_Id = c.Sub_Id GROUP BY p.Sub_ID, p.Cat_ID,
p.Sub_Name ORDER BY p.Sub_Name"
sql = "select * from Subs inner join Cats on Cats.Cat_ID=Subs.Cat_ID ORDER
BY Sub_Name"
Is it possible? Am I totaly screwed up for even trying? The goal is to count the relations ships in the Subs and Links table based on Sub_ID, to display needed data from the Subs table, and to display the Cat_name table from the Cats table in relationship to the Cat_ID in both the Cats and Subs Table.
View Replies
View Related
I am trying to create a prepared statement in ASP, but am having problems with creating the parameter object. I do the following
Set fnParam = peopleUpdate.CreateParameter("@firstname", adVarChar,
adParamInput, 50, peopleSourceRS("firstname"))
But this gives the following error on the browser:
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. The server doesn't seem to like adVarChar and adParamInput. I did try
to create the parameter without arguments and then assign the properties, but it gives the same error for .Type and .Direction. What am I doing incorrectly here?
View Replies
View Related
I have these two statements and I want to join them to make one query, i don't know how to do it since there are two querystrings that are selecting my data for me.
sSQL = "SELECT * FROM AssemblyName Where AssemblyName = '" & Request.QueryString("assembly") & "'"
Set oRS = oConn.Execute(sSQL)
sSQL = "SELECT * FROM PartsList Where ID = '" & Request.QueryString("one") & "'"
Set oRS2 = oConn.Execute(sSQL)
View Replies
View Related
if not request("email") like "%@%" or not request("email2") like "%@%" then
response.write "<span class=""whitebox500""><br>THIS DOES NOT APPEAR TO BE A PROPER EMAIL ADDRESS."
response.write "<br><br><Br><input type=button onClick=""javascript:history.back(-1);"" value=""Back to Signup <<""><br><br>"
response.end
end if
and want to wildcard test the request to see if it is properly formatted email with an @ and a dot.
View Replies
View Related
Can i have 2 insert statements in my code inserting data in different tables.
So after i hit submit,the date should go and reside in particular tables.is it possilble?>and if yes..how do i do..any examples /links you can pass me?
View Replies
View Related
I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our site, it scrolls out all the items in that category, maybe 30 or more. I have text boxes next to each item so somone can enter a number, then press submit form button at the bottom of the form, and
send those slections to the shopping cart.
The problem is, many of the text boxes are empty, yet they are still being sent to the shopping cart as a quatity of 0. Is there a way for sql to ignore a value if the variable is zero, or only get the sql statement to run if a variable is > 0?
View Replies
View Related
Does anyone know how i can make
[code]
Dim excl
excl = rs("price") / 1.175
[code]
return only a 2 decimal place number
View Replies
View Related
i want to have a search application wherein it returns a results page and arranged based on the most relevant word. can you please give me an idea with this or point me to any info.
View Replies
View Related
How can I assign the result of a SQL-query to an ASP variable? This is what I have so far but it doesn't seem to work. Code:
dim strSQL
strSQL="select TestID FROM TestID_Description WHERE CL1='" &Request.Form("CL1")& "' AND CL2='" &Request.Form("CL2")& "'AND CL3='" &Request.Form("CL3")& "'AND CL4='" &Request.Form("CL4")& "'AND CL5='" &Request.Form("CL5")& "'AND CL6='" &Request.Form("CL6")& "'"
objRS("TC_Number")=objConn.execute(strSQL)
Maybe it's interesting to know that TC_Number is the primary key of the table.
View Replies
View Related
The delete method of the FileSystemObject.FileObject does not return a result. If permissions disallow deletion, it will not raise an error. Conversely, if the delete method does succeed, a call to FileExists directly afterward may return true because the system hasn't updated yet (or whatever actually goes on). Is there any way to accurately check the result of a deletion?
View Replies
View Related