How Do I Put A Variable And A Non Variable In A From Statement?
sql = "SELECT * FROM & console &'news'"
I got that right now but i want the variable, console to be placed along with news so when it selects from the db it selects from gcnnews or whatever variable it's on. How do I do that?
View Replies
ADVERTISEMENT
I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement:
SQL = "SELECT tblContacts.* FROM tblContacts INNER JOIN tblGC ON
tblContacts.GCID = tblGC.gcID WHERE (((tblContacts.GCID)=strGCID))"
i am just not sure of the proper syntax.
View Replies
View Related
I need this variable = to a loop statement
Here is my str
form_bcc = Cstr(If Not objRS.EOF Then objRS.MoveFirst Do While Not objRS.EOF objRS.Fields("Email") Response.Write ";" objRS.MoveNext Loop End If)
And help on how to get this to work?
View Replies
View Related
I have created a hyperlink in one page (all.asp) using this code:
<a href="cat.asp"><%= rsProds("category")%></a>
How do I create the sql statement in cat.asp to show only the categories listed by the link in all.asp?
I have this in cat.asp so far:
strQuery = "SELECT * FROM biz WHERE category = ' " & strVariable & " ' ORDER BY bizname ASC"
which shows nothing since the string variable had not been passed.
How do I get the hyperlink category name into cat.asp sql query as a variable?
View Replies
View Related
I'm trying to use a variable of retrieved via request from a form to select records.I'm pretty sure I am having a basic syntax error or something else basic. I retrieve the variable from a prevous form:
section_id = request("section_id")
I then retrieve some records and run the compare, if i use the actual value it works:
if rsArticles("tbl_articles.section_id") = "1" then
however if I substitute the variable section_id which equals 1 , it fails the compare and moves on to the else:
if rsArticles("tbl_articles.section_id") = section_id then
if I call the section_id value elsewhere it shows that it is set to 1, so I know it's being passed, <%=section_id%> returns 1 . What am I missing?
View Replies
View Related
i'm trying to change the following include statement :
<div id="contents">
<!-- #include file="includes/main_page.asp" -->
</div>
on an ASP page into something that receives the file name as a variable :
<div id="contents">
<!-- #include file="<%=fileToInclude%>" -->
</div>
however, this doesn't seem to work, as i get the following error message :
The include file '<%=fileToInclude%>' was not found.
it obviously is trying to find a file named <%=fileToInclude%> instead of seeing the variable my question is : is it possible to feed a variable into an include statement ?
if yes, how should i go about it ? if not, are there any alternatives ?
View Replies
View Related
I'm trying to calculate the total time using values from database I run a select statement to find the timein column in my database.
Now how do i assign the result to a variable so that it can be used? There is only going to be one result because i'm checking it against an autonumber field. that is used as time 1. Code:
View Replies
View Related
I have a page that calls itself using a form. The form has two select elements. In the sql statement I am attempting to match the values of the select element to populate a recordset.
The two fields in teh Access db are of type Text and of type Integer. What baffles me is that one sql statement works fine and the other returns nothing. I am having the issue matching on the bedrooms.
In the first statement I took out all other doo-doo and just matched bedrooms = request("bedrooms"). On the other one I used p.bedrooms but it keeps turning up empty. Code:
View Replies
View Related
I'm turning my application into a "DLL". Everything worked fine untill I try to do a "While" in my asp code. Then I recieve an error like this:
"Object variable or With block variable not set"
My vb code look like this.....
View Replies
View Related
is there any way of passing a javascript variable over to a asp variable so
i can write it to my database.
View Replies
View Related
How do I convert an ASP variable to a Javascript variable?
View Replies
View Related
im trying to subtart one quantity from another then stick the answer in to an update statment, but all i get is an error in syntax message
variable math bit=
qty=request.form("oqty")-Request.form("qty")
sql =
sSQL="Update spares SET spares.location='"&request("location")&_
"',spares.machine='"&request("machine")&_
"',spares.part_desc='"&request("part_desc")&_
"',spares.part_number='"&request("part_number")&_
"',spares.qty='(" & qty & ") "&_
"',spares.min_qty='"&request("min_qty")&_
"',spares.updated_by='"&session("name")&"' WHERE(spares.id)=" & form_id
View Replies
View Related
I need to assign a value to a variable, but this variable name is dependant upon another variable!! I am including the code below so you can see it, cos if not I am sure you are thinking whattt?? Code:
View Replies
View Related
I have many buttons that mapping many textbox, when I click button, I
want to show a string that contains button number( and the mapping
string ), but it failed.
Here is the code:
/////////////////////////////////////////////////////////////////////
<%response.write"<input type='button' name="'btUS95resone"&" a &"'
value='Save' onclick='resone("&a&")'>"%>
function resone(cnt)
{
alert("document.all.txt_note"+cnt)
}
////////////////////////////////////////////////
It seems that the component I called is not there...
View Replies
View Related
Can anybody tell me what is the asp equivalent of the php-phrase:
if (!$Variable) {}
?
Another question: is there a special syntaxis for asp conditions in condition?
I tried this code it doesn t work:
If Condition Then
If 2nd condition Then
ElseIf Then
End If
End If
And it works only when I remove the 2nd condition's End If and the ElseIf. Seems strange, no?
View Replies
View Related
I have a text file that looks like this:
Artist Name: Kiss
Song Title: Rock and Roll All Night
Running Time: 04:38
And I need to be able to get the artist name and song title in asp and display it on a website. The thing is, the text file changes with the song being played on the radio. How can I do this?
View Replies
View Related
I've been given an ASP app written with server side javascript. This app needs to get the username of the person currently logged in to windows (Request.ServerVariables("AUTH_USER") in vbscript). I found a way to get this variable in javascript, but then it wouldn't let me split it (server kept saying method not supported). So I've gave up on getting the username with javascript, and have set variables in VBscript at the top of my page. How do I access those variables within the javascript portion?
View Replies
View Related
i have a textbix name "building" inside my system where the user might input one or several building name in it seperated by a comma. How can i extract each of the value in it? For example, "PG2, PG7, PG6", i want to extract each of them.
View Replies
View Related
I have this url that loads, but in the url is the date, so I need a variable i can use so as the date changes the url is automatically updated,
View Replies
View Related
using access db and asp
i have a variable from a form
sRound = request.form("round") and for now let us say this value is 3
now i want to include that 3 in sql, but it is part of a field name which
is round3_report
cm.CommandText ="UPDATE rounds SET round" & sRound & "_report = '" & var5 &
"' WHERE Name ='" & sName & "' AND meeting = " & var4 & ""
cm.execute
this isn't working. i keep getting parameter error. i know there is a way to
join a word with a variable in order to make a field name in asp/sql
View Replies
View Related
I am having difficulty in displaying Response.Write rsVacancies("Title") variable more than once. If I remove it from the page title it displays within the description tag but does not display in both. Code:
View Replies
View Related
I am tring to search a database with an SQL statement via a web page. I am using Dreamweaver to build my page. The search works great when I hard code the table field into the Recordset. However, I would like to implement a variable on the field in the table to do the search on.
For Instance, a user can make a selection in a drop down box and then enter the text in a text field. I am having trouble implementing the drop down box variable into the code. I suspect I need the WHERE to be a variable just as the LIKE parameter but I keep getting errors. Code:
View Replies
View Related
I have one condition for getting the image in an included file. If the file which is including the included file is from parent folder if should pull the image directly from Image folder, otherwise it should change the path like Code:
View Replies
View Related
I have created the pages for a website in HTML. I need a script in ASP that displayes the HTML pages when requested (EG: script.asp?page=HTMLpage1).
<html>
<head>
<title>Test site 1</title>
</head>
<body>
<% page = request("page")
select case page
case main: <!--#include file = "index.html"-->
case "services": <!--#include file = "services.html"-->
case "case_studies": <!--#include file = "case_studies.html"-->
end select
%>
</body>
</html>
Any ideas on how to make this work?
View Replies
View Related
for example, if i have Code:
do while not c.eof
if c.fields("id")=request.cookies("id") then
response.write "This is you"
else
response.write "This is " & c.fields("name")
end if
c.movenext
loop
the request.cookies("id") does not work! no variable will work in its position, either. the 'if...then' statement above will only work with c.fields("id")="something", not a variable, like i want. how can i get around this?
View Replies
View Related
I have a HTML-only file, and asp file that do a databasequery.How can I do a query in the html file, like this: DBLookup("2").The asp file execute the query and respond with the result. Send it back to the htmlfile and put it were the "DBLookup("2")" is.
I can not have any asp code in the html page.I have a php file that works like this, but how can I do the same with asp?
View Replies
View Related
how can I name a variablewith the value of another variable to make the first more dynamic.Code:
<%
sql = "SELECT * FROM table"
set rs = cnn.execute(sql)
submodule = rs("ID_submodule")
counter_"submodule" = 0
%>
The idea is where it says "submodule" is the value of the submodule, because this part of the code is a loop that checks all the table registries. Then the 0 would be 1, 2, 3.. depending of the quantity of registries associated with the ID_submodule related.
View Replies
View Related
I have a variable in an app called GenericTitle which contains text, a persons job title funnily enough. I want to check whether this variable contains the word "director" and if it does, then redirect to another page for example. Can somebody post some code that would let me check this?
View Replies
View Related
How do I use a variable in a SQL database thing. I need to do an insert. I need to know how exactly to type it in. Here is what it is
INSERT dbTable (column) VALUE (where variable needs to go)
How do I type it. Is it &variable, ''&variable, etc. I know this is easy, i just can't think.
View Replies
View Related
I've got a form in my website where the users has to type a message. Is any code in ASP where I can get the last word of the message? Ex If I user types "Active Server Pages" is any code to get the word Pages and put it in a variable?
View Replies
View Related
i just can't seem to get it right.
<img name="nicepicture" src="<% getPicture %>" border="0" alt="">
I want the src to be variable.
View Replies
View Related
Is there any kind of variables (i think session vars?) that stores the data in it for ever.. I mean i have a project with textbox and button, every time some enter a data to this textbox I want it to store "var=var+1" number of times people done inputing.. then I can show this value in a page.
View Replies
View Related
Instead of using <asp:sqldatasource selectcommand="select * from Table1">, how can I use a variable in place of the 'Select * from Table1' ?
View Replies
View Related