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 am trying to run a asp sql query containging many tables. the main table though is a simple ID based table contains all ids from the other tables. Code:
I have written an ASP script that collects information from a form. The info is stored in one variable name. When I request the info, it is returned as a comma delimited string. How can I manipulate this string so the data can be stored in a database? I appreciate your assistance.
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.
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 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'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.
Is there a way to turn off the auto fill.. I have page that a user has to enter their logon and password. I do not want the auto fill to save userid/pswd. Can this be turned off or not displayed while typing?
I am trying to turn a page I have in coldfusion into ASP using VBscript. There are some functions in coldfusion that I can't find comparable functions in vbscript. Code:
I am runnig a Oracle procedure(this inserts records in table)with asp.command object.I dont want to commit the inserts, I want to turn auto-commit off when I execute this procedure.Can this be done in ASP,if so,can some one give me a example.
I've been given an ASP site built, tested and working on IIS 5.1 to be hosted on IIS 6. I've gone through the process of enabling ASP, parent paths, and debugging in the IIS Management console. My first ASP works as expected, however, a link to a second gives me the error:
HTTP 500 - Internal server error
This is not a lot to go on, so my question is can i turn on debugging/error messages to give me more of a starter?
if there is a quick way of converting a string into an actual variable.The reason I ask this is to save me having to type each variable name out when trying to request the values from a form.
If Trim(Request.QueryString("id")) <> "" Then myarray = split(id," ") whereclause=" id = " & myarray(0) for counter=1 to ubound(myarray) whereclause = whereclause & " OR id = " & myarray(counter) next SQL = SQL & whereclause iCounter = iCounter + 1 End If It gives this error: [quote] SELECT * FROM bible WHERE id = 1, OR id = 2
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (comma) in query expression 'id = 1, OR id = 2'. [QUOTE]
I am trying to post some data from the database to an XML file. Everything works except for a stray comma that comes from the database and exists at the end of the address string. For example, "123 Anywhere Street,"
I would like to kill that comma that will always exist at the end of the address string.
I have a string that can be "700,00" or "700" or "700,56". How can I obtain the content that is present after the comma, (as the examples, 00 , , 56. in a var?
I have an Email List where it shows all emails sperated by a comma and space. I want to insert a CHR(10) after each comma to make the list easier to read (in a textbox). How can I do it?
I was wanting to know how to take the following code and use it to update multiple fields "sel" is a value set from a table field onto a checkbox. It returns a 3 digit number if submitted with only one check.
but if I submit multiple check, of course, it submits multiple 3 digit numbers seperated by a comma. I just need to know how to do a for(i) statement or a loop or whatever so that I can update multiple fields.
<% If Request("Movebutton") <> "" then
Updsel = Request.Form("sel") Upddate = Request.Form("Start_Date") If Request.Form("End_Date") = "" then Updenddate = Request.Form("Start_Date") Else Updenddate = Request.Form("End_Date") End If
This may not be possible on the server side, so apologies if this is the wrong group for this post.My form consists of an unknown number of pairs of text boxes. They are named textbox_a and textbox_b. I then split the comma separated list that gets posted:
textbox_a = split(Request.Form("textbox_a"),",") for i = ubound(textbox_a) ...insert into db
then do the same for textbox_b
If anyone puts a comma into one of the text boxes, this will result in unmatched pairs. How can I deal with the comma, or prevent it?
What's the easiest way to generate CSV or a comma delimited file from an ASP recordset? I've seen a few searching the internet and they appear to be overkill or out of date.
Whenever I import a comma delimited file the field lengths are always 255. I tried an import specification in my code but they were stll 255 in length. I imported about 156 fields and about 140 came in at 255. Not gonna work.
I have a post-form that holds a listbox with mulitple selected items. When the form is posted to the server ASP file, I want to loop through the selected items, to insert each of them into a table. How do I do that? If I execute the line: Response.Write(Request.Form("ListBox")), I get the list of selected values, separated by commas.