Each three digit number in the string represents a unique ID of a file in a database. Following each ID are six digits, all seperated by a "_" . Each file will ALWAYS have six subsequent integers, such as above ID "234" has "_0_8_22_2_0_3_" following it.
What I am trying to figure out is given a string of any length of this specific pattern, how to decarle a multi dimensional array that would hold each ID and its corresponding digits.
To clarify a little further, this is from a shopping cart for a photographer. Each "ID" represents an image, each of the six corresponding numbers for each ID represents a qty for an image print size, ie., 4 4x6's, 5 5x7s, 0 8x10s, 1 16x20, 23 20x30's, 48 wallets. Oh, and the image ID's are not necessarily always going to be 3 digits, they could be of any lenght integer...
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:
how can we declare a dynamic array in asp.say i have a counter name COUNT.how to i declare an array of size COUNT.its not DIM array(COUNT) cos it will give me a error.how is it done?
I intend to have a dynamic array of non fixed size
set rsseats = conn.execute("select * from seats") Dim arr(1) response.write ubound(arr) do while not rsseats.eof ReDim arr(ubound(arr)+1) rsseats.movenext loop set rsseats = nothing
But i will get hit with "The array is fixed or temp locked" how should i fix that
Does anyone know how to create a dynamic array? I need assign the values from database to the array one by one. I did a search and I can only find some complicated dynamicarray class. I am not to ASP and I have used other programming language. I thought a dynamic array shouldn't be that complicated.
I've probably done this before, but for the life of me I can't remember how I did it. I need to move values from a DB table into an array to be used for other queries. The number of records will vary, so I need to make the array dynamic. Can someone remind me how I can increment the index when I write a new record? Code:
the arguments "theArray" works fine in my function.
If I build my array with a for next my function (guessing) sees my argument as a string. I have printed out both values and they are exactly the same in appearance.
does ASP have arrays, and if so, can I use an array, inside a loop, to do the following.
x=field name *the field is now comma separated values* while x != rs.EOF take each part of x , put into array. filter recordsetABC with current part of X. display filtered recordset on screen. next x
My syntax is horrible, so ignore that, this is just a theory exercise right now.
I want to convert the binary data to string. I tried doing the same using following peace of code.
Function SimpleBinaryToString(Binary) Dim I, S For I = 1 To LenB(Binary) S = S & Chr(AscB(MidB(Binary, I, 1))) Next SimpleBinaryToString = S End Function
It works fine when the data is English. But when the binary data contains some Japanese characters the resultant string gets corrupted.
In an application I'm working the user has the opportunity to record the despatching of one or more items with serial numbers.
For each item they despatch, they have to chose the serial no that they want to despatch from a list of available ones. In many cases, these items will be of the same time, so the dropdown of available serial no's may be the same. Code:
I've never been able to get my head round arrays, and despite expensive googling I can't work out how to sort this problem:
I have a simple shopping cart that attaches a stock ID number and a quantity to a session variable. Each item selected is added to the session("cart") as "ID.Quantity" and divided by a comma. Thus the string is "12.7,3.45,8.9" etc.
Can anyone show me how to turn this into a two dimensional array, so I can get the relevant records for each ID from my database and match it to the number requested? Splitting the string by comma and then by full-stop has beaten me.
I'm using Msxml2.ServerXMLHTTP.3.0 to fetch a HTML page on a remote server. The fetched page is then parsed and the information of interest is extracted and send to the client browser.
However, the remote server does not specify any character coding in its headers. If using ResponseText property in ServerXMLHTTP, some international characters are not decoded correctly. This is due to ResponseText assuming UTF-8 coding if no character set is specified.
My solution is to use the ResponseBody property which returns the web page as an array of unsigned bytes. I then convert the data to a string using the ADODB.Stream method as described here: http://www.motobit.com/tips/detpg_binarytostring/
The string is then parsed and the required information is pulled out.
This solution works just fine but I wonder if there is some more efficient (without the need for a byte to string converion) way to solve the problem.
.... set con=Server.CreateObject("adodb.connection") set rs=Server.CreateObject("adodb.recordset")
SqlExp = "SELECT * FROM content" rs.Open SqlExp,con,3,3
Response.Write rs("PageName") ....
now, sure it works nice with only one row, but if i have several row in my Table, my guess i need to put data into an array?so, how do i put my fields into an array and display them?
can i put my operators into an arry, as i want to loop them later in a loop. but i have problem declearing the data type of the arrys.
Dim operatorsArray(4) As ????? operatorsArray(0) = "+" operatorsArray(1) = "-" operatorsArray(2) = "*" operatorsArray(3) = "/"
what should the data type be to work. can i have an example of how i am going to use it.can it be done this way eg. 2 operatorsArray(0) 3 operatorsArray(0) 4 operatorsArray(0)does the above interperate as 2 + 3 + 4?
I have a page where a user can edit the meta tags for the page which are then written dynamically at the time of the page being redendered.
I was wondering today whether this actually works or not? ie, if a search engine (google or whatever) is trawling a site, does it only read html pages? What happens when it encounters an .asp? Surely it wouldn't execute it and therefore be able to read the meta data correctly?
Any info on this would be appreciated, if my current way of doing it is not appropriate I will need to invest some time into changing it.
Im declaring an array, store some values in it and then I save the array in a session variable. On an other page I store the data of the session in a new multiple dimension array.
All data are saved correctly in the array of the 1st page. But in the new array of the 2nd page there is only one entry. Does anybody knows why??? Here the code example Code:
I've created a page that has a dropdown listbox with values derived from a recordset. That is working fine. What I want to do is take a value selected from the dropdown listbox and pass it to another page that is pulling a report based on the parameter I'm selecting in the dropdown listbox.
I'm able to do this with a textbox being used to accept the parameter, but I want the client to select from a list of actual values, which will then "filter" their report.
I am trying to generate an email from the webpage using code below, which works fine. However I want to be able to include some dyanmic data how do I go about it ?can anybody point me in the direction of some sample code ?
Dim myMail Dim HTML Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">" HTML = HTML & "<html>" HTML = HTML & "<head>" HTML = HTML & "<meta http-equiv=""Content-Type""" HTML = HTML & "content=""text/html; charset=iso-8859-1"">" HTML = HTML & "<meta name=""GENERATOR""" HTML = HTML & " content=""Microsoft Visual Studio 6.0"">" HTML = HTML & "<title>HTMLMail</title>" HTML = HTML & "</head>" HTML = HTML & "<body bgcolor=""FFFFFF"">" HTML = HTML & "<IMG SRC=""http://www.microsoft.com/library/" HTML = HTML & "images/gifs/homepage/microsoft.gif"" BORDER=0 " HTML = HTML & "WIDTH=167 HEIGHT=36 ALT=""Microsoft Corporation"">" HTML = HTML & "<p><font size =""3"" face=""Arial""><strong>" HTML = HTML & "Microsoft Exchange CDONTS Example</strong></p>" HTML = HTML & "<p><font size =""2"" face=""Tahoma"">" HTML = HTML & "CDO for NTS allows an easy way to send mail.<br>" HTML = HTML & "This example shows how the content can be " HTML = HTML & "an HTML page<br>" HTML = HTML & "which allows you to send rich text and" HTML = HTML & "inline graphics.</p>" HTML = HTML & "</body>" HTML = HTML & "</html>"
myMail.From="someone@microsoft.com" myMail.To="someone@microsoft.com" myMail.Subject="Sample CDONTS HTML Message" myMail.BodyFormat=0 myMail.MailFormat=0 myMail.Body=HTML myMail.Send set mymail=nothing Response.Write "Message Sent" %> </HEAD> <BODY> </BODY> </HTML>
I have a Dynamic product page that displays the items using "DO UNTIL rs.EOF" and I have assigned form input type to be hidden(for some) for information that I would like to retrieve. On the product page I have a "Add to Cart" button which points to my "addCart.asp".
addCart.asp is where I would insert the items into a Table called "cartItems" in the Database when the user clicks on the "Add to Cart" button.
My "addCart.asp" now generates a "Syntax error in INSERT INTO statement." which I think is caused by my inability to filter for the values from the product page and insert it into the "cartItems" table. Code:
Basically I want the text in the iframe to change depending on the pid value. (pageID), I have all this set-up previously in my functions page. Except the only way I can see any action is by running the iframe directly and passing the querystring like iframe/iframe.asp?pid=4 and this works fine, but in my main window index.asp it does not change.
I have an idea that when i type index.asp?pid=3 its trying to get the querystringbased on the index.asp not the iframe.asp, so does anyone know how I connect these two up so that my content will change in the iframe held within the index.asp page.
I am am trying to write some code to perform a INSERT in SQL table using a loop. What would be great is a way of dynamically entering in data in a requaest.form ie the final code should look something like:
if Request.Form("type1") = "1" then
where the 1 in "type1" is dynamic so the code would look something like
Request.Form("type" & Rs.("fld_type_id") & ") = "1" then
But not sure how to form this or whether it would work, anyone have any idea?