Working With Arrays Retrieve All Rows
how can i retrieve all the rows from the recordset? can anyone give me a sample code on how to check all the checkbox from the generated from my loop statement?
View Replieshow can i retrieve all the rows from the recordset? can anyone give me a sample code on how to check all the checkbox from the generated from my loop statement?
View RepliesBasically, I want to have 1 large array, that could have any number of items... and if any of these items happen to be an array themselves, display the contents of the inner array. Code:
View Replies View RelatedI have an ActiveX DLL that's being accessed by ASP.
I call one function which, in the DLL, returns a string array.
Public Function ProcessCookie(url As String, cookies As String) As String()
...
End Function
<%@ Language=VBScript %>
<%Option Explicit%>
<%
dim myObj
dim cookies
dim retCookies
dim i
set myObj = Server.CreateObject("MyObj.Processor")
cookies = "a=1001;"
retCookies = myObj.ProcessCookie("http://localhost/test.asp", cstr(cookies))
set myObj = nothing
Response.Write cstr(retCookies(0))
'for i = 0 to ubound(retCookies)
'Response.Write cstr(retCookies(i)) + "<BR>"
'next
%>
The 'retCookies' returns with 2 elements in the array (doing a ubound on it returns 1, so 0 and 1 are there), however, when I try to display the content, it gives me a type mismatch even though a cstr is around it.
Also, "IsArray(retCookies)" returns true, so the array is definitely coming back from the function properly.
If I copy the ASP code into a VB form (ONLY changing Server.CreateObject to just CreateObject and Response.Write to Debug.Print), everything runs just fine.
Does any one know a good site where I can go to learn how to let the user determine how many rows they want to display?
View Replies View RelatedI have trouble working with arrays in asp.. I have the following error :Microsoft VBScript runtime (0x800A0009)
Subscript out of range: '[number: 0]'
the line that gives me the error is the following:
Door_OpeningValH= aDoor_OpeningVal(0)
and my code is this:
Door_OpeningVal= rs("Door_Open_Dimension")
aDoor_OpeningVal = split(Door_OpeningVal, "x", -1, 1)
Door_OpeningValH = aDoor_OpeningVal(0)
aDoor_OpeningValW = split(aDoor_OpeningVal(1)," ",-1,1)
Door_OpeningValW = aDoor_OpeningValW(0)
Door_OpeningValUnit = aDoor_OpeningValW(1)
what i'm doing is recivieng values from 2 textboxes and a combo box.I want it to save in my database like this:
2x5 ft
I need to create a multidimensional array using another int as one of the criteria but I keep getting probs with my code, what am I doing wrong?
Code:
intMonthName = Cint(Month(field_in_my_database))
Dim myarray(intMonthName,2,5)
I get this error message:
Quote: Microsoft VBScript compilation error '800a0402'
Expected integer constant
I am using ASP with VBScript and I want to know how to seperate a 2 dimensional array into 1 Dimensional arrays:
like if
MyArray is a 2 D array and I want to store the first row of this array in another array , like in C
MyArray[5][5] //this is a 2D array
OneDimArray=MyArray[0] // stores the first row of the 2D array in OneDimArray
is there a way to do it in VBScript ????
I couldn't find a way
I don't want to do it with loops I hate code with too much loops,
How can display unique values from an array. I dont want to loop thru all the values and do it. Is there a better way?.
View Replies View RelatedWhat does the numeral '1' mean in the following statement?
For J = 0 to UBound(QArray, 1)
I have an array in ASP and I am populating the array with the values from database on checking a condition. Lets say i have array of arr(5). Initially I made all the array items null ...
View Replies View RelatedI have an array in ASP called WordsArray() which contains several words. What I would like to do is search the array for a word, and if its not there, add it to another array ResultsArray()
So far, a loop in my code only checks the current array value, and not the rest of the array, adding the search word to the end of the resultsArray regardless.
In the table MYSQL I have this sequence of rows:
CODE===========NAME
610=============ASSI
610=============ASSI
610=============ASSI
610=============ASSI
619=============ASSI-9
619=============ASSI-9
619=============ASSI-9
I like to see:
ASSI
and query that counts for all rows like ASSI ...
My idea is to have a web form that a user can add extra fields if needed.
Example would be a form that a user would add ComputerName, IP, and at least
one row of data say Application, Vendor, Contact. Then they need to add two
more rows of the same data (App,Ven,Cont). So I guess some sort of
dynamically adding more fields for more data entry. The point being you
don't have an idea how may there really are to add. Then on the database
side I would guess one table to hold the IdentNumber,ComputerName, IP and
another table for the IdentNumber, App,Ven,Cont.
I have a database used by another application, i want to be able to manipulate the data stored in the database, the problem is that the way the information is stored its awkward(assume this is purposely so), but i cannot change the db structure at all, so heres my problem: Each Person in this database will have multiple comments stored against them:
ID | CommentCode | LineNum | ValueData
1234 COMM1 1 Something about thi
1234 COMM1 2 s person seperated ov
1234 COMM1 3 er multiple lines
1234 COMM2 1 Something else about
1234 COMM2 2 them
What i want to do is circle through the recordset and combine the multiple lines of the same comment, any ideas/examples?
When I do a query that I know has 2 rows, I get rs.recordcount equals -1. Same thing when it's just one row. I need something that gives me the number of rows.
View Replies View RelatedI was wondering if anybody could advise me how to return just 100 rows from a database query. In Cold Fusion I'd use the maxrows function, but not sure how to do in ASP (or can I do it in just SQL?). My code is thus :
' Retrieve last 100 records. Query then run through the query building a string
Set objRetrieve = objConn.Execute("SELECT Players_ID, Players_Name, Players_Score FROM Players ORDER BY Players_Score DESC")
We've been asked to upgrade the system and one of the common complaints is that they often have to edit just one field, but for all the students. Currently you have a list of students and you have to click each one and go to their summary page before you can edit anything.
So they've asked if there is there any way of creating a 'spreadsheet like' view of my data and allowing the user to edit and either save everything, or save each row as they go (without causing a page refresh).
I managed to get a basic idea up and running, involving lots of wee forms or one big form... but my ASP ended up creating 266 SQL queries to do the saving (one for each pupil) ... and the script would just take forever. Code:
Does anyone know how to make a table row flash in a certain colour,
depending on a DB value?
I have a helpdesk application listing statuses of Agents and the calls
queued on the system.
When a call is queued, I wish to make that Agent's Table row, flash.
Or even a cell flash.
Any ideas?
For example:
If I had a table with the headings
ID Colour Car
1 Blue Volvo
2 Red Fiesta
3 Green Mondeo
4 Red Volvo
5 Red Fiesta
6 Blue Fiesta
How could I use asp to count how many times say the colour red appeared in the table displayed in a numeric value, i.e There are 4 red cars in the able
i know that in sql you can output the amount of rows with COUNT(col_name), but what asp do i need to output this
View Replies View RelatedI have a list of data in a database(access). How can I get the total rows in the database?
View Replies View RelatedI have a column called state with 50 rows as 50 US states. I want to display the rows as one string like TX, NY,How can I do this easily?
View Replies View RelatedIs the following assumption correct?If I setup an array with 5 rows and 8 columns.
Private invoiceItemsArray
ReDim invoiceItemsArray(4,7)
Am I stuffed if I want to add a fifth row? From what I've read I will only be able to add more columns in this instance.Is this correct? And if so is there a work-a-round. Would I need to create a new array with one extra row, use the old one to populate it and then add my new row data?
When I try to sort rows of records in asp with sql I cant get them coming out right. The column I'm trying to sort has record values such as 63, 254, 98, 7 but when I try to sort them ascending I get 254, 63, 7, 98 but I want 7, 63, 98, 254. Please help because its been annoying me for ages.
View Replies View RelatedI have a Javascript function which dynamically generates rows containing a List box having fixed options. Whenever i add a new row through my function the previously selected values in List box are not getting retained. This works fine in IE6 but not in FireFox 1.0 PR. This feature i am implementing using ASP and Javascript.
View Replies View RelatedHow can I determine the number of rows in a recordset? myRecordSet.Fields.Count returns only 1?
View Replies View RelatedIs it possible in a ASP page when querying a table to only pull out the rows with data in, and not display the rows with null values?
View Replies View RelatedI want a way to be able to add up to 99 new items into a table. I've search around but haven't found much. I think I am using the wrong word or function?
Entry page would look like:
1. var1, var2, var3,... var10
2. var1, var2, var3,... var10
3. var1, var2, var3,... var10
4. var1, var2, var3,... var10
5. var1, var2, var3,... var10
99. var1, var2, var3,... var10
I can't do a "INSERT INTO table_blah Values()" . Should I look towards an Array? I suck at those.
adoRS.Open "select * from table_name"
numField = adoRS.Fields.Count
response.write("Number of Filed of table_name = "&numFiled)
how will i know how many rows are there in table_name? is there a
numRows = adoRS.Rows.Count
any help with this?
In the code below I have the problem that I get an error if rstal("talent") doesn't exist for that record. What I want to modify is that if in the record rstal("talent") is in bof or eof or doesnt exist then just show image add.jpg. Code:
View Replies View RelatedHow to delete an empty row in an multi dimenssional array? For example,
Array(1,?) LIT-361 1 3
Array(2,?)
Array(3,?)
Array(4,?) LIT-332 10 30
I want to delete row 2 and 3. How do I do it?
I've made a form on a php page, where one of the fields is automatically filled in dynamically from the page it is referred from. That part is working find, it pulls up the product model number from the page it is referred from. Now, when it is submitted it runs an asp script to send a confirmation email to them, then sends an email to me with the information collected from the form. That still works as well. So, finally, here is my problem and question:
I cannot get the variable that the form pulls up automatically using php, to be passed into the asp script and sent through the email. All other variables work.
Is that because the script that is used to send the email is asp - yeet the variable is pulled from php? I would think because it puts a dynamic figure, and submits it, that it would becomes static. I'm not sure what the issue is here.
Visually, the page will look somewhat like a spreadsheet. It could have
hundreds of records (rows) displayed. I want to enable the user to edit any
one or any number of records and any fields, then click a save button to
UPDATE the SQL table. I'd like to use stored procedures if possible. How is
this done? Where do I start?