Numbers And Text Fields
I have a form where you input year (number) and a Ref (number) and a section (char) and then submit to output a record, i added an if with a messageto prevent the eof and bof , and it is working if i inputed wrong numbers, but if i input text in the year or the ref, he will give the following message, how to prevent users from entering text into numbers fields, because in the database they are numbers, or what else could i do.
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/iri_site/Importer/auth.asp, line 27
View Replies
ADVERTISEMENT
I'm using the follwoing code to retrieve some values from an Access database:
<%
Dim PageStr
PageStr=Request.Querystring("PageStr")
SQL="SELECT * FROM images WHERE page = '" & Replace(PageStr, "'", "''") & "'"
set conn = server.createobject("ADODB.Connection")
conn.open "ContentDBase"
set img=conn.execute(SQL)
%>
This works fine. However, I want to change the 'page' field from a string to a number (i want to filter by the primary key rather than the description), but using the existing code I'm told I have a 'type mismatch' or something. I'm guessing I need to modify the code slightly to deal witha number field as opposed to a text field?
View Replies
View Related
I'm creating a record display page but one of the fields I need to display is stored as a number. Each number designates a different name (i.e. text). I know this is totally easy, but I can't figure out how to make the text displayed match the number its associated with.
I can do this easily with a drop-down menu, but I need normal text that can't be edited or anything. In other words, the field is 1, 2, 3, or 4. But it's entered by a drop-down where 1=name1, 2=name2, etc. Now I need to display those numbers in the database as the text they are supposed to be.
View Replies
View Related
i trying to randomize a string of text inc. number and alpha. e.g. 024053J
what is the approach to generate a few integer numbers from this string "024053J" ?
i tried to this way of randomize but not very efficient as in sometimes the user will get the same numbers back when the page is refresh.
So i thought to use a string of text to generate the randomize numbers.
randomize()
num_pmax=100
num_pmin=1
r2=Int((num_pmax-num_pmin+1)*rnd+num_pmin)
View Replies
View Related
I am about to show a text field from SQL7.0 database, but need to display x number of images spread out amongst the text!! Basically similar to how bbc.co.uk/news display news articles....
I am wondering the best way to do this...
I was considering splitting the text into variables and then to display these sections next to the images.
Anyone else done this?
View Replies
View Related
i have a form that has a multiple fields,when a user chooses an option from option seleect then it should disable some part of the form and i have no idea how to do that.
View Replies
View Related
Using ASP,VB Script,Access 2000. I have a macro which imports Fox Pro 2.6 databases into Access on a daily basis and then these tables are uploaded to the website.
When the tables are imported the fields which store numerical values with 2 decimal places are converted to text fields and it drops any zeros after the decimal point (e.g 124.40 becomes 124.4 and 110.00 becomes 100).
I am querying these new tables in my ASP pages but I want to convert these text fields back into numerical values with two decimal places. This is so that product price list on my page is all formatted the same. Is there a function I can use in my SQL statement to achieve this, or will I have to run a macro which re-designs the tables before I upload them to my website?
View Replies
View Related
I have an events calendar on my site, allowing local people to post events there. Two problems have come up:1. In the details section, people will naturally want to include apostrophes (single quotes) from time to time. This fails, because VBScript sees them as delimiters. Is there any form of quote marks I can use to make sure this doesn't happen?
2. The same field is defined in the Access db as Memo, which normally gives up to 64K of text, as opposed to Text, which only allows 255. Despite this, text over 255 is ignored, leading to the text being truncated.
View Replies
View Related
How to create multiple text fields and will be submit when press a "enter key" ...
View Replies
View Related
I have a form that has a drop-down select box which is linked to a database table, and also tow text fields. I would like to show or hide text fields according to the value selected in the select-box without refreshing the page.
If I select TEST from the select box I want to show the RESULT field and hide OTHER field . If I select anything else I want to show the OTHER field and hide RESULT field. I'm interesting code in ASP and PHP.
View Replies
View Related
I have 3 fields in my form and one of them called ID with multiple text fields e.g (there are 10 text fields for ID) and when you submit the form all the 10 ID's should be submitted to the DB for that particular record with a single space inbetween the 10 ID's. Can any one tell me how this is possible.
View Replies
View Related
Is there any way that I can break up text in a text field to spread across multiple fields in an access database? I've got a FAQ section that I want admins to be able to edit via an online interface. Unfortunately, it often doesn't fit into the 255 character restriction that access has. Any ideas?
View Replies
View Related
i want create a form that include many text boxes and an fiel field for upload a file to server but when i add "enctype="multipart/form-data" in the form tag i cant get the texts . how can i do a form working with file upload and text fields.
View Replies
View Related
I am trying to bind/link 2 text fields on my online form.
So they both should show the exact same text entered in them.
When text is entered in one of them I want to see it in the other text box and vice versa and when text is deleted from one of the boxes it should also be deleted from the other one aswell.
View Replies
View Related
I am working on a small application for senior users, so I want to limit the option for incorrect input whatsoever. I have a drop down box that is populated from a query and I want to make it so that when an option is selected, the pertinent text fields are populated based on the selection.
All the info I need is already being extracted from the query so its just a matter of displaying the right info based on the selection. I have been looking for examples of code but they all seem to use javascript. I am not too strong in javascript so I kinda avoided those. if there is a pure asp example, that would be fine!
View Replies
View Related
I have read that there can be a periodic problem when reading large varchar or text fields from SQL server (or memo fields from Access)--they can sometimes come up as empty strings.
What I have been unable to find out is whether this problem is still around in recent versions of MDAC (>= 2.8). Does anyone know whether this problem still occurs--is it still necessary to follow the steps in that aspfaq article?
View Replies
View Related
I'm working on asp project, access 2000 at backend.I can write arabic text and arabic
numbers in textbox and save them in database.but if i see these records, arabic text and arabic numbers,it is ok,if my computer is arabicenable.
If my computer is not arabic enable then it show arabic number into english numbers.
how can i show arabic numbers instead of english numbers if my computer is not arabic
enable.i'm working on a project i have to complete it.How can i convert english numbers that are coming from database and convert that numbers in arabic for show.
I have use
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
I shall be very thankful to you for this purpose.
View Replies
View Related
I have this problem in controlling a the text in a Text Area. How can I do
that for example the field size is 200, when it reaches 50 it automatically
goes to the next line. Bcoz im having problem when viewing it in my report,
it continuesly views in a strieght line and im having problem in printing.
View Replies
View Related
Just started learning ASP about ten minutes ago.
Currently experimenting with forms.
could someone please tell me what is wrong with this code:Code:
<%
Resonse.Write Request.Form("myform") + Request.Form("myform2") & "<br />"
%>
Im trying to get two numbers to add together from a form.
I get this error when i use that code:
Quote: Microsoft VBScript runtime error '800a01a8'
Object required: ''
/Jaynesh/asptest.asp, line 14
View Replies
View Related
how can i check if a variable is an even number
View Replies
View Related
i want to add two numbers in server script with VB script. how to do it.
View Replies
View Related
I Have this form in page1:
<form method="post" action="page2.asp">
<input type="checkbox" name="numb" value="10">
<input type="checkbox" name="numb" value="20">
<input type="checkbox" name="numb" value="30">
<input type="checkbox" name="numb" value="40">
</form>
Now what I want is to add the checked values in page2.
For example :
if checkbox1 and checkbox3 gets checked I want to add the values in the
checkboxes which in this case is 10 + 30 and get the total sum (40).
Hope this makes sense?
So how do I retrive the checked values and then add the checked values
with eachother to get the total?
View Replies
View Related
i need to oredr a set of numbers. the numbers are "06/9","95/1","95/6","06/3" and so on. the thing is that these need to be ordered form the second number, so it shoudl be ordered thus: "95/1","06/3","95/6","06/9". how can i do this? at the moment just as an attempt im splitting the number either side of the "/" like this:
var regNo = "12/09"
var yearStart = 0
var yearEnd = regNo.indexOf("/")
var year = regNo.substring(yearStart, yearEnd)
var itemStart = regNo.indexOf("/") + 1
var itemEnd = regNo.length
var itemNo = regNo.substring(itemStart, itemEnd)
but where do i go form here?
View Replies
View Related
I am converting bites to Megabytes in an operation. How would I trim the result to only go to 2 decimal places?ex:
Response.Write(file.FileName & " (" & (file.Size/1048576) & "Mb)<BR>")
View Replies
View Related
i know how to code it in javascript but failed to do it in asp. there are 12 digits of number. exmple like this 871205106599. i want to check every single digit when user clicks Submit button.
View Replies
View Related
I want to round numbers to include a 0 at the end.
response.write "<td bgcolor=white align=center class=menuText>" & 100 - Round(CTASCAvail,2) & "%</td>"
response.write "<td bgcolor=white align=center class=menuText>" & 100 - Round(Avail,2) & "%</td>"
the following code will round the numbers 2 decimal places but if it is a 0 it will not display it.
View Replies
View Related
how to add two numbers from two different textboxes and display it in the third box.
View Replies
View Related
I believe this is possible using Regular Expressions (which I have never used), but I am unsure of any other way to do it.
Either method would be acceptable for me - I need to learn how to use Regular Expressions some day
How do you ensure that only numbers are entered into an input field.
I need to know this for things like postcodes, phone numbers etc. and a few other things and I've never come across an easy way to do it
View Replies
View Related
Can RSA encrypt a sequence of numbers and letters intermingled together.
I was told that RSA can only encrypt letters,i'm not so sure. So can it bge done
View Replies
View Related
I have 2 textboxes - "from" & "to".
Assume I enter number 1 in "from" and 10 in "to" - I want the ASP to return:
1,2,3,4,5,6,7,8,9,10 and insert this into an Access database over 10 rows
into the 'number' field.
Anyone got any ideas how to do this?
View Replies
View Related
regarding adding or getting sum all of the numbers in the database fields
example of the Fields:
Totay_Payment
10.00
20.00
30.00
40.00
My problem is i cant display the exact SUM of all numbers and it goes like this 10.0020.0030.0040.00 and i want the exact sum like this 100.00
heres the example of my script :
inTotalPayment = rsSumNumber("Total_Payment")
Do While Not rsSumNumber.EOF
intSum = intSum + intTotalPayment
rsSumNumber.MoveNext
Loop
Response.Write(intsum)
View Replies
View Related
I have a problem creating random numbers. I basically have this
Randomize()
iRandom = Int(10 * Rnd + 1)
If I do not wait a few sec before hitting the page again it will create the same random number as generated a few seconds before.Any idea why it is like that? Another way to reprocess the "bug" is to just fit F5 few times in a row and you end up with the same number being generated. Its annoying and I need some help to "fix" it!
View Replies
View Related
I am trying to generate a random number between 1 and 100 into a label, using c#....
View Replies
View Related