Arbitrary/Variable/Dynamic Variables?

I have a spare parts database that I am working on. All that needs to be stored is the part description, what it goes to, and the quantity in stock.

Since that's all that I need, I want to be able to allow the user to edit the quantity right on the results page, through a textbox. Just change the number in the textbox for each part, press the button, and voila, it's all saved to the database (and is redisplayed for your convenience.)

However, there is no set amount of part rows. Right now, I'm creating the text boxes using the id of the item (i.e., name="quantity<%=RS("partID")%>"), but I'm not certain how to call the variables to put in an insert.

What is the syntax for dynamic/variable variables (if they even exist in ASP)?

View Replies


ADVERTISEMENT

Dynamic Variables

Is there a way to create dynamic variables when looping through a recordset? For example below, after the 1st loop I'd have myVarA1 and myVarB1, after 2nd loop, I'd get myVarA2 and myVarB2.

CODE ***********************************

set objRS = GetMyRecordSet()
i=1
objRS.MoveFirst

Do While Not objRS.EOF

"myVarA" & i = objRS(0)
"myVarB" & i = objRS(1)

i = i + 1

objRS.MoveNext()
Loop

View Replies View Related

Dynamic ASP Local Variables...

I'd like to create a series of variables created dynamically, example such
as this...

For i = 1 to 5
TheVariable & i = "blah"
Next

This would during the first loop create a variable called 'TheVariable1'
with a value of 'blah'. Is this possible as so far I'm getting syntax
errors?

View Replies View Related

Dynamic Variables Syntax

What's the correct syntax here:
(given the recordset myRS with x records

do until myRS.EOF
txtvar & myRS("serial_number") = myRS("serial_name")
myRS.movenext
loop

..asp will not build the dynamic variables
txtvar1 = "Some name"
txtvar2 = "Any name"
txtvar3 = "Your name"
.....
Based on the serial_number in the current recordset.How can I builde the dynamic variables, and give them a value from my recordset?

View Replies View Related

Dynamic Variable Generation

If I have 5 variables "SUB_1, SUB_2, SUB_3, SUB_4, SUB_5" and I assign them values from a SQL2005 database..

SUB_1 =(UPDATE.Fields.Item("SUB_1").Value)
SUB_2 =(UPDATE.Fields.Item("SUB_2").Value)
SUB_3 =(UPDATE.Fields.Item("SUB_3").Value)
SUB_4 =(UPDATE.Fields.Item("SUB_4").Value)
SUB_5 =(UPDATE.Fields.Item("SUB_5").Value)

I have a WHILE LOOP generating a dynamic table from a different database table

Code: ....

View Replies View Related

Creating A Dynamic Variable

a way to view the contents of a variable. But That variable could be one of several variables. So, I would like to pass in the name of the variable as a string into a function, and pull out the contents of that variable.

View Replies View Related

Set Dynamic Contents Of A Asp Page In A Variable

I would like to read the dynamic contents of an asp page and set these in a variable.
In php I can do it with the help of include, but include is not exactly the same in asp.
Any clue?

View Replies View Related

Dynamic Drop Downs And Page Variables

i have a website that uses (or needs to use) dynamically driven dropdowns using asp & JS on all pages. it contains 3 different dropdowns that are DB fed and are dependent upon the value of each other. the drop down values are updated using a repost to itself.

they work perfectly on the initial pages where no other variables are involved, but i am having troubles on the pages where more variables are being sent. eg: i have use a lot of error checking, and when i repost, the variables are deleted, and thus the error listings take effect as the variables are now blank. can i refresh the dropdowns without repossting to the samepage without effecting the existing variables on that page? sessions? cookies?

View Replies View Related

Variable Variables In ASP?

How do i refer or even create a variable of a variable in ASP.

(equivalent to PHP's $foo{$bar} ) ?

View Replies View Related

2 Variables As One Variable

I need to select a date range from my history table for customers that are 30 days out in billing I have 2 fields history.posted and history.transcode.I use select * from history where transcode ='P' and posted between('1980/01/01') and '" & FormatDateTime(Now()-30) & "

the problem is if the customer doesn't have any history it is not pulling them cause it is looking for transcode of 'P'

View Replies View Related

Creating Dynamic Variable Names In A Loop

I'm having a brain fart at the moment. Can someone tell me how to dynamically create variable names based on a loop counter?

for i = 1 to Num_Cart_Items
Item_Name & i = Request.Form("item_name" & i)
Item_Number & i = Request.Form("item_number" & i)
next
Desired result:

Item_Name1 = Test Product
Item_Number1 = 1234
Item_Name2 = Test Product 2
Item_Number2 = 2345

The problem is with the Item_Name & i..I used to know how to do this, but I can't remember or find any code that I did this with.

View Replies View Related

Split Single Variable To Get Multiple Variables

This is a simple question, but is been a while since I program in ASP and I forgot.

I have a variable like this: 01-00005-03

I need to have 3 variables from that single one... Something like this, from that variable, let for example that is called fullvariable, split it and get the following variable values from it.

variable1 = 01
variable2 = 00005
variable3 = 03

View Replies View Related

Dynamic Calendar, Need To Create Dynamic Array....

I code that creates a calendar for each month and then it displays events from that month that are stored in a db. I need to loop through my recordset and display all the events, but I can't quite figure out how to do it. I am thinking I need to do an array. But I am not really sure.... any ideas. Here is where you can view the calendar. Code:

View Replies View Related

Difference Between Environment Variables And Server Variables

can anyone tell me difference between environment variables and server variables.

View Replies View Related

Calling Com + Object Variable Or With Block Variable Not Set

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

Passing Data From Javascript Variable To Asp Variable.

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

Convert ASP Variable To Javascript Variable

How do I convert an ASP variable to a Javascript variable?

View Replies View Related

Dynamic Dynamic Text

Ok, I have a Javascript ASP and in it I have a dynamic repeating table with certain attributes to people. If one of these attributes is old or invalid, i want to change the color of the text (and maybe make it flash, blink, change size, something) so that it's easy to read.

View Replies View Related

Referencing Variables Through Other Variables

I'm not sure how to best describe my problem, so a simple example should help explain things:

I have two arrays, called set1_data and set2_data

if I create a variable like so:

firstPart = "set1"

and then assign like this:

copyOfArray = firstPart & "_data"

how do I make copyOfArray reference the set1_array, as opposed to just a string "set1_array" which is what it's doing?

I've had a good rummage round ye olde Internet but couldn't find anything there must be a keyword or function to achieve this?!?

View Replies View Related

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 View Related

Variable-variable=junk

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

Variable Name, Dependant On The Value Of Another Variable...

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

Dim A Dynamic Name

I want to create textboxes dynamically but with dynamic names also.

i am retrieveing a load of values from a table in SQL into a DataReader.
Then i want to create textboxes from those variables. I want to dim various
textboxes with different names depending on what I retrieve from SQL. I
tried the following:

dim dtrcondet.item("contact_detail_description") as new textbox()

but this does not work

View Replies View Related

Dynamic SSI

I am trying to create a site that has dynamic page generated based on if a value is present.

PROBLEM
I want to be able to show a certain dynamic page if a certain value equals to true. The page should be able to generate values from a db
e.g. <%=aspscript%>

And if the value equals to false, then the page should not appear at all.
I tried using SSI (Server side inlcudes) but cant append variable names to it or use them with if then statements

View Replies View Related

Dynamic IF THEN

I would like to have some text appear in a different color if it matches a result in a database. I am not sure how the syntax would work, this is what I have come up with so far. Not sure how to insert it.

If <%=(Picks.Fields.Item("Pick1").Value)%> = <%=(Results.Fields.Item("Pick1").Value)%> then class="style1"

Is this possible? and if it is does it have to be entered for each occurance of the dynamic text or can it be added to css?

View Replies View Related

Dynamic Css

i want o make the images on my website depending on who is logged in. I have all of the Images names stored into my database, which i have uploaded there using the Pure ASP upload 2.09 add on for dreamweaver, and that all works fine and my image is stored in the correct folder and the name of that image is stored into the database as imagename.gif which is exactly what i want, but i dont know how i need to declare that value from the database into my style sheet. Code:

View Replies View Related

Dynamic CSS

I need to create a bunch of sites with slightly dynamic CSS. Basically,
all the image paths in the CSS need to be dynamic, depending on the
values of certain ASP variables.
I can think of 3 ways to do this:
1. Write a script to create a semi-dynamic CSS file, which will be run
whenever we need to make changes to the ASP variables controlling the
image paths.
2. Have an ASP script generate the CSS on the fly:

<link href="dynamiccss.asp" rel="stylesheet" type="text/css">

3. Put all static CSS in a normal CSS file, and have a special dynamic
style sheet for only those rules that require variability. We could
either use method 2 above to generate a second style sheet, or place
dynamic rules directly in the actual asp pages.

View Replies View Related

Dynamic QS

I have a form element and the name is dynamic

name="<%=cnum%>"

i now need to do this but it's telling me that it needs an to be a string.

JobsToUpdate = Split(request.QueryString(cnum),",")

and what would be ideal is the value of Jobstoupdate will be
This Cnum ->cnum=Split(request.QueryString("staticcnum"),",")

Hopefully I explained it well enough.

View Replies View Related

Dynamic Dim

is there a way to make a dynamic dim, or am i looking at this all wrong

<%
Dim A & request.form("") & B

A & request.form("") & B = Request.form("")

%>

View Replies View Related

Dynamic XML

how to dynamically build an XML document with IIS6 and 404 error custom handler?
At the moment if I dinamically create an XML page with Response.Write(xml code here) I cannot remove header "404 errorpagepath" that IIS adds automatically. How to remove that header from Response object?

View Replies View Related

Dynamic Wml Using Asp

i think my code is correct.but it still can't work when i run in the nokia mobile browser,i had run my wap gateway and internet service server(ISS) also.

can anyone help me to solve this problem? The attaches file is the wml,asp and database for this program.

View Replies View Related

Dynamic Navigation

i want to have a dynamic navigation that will look at a database and then fill the navigation side. I want to have a category, then a sub- category also. Can this be done?

View Replies View Related

Dynamic Link

I would like to build a dynamic link based upon a value returned from a db

There is data in the db because objRS("Description") returns a value.

something like

Code:

if objRS.EOF then
%>
<a href="/somepage.asp?id="<% objRS("Id") %> "><%response.write(objRS("Description"))%></a>
<%
else
end if

I get

http://localhost/somepage.asp?id=

Nothing else at the end.

What am i doing wrong?

View Replies View Related







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