How can I read back info from a database into an input field (in case it's to be edited) that will preserve the zeros to the right of the decimal?The zeros are being preserved in the access database when I have a look at it there. I have the field defined as type "Currency" to two decimal places.
I want to preserve those zeros to the right of the decimal point when I read the record into an input tag on a web page.I am trying to use "FormatCurrency(request.form(exp, 2))" and "FormatNumber(request.form(exp, 2))" but it doesn't help.
I'm trying to build an array with the ID's of the users I have in a Mysql table called tbl_user. Here is what I coded :
dim listeId(1) i = 0 Set rs=Conn.Execute("SELECT ID from tbl_user ORDER BY Id;") Do While Not rs.EOF if i = 0 then listeId(i)= rs("ID") else REDIM PRESERVE listeId(i+1) listeId(i)= rs("ID") end if i = i + 1 rs.MoveNext Loop rs.close
But I get this error: (0x800A000A) which is something like "fixed or temporary locked array"
Is it correct to think that after reducing the populated array's size from say, 10 to 5 with redim preserve myArray(i) an attempt to access an element above the fifth does not cause a compillation error "array out of script", but returns whatever heppened to be written in that memory address (in particular it might return the correct values of those elements before re-dimentioning)?This seems to be the case in my code, yet I wanted to make sure that this isnot the result of some other side effect.
I am implementing a site where an admin user can log purchases of items into a DB. Obviouslt, one purchase can consist of many items. I am therefore trying to implement a 'Cart' idea wherby the user adds the items to be purchased to the cart and then completes the purchase once all items have been added to the cart.
i aM IMPLEMENTING THE CART FUNCTIONALITY VIA AN asp ARRAY. nOW I CAN Do THIS NO PROBLEM, APART FROM THE FACT THAT, i declare an array of size 10, with 5 attributes to each element. i.e.
Dim purchaseCart(10,4)
The problem is, i want to be able to ensure that if the user decides to purchase more then 10 items, that the array can be ReDimensioned to suit i.e. increase size by one every time another element is added, after it has reached its maximum size!! Code:
I've got the following code which should write the contents of a textarea to a '.txt' file:
Code:
set objFileSystem = server.createobject("Scripting.FileSystemObject") set objFilePlainText = objFileSystem.CreateTextFile(server.mappath("templates/my-text-file.txt"),true)
objFilePlainText.write(strTemplatePlainText)
If I response.write this data before inserting to the txt file, it preserves the line breaks, but when it writes to the txt file it seems to lose all of the line breaks. Does anyone know how to get this to preserve the formatting of the text being inserted?
I have a .asp form page that submits to another .asp page that uses cdonts to send me an email and does a response.redirect back to the form page. I need to preserve (keep) a couple of text box values and a couple of dropdown box values.
At this point I have global.asa variables for the fields in question and they are all set to null. I can't figure out how to put the contents back in the fields, when it returns from the cdonts page. I assume that I must save all the field values in the session variables just prior to the submit to the cdonts page.
show me how to accomplich this for one text field called name and one dropdown box called PUDeliv?
i have found a problem on my webite is when i try to enter details of a new book into the DB, i input the ISBN as its uniqueID, the problem is that if the ISBN starts with a zero, (i.e. 07987654) the DB will remove the zero from the start of the ISBN (i.e. 7977654). Can someone tell me how to force the DB to store the whole number including the zero at the start?
im inserting some data into a number field but when i have something like 0000006 it chops it to 6 in the database. and not always are the same number of zeros present. why im not sure just what i have to work with.
I understand that i could make the db value varchar and just validate it by doing something like Isnumeric. But is there a way to keep my zeros but leave it a number field.
I have a querystring that passes through the value 001 for example, the form on the receiving page need to display that number but with 1 added to it. i have
dim strnum strnum = request.querystring("value") strnum = strnum + 1
when displayed <%=strnum%> shows 2 instead of 002, and the zero's are very important, is there any number formating trick i dont know or another way of doing this?i thought about coding the first two zero's in before i call the strnum but this would mess things up when i get to 010 etc.
I first create an array, store it into a session var then, in other page, I load restore the session var into a local array but, after this, I can't REDIM Preserve.