i have an SQL field search with start and end dates (first five lines code below) this works fine.
have added radio button "SignOff" so user can search fields where case has been signed off, not signed off or both (normal return). The sign off date (date_closed) is either a date or NULL, where radio button choice 'two' is NOT NULL ie there is a closed/sign off date, and 'three' is NULL.
as mentioned the first if statement works fine but when i introduce the SignOff statement below, the wheels fall off. I have forced through the SQL statements used and these seem to work so I am presuming my if statement format is faulty. oh, and if it hasnt come across already, I am a VBA/asp beginner. Code:
Can someone tell me where ive gone wrong here, this my first attempt at writing a dim myself...
Dim trades trades=" if t_plaster,t_hs,t_plumb = Yes Then Response.Write ("<img src=""/images/yes.png""/>") else response.Write("<img src=""/images/no.png""/>") end if "
I am authoring a dynamic web-based project managment system, and I was wondering if anybody could help me with this situation. As of right now the database connection strings are located in each and every page.
I was pondering if there was a way to make a configuration file (similar to phpBB2 setup pages) where all of the data such as: database strings, settings, and variables are stored.
I have my webserver and a database. Things started to slowdown a ton with access, permissions denied (it is on a Windows XP machine, 10 session limit, etc).
I moved my database off the webserver to a faster and more secure location. I can't access the database through the webserver anymore.
I am using Windows Authentication. I understand that the webserver will be using the IUSR_xxxx account to access the database. I am at a loss on how to access the database.
I am having a problem which thus far only seems to be fixed when I refresh the page. The basic process is as folllows:
1. Select details from the DB and display on screen.
2. Click a link 'Generate Docs'.
3. This then goes to a page which first selects from the DB using information passed through the URL from the above link to identify the correct records. We then create a PDF file based on the data from the DB and display the link to the newly created PDF. The problem, is that at step 3 the PDF does not get generated on the first pass, only if you click the refresh button on the browser.
I have checked all the obvious items, ensuring variables are assigned correctly and called correctly, I have tried implementing a number of 'must revalidate' style tags in both ASP and HTML, I have checked through all of the queries to ensure they are being processed and the data is returned on the first pass and they are and nothing thus far has worked.
I am having a problem getting some data fields to display in currency. Below is how I am getting the currency fields calculated - this works fine, no problems here, they do display. Code:
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
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.
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
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:
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 %>
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.
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
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.
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
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
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 & "'"
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.....
I'm trying to write an if statement that shows a message if there are no records to display that match my select statement:
employment_op.Source = "SELECT Employment_Display, Employment_Link, Employment_ID, Employment_Category, Employment_Position_Title, Employment_Qualifications, Employment_Description, Employment_Application_Details FROM dbo.hr_employment_opportunities WHERE Employment_Display = '1' AND Employment_Category = 'Staff' ORDER BY Employment_Position_Title"
I was trying to use
<% if employment_op_numRows = 0 then response.write "No Current Openings" end if %>
Which doesn't return anything - can somone please tell me what I'm doing wrong?
I have been screwing with this for over 1 week now.The only time this works,is when the if statement is at the very top of the page.This presents a whole new problem because now I can't grab the variable from the recordset and I need to get it from a hidden field "request.QueryString.
How can I pass the users email address variable from a hidden field to the CALL statement without anyone seeing it in Source View?Quote:Originally Posted by janusz-jasinski I'm not sure what's going on in that case.I used same script and worked here.
Ih I have part of XML as: <HOUSES recordcount="0" /> How can I have a statement that would check if HOUSES doesn't have any items - then it would output some text? I tried <xsl:if test="HOUSES[RecordCount='0']">text </xsl:if> But it didn't work.
I have the following SQL query which looks at the current date, and displays the next closest date that is recorded within my database. The code for it is below:-
Code:
strSQL = "SELECT TOP 1 events.EventTitle, events.eventdateformatted, events.eventURL, events.eventdate FROM events WHERE eventdateformatted>Now() ORDER BY events.eventdateformatted;"
Now the problem is that when there are no other future dates recorded within the database, an error appears saying just that. Is there a way I can use an If statement to say, 'Depending on the current date, if there are no future dates, display "There are currently no other future events that we will be displaying at"'
I'm trying to write a statement that says if a course code is between a particular range and a field is null, then a certain page should be displayed: Code:
if eval(coursecode) >= 24 and eval(coursecode) <= 44 then if rs("ce_has_degree") = null then redirectline = "supplemental_form.asp?filekey=" & filekey response.redirect redirectline end if end if
I don't get an error, but I also don't get the supplemental_form.asp page. Can someone tell me what I'm doing wrong? I seem to have a horrible time getting nulls to work properly.
if (condition) is true OR (condition) is true THEN. Can I use OR or do ihave to break it down into an elseif statement? I tried OR but it does not seem to work.
How can I make an IF statement to check the domain name a user has entered to access a website?
We have a website that has 3 different domain names associated with it and I need to change some of the content based on which domain the user enters to get the page.