VBasic Text Field (phone Number) Calculating Data Before Inserting Into Access

I have a text field in a web page I am working on that seems to be calculating phone numbers before inserting them into an Access database. i.e., 867-5309 will result as -4442 in the Access text field. My guess is that the webserver or client is processing it before inserting it. Is there any way to stop this other than using a validation script?

View Replies


ADVERTISEMENT

Calculating Totals With Data From Access

I have done a fair amount of coding but very little in the way of maths type stuff

<code>
While Not objRSC.EOF
Response.Write "<tr><td>"
Response.Write objRSc("Item_Quantity") & "</td><td>"
Response.Write objRSc("Stock_item") & "</td><td>"
Response.Write objRSc("Stock_description") & "</td><td>"
Response.Write objRSc("Item_Price") & "</td></tr>"
objRSc.MoveNext
Wend
</code>

What I now want to do is to add all the Item_Prices together, .

View Replies View Related

Inserting Data Into Bit Field In An Sql Database

I have an ASP variable called IRNvar:

If IRNvar(0,num) = "True" then
IRNvar(0,num) = 1
else
IRNvar(0,num) = 0
end if

In my sql database I have a True/False field called VariantFlag which is a bit data type. The IRNvar value is numeric. I am trying to insert the 1 or 0 into the database so that the field shows true or false accordingly but I get a 'Type Mismatch' error. Here's the insert statement:

SQL = "INSERT INTO Documents (CNID, DocumentPrefix, DocCategory, DocumentName, VariantFlag, PartNo, PartDesc, NewIssue, StatusID) VALUES ('" & CNID & "', '" & IRNprefix & "', '" & IRNcat & "', '" & IRNnumber & "', " & IRNvar & ", '" & PartNum & "', '" & IRNDesc(0,num) & "', 'A', '5')"

Is there a way to convert the number to the right data type? Am I doing something wrong? I'm quite new to all this so it's probably something silly.

View Replies View Related

Min Number Validation In Text Field

i know in html you can set a "max" character limit for a form field.I was wondering if it is possible to set a min number of characters?

View Replies View Related

Inserting Dynamic Text Box Data Into A Database

Does anyone know how I can insert daynamic text box data into a SQL Server database? I have text boxes that are being generated dynamically and I want each of those values inserted into the database that hold the results. I'm not sure how to write my loop statement.

View Replies View Related

Phone Number

if someone enters phone number like this:

7209080987

i want to change it to

720-908-0987

but if someone has already entered the phone number in this way 720-908-0987

then dont make any changes

i am running into the problem to check in which way the phone number was entered 720-908-0987 any idea how i can check and make the change.

View Replies View Related

Phone Number

Does anybody know if there is a function in ASP to display a phone number in this format xxx-xxx-xxxx ?

View Replies View Related

Phone Number Lookups...

Our application tracks contact information. One of our clients, a car
dealership, has asked about being able to enter a lastname and phone number
and getting as much of the main form filled out as possible, "Hi, thanks for
stopping by Demaux Motors. Before we get started, can I get your phone
number, please? Oh, HI Joe, you still live on Gingerbread lane..?" etc etc
etc. Filling out the form is easy - sql query, javascript, blah blah blah -
getting the data is another. My question is three-fold:

1: I know that if you go to Google and type a phone number, you'll get a
query result back with address, city, state, etc. The documentation for the
Google APIs are written for .NET...anyone have any experience with those
APIs in classic ASP?

2: Is there some other service that provides this same functionality?

View Replies View Related

Formatting A Phone Number

I've been messing around with this for a while now and can't figure it out. I'm trying to use this code to pull a person's phone number out of a database:

<%
call GetAddrInfo ("BenPhone_v",datavalue)
if datavalue = TRUE then
%>
<%call GetAddrInfo ("BenPhone",datavalue)%>
Phone Number: <%=datavalue%>
<%end if%>

What it returns is an unformatted phone number (ie: 5555555555) Nothing I've tried will format the number. I think the problem is the code that's being used to retrieve data from the database, but I'm not sure: Code:

View Replies View Related

Phone Number Manipulation

I run an eCommerce site and I have a checkout form that requests the customers phone number. I have it set up as one whole field, not broken up: 3,3,4 - too hard to re-work. Therefore a customer is free to enter anything:
(987) 555-1234
9875551234
(9875551234
etc.

I want to format the phone number before it is saved to the database in the following format:
987-555-1234

Basically, I need to strip the number of everything except the numbers and then add a "-" after the 3rd and 6th number?

View Replies View Related

Formatting $'s And Phone Number

I have created an MS-Access DB that holds data items including phone number and currency. Utilzing the input mask function in MS-Access, and using Access to input data, keeps the data looking clean, i.e. $5,678.32 and (555) 555-1234. When I read this information from an ASP page into my repeatable region table (I'm using Dreamweaver btw), the data is displayed as 5678.32 and 5555551234. How can I format the data on my displayed ASP page to be formatted as currency and a proper phone number mask?

View Replies View Related

Formatting A Phone Number

i am trying to format a telephone number (returned from the database as digits, no hyphens) to include hyphens. the database field is set as char with a length of 10. when i run the following code, i get a type mismatch error.

Private Sub formatDN(strTele)

'Changes a Telephone to a recognizable format
if Len(strTele) = 10 then
strFormatted = "(" & mid(strTele,1,3) & ") " & mid(strTele,4,3) & "-" & mid(strTele,7,4)
response.write strFormatted
Else
response.write strTele
End if
End Sub

'section of code that calls the function
HTML = HTML & "" & adoRSWEBtest(0) & " (" & adoRSWEBtest(1) & ") <br>" & formatDN(adoRSWEBtest(2)) & "<br><br>"

View Replies View Related

Formatting Phone Number

I have a database column that contains phone number information, but it has no delimeters (5555555555 instead of 555-555-5555). How can I add them?

View Replies View Related

Inserting Data/time To An Access Db

i have an access db with a "date/time" data type with a format of "Long format";
i want to add the date/time automatically in DB when a user submit a form.

i tried using the
xdate = formatdatetime("var",1)

and putting that var in the DB, but i get an error

can someone show me how to do it right?

View Replies View Related

Inserting Data Using A Form Into Two Access Tables

I have two tables Property & Landlord. I have a form and when it is filled in and submitted the information should be sent to the two tables, but i cant seem to get my head around this problem.

View Replies View Related

Inserting Arabic Data Into Access Database

I am trying to save arabic data from asp and it's not being saved with right encoding. i tried with both code pages 1252 and 1256. each time i am getting different set of characters in db, but not as i am entering in asp page.

when i retrieve arabic data from database and display in web pages it's showing correct text.

i am using following code in asp side: ....

View Replies View Related

Update Phone Field

i have a phone field in one of my tables. the data is pretty ate up. there's some numbers with .,- and extra spaces among other things. how can i do a mass update i would like to have all the phone numbers formated like this 555-555-5555 .

View Replies View Related

Validate A Required Phone Field

I got this so far.But I need the user to be able to enter a space, a () and a dash into the field. ASP Code:

if studentphone="" or not IsNumeric(studentphone) then
        lvValid=0
        lvstudentphone="<font color='#CC0000'>"&lvstudentphone&"</font>"
    end if

View Replies View Related

Send Data From A Combo Box To A Text Field

I use dreamweaver and i have a combobox named country and a text field named email. I want the user choose a country from the combobox and the email for this country go to a text field. Lets say the user choose England from the combobox and an email will be puted in text box. I use PHP or ASP. This is my form:

<td><select name="country" id="country">
<option>1</option>
<option>2</option> </select>

<input name="email" type="text" id="email" value="email for the country in combo box"> </td>

View Replies View Related

Problem Importing Text In Access Memo Field

I'm using asp to retrieve data from a server and import that data in a client that uses MSAccess, into a memo field. The text hes line breaks 0D 0A (the usual DOS line breaks). However the client sees these line breaks as two squares!

The strange thing is that when I look at the exported text (yes, I also export text from the client to the server), it also contains the same line breaks. So the exported text from the memo field can look exactly the same as the imported text, and before the export the line breaks are correctly shown als line breaks, but after the import that same line breaks are shown as squares! I would like to see line breaks after the import and NO squares.

View Replies View Related

Calculating Text Pixels

if there is a way in ASP, to calculate with of a string of text in pixels. The result is to be used to set table width so that texts don't get wrapped to second line.

View Replies View Related

Write Data From A Database Field Into A Text File On The Server

Is there away to write data from a database field into a text file on the server.

The data would be more than one line.....

View Replies View Related

Passing Data In Text Box To Access Db.

i have 2 text box whom data are generated randomly, how can i get this data and pass it to a access database using ASP?

View Replies View Related

Convert Real Number Into Text Number

I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?

View Replies View Related

Inserting A 0 In Front Of A Number

inserting a 0 in front of a number? i dont think i can do it with data type "int" so i changed to "nvarchar" and for some reason upon inserting it still takes the 0 away

inserting - "0600" for example.. only 600 is inserted.. but if i manually input it it works.. errrr

View Replies View Related

Inserting New Field.

How can I insert a new field in a MS Access database table. I've already got the following but I can't get it to work with a default value. Quote:

ALTER TABLE Articles ADD 'Moderated' number

How do I add a default value?

View Replies View Related

Inserting Into A Primary Key Field

I have a field couponID as the primary key in my table - when writing the insert statement how do I get the autonumber value to be inserted? below is the code that I have, but it doesn't work

sql="INSERT INTO coupon (Value, ValueSecondLine, ValidThrough)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("value") & "',"
sql=sql & "'" & Request.Form("validSecondLine") & "',"
sql=sql & "'" & Request.Form("validThrough") & "')"

conn.Execute sql

View Replies View Related

Inserting Value From List Box Into Database Field

My question is this: how do I get a value from a listbox to assign to a variable (elementary I know)? Code:

View Replies View Related

Inserting Text

I have encountered a problem when a user submits text which contains commas and quotation marks.

Code:

Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function

I am currently using the above code, but what i have realised is that i am losing whole text that does not get entered into the database, when i wrap commas and quotes around it.

View Replies View Related

Inserting Text Box Into A Form

I'm trying to create a form that allows me to modify the contents of list. When the user clicks on the modify button, it takes them to a page which displays the quantity of items they purchase, and allows them to update that quantity. So the quantity is shown in a textbox, and the content of the text box is drawn from a rs("content").

But the page is crashing when I run it. I'm having trouble getting the response.write textbox line to work. Here's the code:

response.write "<td align=right><input type="text" name="quantity"
value=" & rs("qty") & "></td>"

This is the line that is causing the page to crash. Can't figure out why. Can someone give me some insight into this?

View Replies View Related

Inserting From Scrolling Text Box

Im trying to text from a scrolling text box into my database but it only inserts the text before return is pressed. Im the field its being entered into is a memo in access.
is there a way to get all the text in the box to be inserted?

View Replies View Related

Inserting Messy Text Into Database?

I'm trying to put some text into the database using ADODB.Command object. Seems like a reasonable thing to do and I can do it. But in this instance my text is an HTML code which contains many quotes. But i have to save it as is into the database field.

I use:

INSERT INTO (f1, f2) VALUES (v1, v2) comand. But since my v2 contains some quotes in it, (many quotes), I get an error. (it works otherwise). Is there any way ?

View Replies View Related

Inserting/publishing Text As Html

I need to populate a field with html formated text. I'm using a simple form field to do so.

When I use a textarea to return the record, it comes out formatted, but when I use a Response.Write command, it comes out as plain text. Anyone can tell me how to make the response.write publish formated text?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved