Populate Array From Database
I need to populate an array with two columns of data from a database eg Firstname and second name and sorte alphabetically. So both of these columns go in to one array, I found this code.
View RepliesI need to populate an array with two columns of data from a database eg Firstname and second name and sorte alphabetically. So both of these columns go in to one array, I found this code.
View RepliesI have an array - ListOfFiles - that i want use to populate an combo.
I've attempted to do it like this:
<select name="txtAvailable" rows="4" id="txtAvailable">
<Script Language = "vbscript" Runat = "Server">
For i = 0 to Count -1
Response.Write"<OPTION>" & ListOfFiles(i) & "</OPTION>"
next
</script></select>
I placed the vbscript in the approprate place in the body. But when i
open the page instead of writing the HTML where i placed the code, it
has appended it right at the bottom of the page. Does anyone know
where i'm going wrong or if there's a better way of doing this?
what is code for populating a list menu with data from a database. also the default(first) option in the list should be "ALL".
View Replies View RelatedI have two columns in my microsoft access database.
1st column is company_logo (jpg image)
2nd column is company_name (text)
I want to build a form, a dropdown box which I would populate with the help of a sql statement from my database. The both columns from up there are associated.
When the user clicks on that dropdown box, I need that company_logo and company_name to be shown one beside another. It should list all the companies availible (taken from that sql statement or recordset).
Does anyone knows if this could be done?
Maybe I should stick just with the textual part?
I have the following code that pulls a record based on a form submittal then populates a form with the fields so the record can be updated. My problem is in my query line more than likely in my keyset types and what not. Code:
View Replies View RelatedWe have an ASP site that hits up an Access database of categories of
products and products. (e.g. Categories = Napkins, Tablecloths;
Products = 20x20 Napkins, 21x21 Napkins, 54x54 Tablecloths, 60x60
Tablecloths)
We currently have select boxes that when you select a category, it
populates the next select box with the proper list of products (i.e. I
select Napkins as a category, I get a listing of the Napkins)
We would like to put a clickable link before each of these select
boxes that would pull up a pop up with links from the records from the
proper table.
(e.g. I click the categories link and a popup with html
anchor tags of Napkins and Tablecloths appear) I click on the Napkins
anchor and it populates the Categories Select box with Categories and
Napkins being selected.
I have a database of Company titles that I want to grab from an access
database, put into an asp array and then pass it to javascript so I can
output it into a CSS styled javascript menu. Right now I am stuck on
how to exactly put the database entries into an asp array. Below is
what I have so far.
So I want it to return distinct entries from the
Title field and put it into the array called Titles after the asp code
has done an HTMLEncode to make sure I can also pass it along to another
asp page. Basically I need to know what to put after the Do While NOT
Rs.EOF. Code:
What I need to do is to create a form of a dynamic size, and then save
everything from the form in a database. The number of forms depends on
a number from the database which I know how to get. I need to have a
comment and a number, for example if the number from queried from the
database is 2, then I need 2 forms, and it would be something like so:
Comment: Something
Number: 4
Comment: SomethingElse
Number: 6
When the user clicks the submit button, this would be saved in a
database in a table, in a new row. I have the database created and
inserting works very good when inserting just one row, but I need to
insert more then one row at a time, so it would be something like
this: Code:
I have the following code and nee to know how to make it return all records where sha is equal to any of the values in the array I have defined. Code:
View Replies View Related...selected value of select box.
...a select box.
I have a static array with 10 elements in it. I am trying to create an update form for a mysql database.
I want to get the info from the database to populate the field of the update form. My select box is populated by the array and I want the value that is stored in the database to be the "selected" element in the select box(= to array element). I hope this is making sense. Code:
I have about 26 checkboxes that place all of my contacts into categories so in my database for contacts i have a field called categories that contains all of the categeories that each contact belongs to seperated by a ",". 1,5,17 etc.
I need help getting these values out of the database so that when I user select category 17 they get all of the contacts that containg the 17 in their respective categories field.
I have an array which I want to save into a database table I tried a few things but it doesn't work. This is as far as I got: Code:
View Replies View RelatedI am trying to write an array of random numbers to a database. The array part is working fine, but when I go to update the dataabse, it inserts the last value of the array into all the fields in the database .....
Dim MyValue,sqlRandom
Dim arrayRandom(8)
for i = 1 to 8
Randomize
MyValue = Int((100 * Rnd) + 1)
arrayRandom(i) = MyValue
response.write "<p> Array Value:" & arrayRandom(i)
sqlRandom = "UPDATE CarParkDetails SET FreeSpaces = '" & arrayRandom(i) & "'"
Conn.execute(sqlRandom)
next
I can't see whats wrong!
I have a DB that contains several columns named Line1, Line2, Line3, and Line4. After that I there are 50 columns named Data0 through Data49. Data0 and Data1 will always contain text but Data2 through Data49 may or may not be empty.
I am trying to take the values out of the database and put them into arrays. Since Line1 through Line4 never change I have no problem getting them into one array but I am lost on the logic/syntax on how to not only determine how many Data(n) cells are populated but then how to get them into a new array.
I have this dynamic array(shown below) that I need to match to values (1 - 10) that I am returning from the database via DSN connection object.
The values I need to match are on the same page (in their own table) but I am not sure how to match up the array indexes to these values. I want to be able to display the array result as part of or nested in another table. Code:
I want my asp code(recordset) to populate a table structure like below...How will I do that ? I have the corresponding day(monday,tuesday,etc) stored in my db...This is a weekly schedule for all drivers..A sample db table output would be : Code:
View Replies View RelatedI dump the entire recordset into an array:
If not rs.EOF Then
aEmp = rs.GetRows()
Contents of the array are in this order:
EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName
This query sort on the basis of Lft and Rgt columns.
The name of the array is: aEmp.
My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.
Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.
In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.
Ex.
Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works
Code:
I am running it on IIS, access db, and ASP.
The user selects from several dropdown boxes, on different pages assessing different faults with a particular job. Finally it comes to the last page and displays all the various bits and pieces that have been selected along the way,
THE PROBLEM, ERR CHALLENGE....
It also needs to populate an email link to display the info selected and then which is emailed to an administrator for approval.
And then exported to excel format.
I have a form with a select control called "Last Name" and 1 text box called " First Name". In the select drop-down I have a list of last names pulled from the database. Also the second text box first_name value will be pulled from the database also.
When a user selects a last name from the list I want it to automatically update the first name textbox based on their selection. Ie. The persons first name is put into the textbox.I need to take the values of both(First Name and Last name) and send them to another page
I have an ASP web form that I want to populate fields based on the first
field choice. Example I have 4 fields item, price, delivery, availability. I
have all these items setup in an access table. When a user chooses an option
from the item drop down, the price, delivery, availability will then
populate. I have already made my connection to the database, and created the
drop down for field one from the choices. How do I now populate the
corresponding fields.
Im new to asp and I'm having trouble with listboxes.
I have two listboxes, the first is populated from a database and I need to fill a second listbox with items from the database that are dependant on what was selected in the first list box.
I've been hunting around the forums for ages trying to find a solution to this but no joy so far, hopefully someone can help?
Basically I'm a bit of a newbie to session variables, and was wondering if they are they best thing to use for the following problem I have;
What I want to do is capture a referral ID from a URL i.e. www.mysite.com?ref=1234567 and then store it in a session variable and if the person signs up for a service, it automatically places the referral ID in a text box on the order form.
Does anyone know if this is possible or know of any tutorials? I've had a good look on google, but no joy so far.
I think the key bit is how I capture the ID into a session variable?
I want to populate a dynamic schedule table M-Sunday like this. My db doesnt have a column called monday,tuesday,etc.
I want to create a loop that get the data from access then fill the cells for date and route..Any day may have 2 or more schedule.
I have this code which populates a multiple drop down
getedu=rs("Education")
when i do a response.write getedu the output is
Bachelor, PHD
then i use to select the values in drop down
and its not working any ideas why Code:
Which of the method is used. ? Writing an SQL statement in ASP to populate a recordset OR Calling a stored procedure to return records to populate a recordset. Which of the above two methods is more useful and faster.
View Replies View Relatedi have learned how to populate a webpage with images from a database. however, i would like to go a little deeper:
i would like to create a recordset (in dreamweaver) with a drop-down list of my product lines:
product line A
product line B
etc
etc
this is not a problem. i can do this. however, once the user has selected from the list, i would like the corresponding images to be displayed in the webpage. i am not sure how to go about this. tips for doing this in dreamweaver would be excellent.
I have two form items listbox 1 and textarea 2 and a button. I populate the listbox 1 with a SQL query. i want to add the following functionality:
i choose something from the listbox push the button and then the selected item must appear in the textarea( or listbox ) when i choose a second item from the listbox it must appear beneath the first choosen item etc.
i have already populate a list from my database using the following code . Code:
<form method=post action="ProcessOrder.asp">
<select NAME="TEST">
<% Do while NOT rsHis.EOF
response.write "<OPTION VALUE=' " & rshis("pic_id") & " '> "
response.write rshis("title")
rsHis.MoveNext
loop%>
</select>
But i dont know how to present the results from the combo box.
When the app is ran you get a list of checkboxes to choose from which passes values to crystal reports. All I need to do is change those checkboxs to dropdowns. Can someone give me some assistance here?? Code:
View Replies View RelatedI have created a form that asks the user to select an item within a drop down list, once they have selected the item i would like it to populate one of the other fields with a code depending on which item was selected within the drop down list. How would i do this?
View Replies View RelatedI have a drop down menu that is populated from a database. the problem that I have is that alot of the numbers in the field are duplicated ie the field in question has years in it and may of the years are the same.
is it possible, when there are duplicated years, to populate the dropdown menu only once with that particular year. This would grately shorten the menu for me.
Can one form be set up to populate two or three tables? If so, how?
View Replies View Related