Updating Number Field

How would I change the following update statement so that if one of the AreaCode fields was blank, that it passes instead of saying Syntax error in UPDATE statement?

Quote:
sqlString = "UPDATE Installers SET Company='" & Request.Form("company1") & "', [Contact]='" & Request.Form("contact") & "', Phone='" & Request.Form("phone") & "', Fax='" & Request.Form("fax") & "', Email='" & Request.Form("email") & "', Website='" & Request.Form("website") & "', Address='" & Request.Form("address") & "', City='" & Request.Form("city") & "', State='" & Request.Form("state") & "', ZipCode='" & Request.Form("zipcode") & "', Country='" & Request.Form("country") & "', AreaCode=" & Request.Form("areacode1") & ", AreaCode2=" & Request.Form("areacode2") & ", AreaCode3=" & Request.Form("areacode3") & ", AreaCode4=" & Request.Form("areacode4") & ", AreaCode5=" & Request.Form("areacode5") & ", AreaCode6=" & Request.Form("areacode6") & ", AreaCode7=" & Request.Form("areacode7") & " WHERE Company='" & Request.Form("company") & "'"

View Replies


ADVERTISEMENT

Updating A Text Field

I am trying to write some code that inserts or updates a text field in my SQL Server 2000 database. The SQL statement is created using a submit from a form, and the text is coming from a <textarea>, and therefore being placed into the SQL statement via a Request("field"). However, due to limitations in SQL Server 2000 and text fields, I can not use a simple Update or Insert command with text over 8000 bytes.

Does anybody have any sample statements that will help me update that field with larger amounts of data? I have tried using the WRITETEXT function and UPDATETEXT function with little or no success.

View Replies View Related

Updating A Field In A Record

I try to execute the following:

Dim rsCars,mySQL,CAR_ID1,CAR_NAME
set rsCars=Server.CreateObject("ADODB.Recordset")
mySQL="select * from CAR WHERE (ENDING_DATE < Now() AND MAIL_SENT=0) AND CAR_STATUS=0;"
'mySQL="Update CAR SET MAIL_SENT=1 WHERE (ENDING_DATE < Now() AND MAIL_SENT=0) AND CAR_STATUS=0;"
rsCars.CursorType = 2
rsCars.LockType = 3
rsCars.Open mySQL,objConn

'set rsCars = objConn.Execute(mySQL)

But, it doesn't work both ways , and gives the following error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

View Replies View Related

Updating A Text Field

In a form I have one pulldown menu, and one text field. Both MUST get their values from an Access database they connect to. Without submitting the form, how do I change the value appearing in the text field by changing the selection in the pulldown menu? Remember both the text field and the pulldown menu MUST get their values from a database.

View Replies View Related

Updating Time Field

I'm trying to update time field which MSACCESS using query

Sql2 = "Update tblExtraNetUsers SET Lo_date = " & Date()
& ",Lo_time =#" & FormatDateTime(Time(),4) &"# ,Lo_count
= " & rs("Lo_count") + 1 & " WHERE UserLogOn = 'david'"

But its always gives a error message . Operation must use an updateable query.

View Replies View Related

Updating Data In One Field In A Table Into Two Fields In Another

What i am trying to do is Update data in a table with data in another table but i want to update 2 fields in the destination table with data from 1 field in another table.

These are the table i have and their fields:

*CUPFirstRound* - Table1
GameId
GameDate
Home
Away
HomeScore
AwayScore
Winner

There are 8 rows in this table, thereofre the GameID's go from 1 to 8 Code:

View Replies View Related

ASP Field Number Format

It shows the data but not like in the data table (Access). I would like that the numbers have a 2 digit decimal behind the comma i.e.123.456,30 and negative numbers should be in red and in brackets i.e. (123.456,30) So, the format should be:
$#.##0,00;($#.##0,00)[Red] as I have done it in the table - but not in ASP

Where do I have to enter the format in the ASP code? - or - Where do I have to enter the format in the Html code? Is someone able to write me the coding line?

View Replies View Related

Format Number Field L

i need my field that is 10.00 and turn it into this 00001000 any ideas.

View Replies View Related

Auto Number Field

I have one auto number problem in one table in sql server 2000. I'm inserting new record using insert statement and am not giving any value for that field as its auto number.
On the very next statement , I need to know which number it inserted in auto number field for that record??What should be the logic?

View Replies View Related

Delete A Number Field

Using ASP, how would I make a field in an entry 'blank', baring in mind that its a number field. I have tried...

RS.Field("ReviewID") = ""
and
RS.Field("ReviewID") = vbnull

But it doesnt like either of them.

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

Passing Null Value To A Number Field

What's the best way to handle passing a null value to a number field in my Access database? Right now I am getting an INSERT INTO error when I am doing this. I tried doing the following:

Mon = Replace(Request.form("txtNewMon"),"","0") but it doesn't seem to work. Would you suggest doing an IF satement?

View Replies View Related

Convert Filter Field To Number

I am using filter to build a recordset of records using:

Recordset1.filter="sorter >'"&todayDate &"'"

I dont think that the sorter field is a number, so how can I ensure this at this stage?

View Replies View Related

Number Of Fields Per Distinct Field

I have a table [table] with two fields [type] and [ID]. I am trying to create a table with the number of IDs per distinct type. So, the return table would be {distinct [type]}, {count per {distinct [type]}. I am stumped; I believe this must be two queries?

View Replies View Related

Using Wildcards To Search Number Field

I want someone to enter an area code in a field. They would hit search, and it would pull up all records whose phone number starts with that area code entered. Code:

View Replies View Related

Auto Number Field Error

sqlstr ="INSERT INTO BorrowerTab VALUES('" & strName & "','" & strEmail & "','" & strPhone & "')"

These are the 3 fields i wish to insert value.

I cannot do it because there is an auto-number field in my table.

How do i tackle this ?

The error tht i get is query or destination are not the same

View Replies View Related

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 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

Sequential Number After Batch Number

here is the scenerio

in master batch table i have various master batch like
200701-0001
200701-0002
200701-0003

Now each master batch can have multiple final mixed batch like

200701-0001-01
200701-0001-02
200701-0001-03

and this record is inserted in to fmix table.

so i have a form in which i have a dropdown menu in which all the master batch is listed,
i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,

how to achieve this

so in short each master batch will have more than one final mixed batch.

pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.

View Replies View Related

Retrieve The Error Number In VB With Err.Number

I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.

How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?

View Replies View Related

LEFT JOIN On A Date Field And A Numerical Field - Using WHERE Clause

I am using a Relational database for my site and i have the following tables:

FIXTURES, GAMEDATES

the fields in FIXTURES are:

GameDate
Home
Away

(All of the above are numerical fields)

the fields in GAMEDATES are:

DateID(integer)
GameDate(#Date Field#)

What i have done is in the GAMEDATE field in the FIXTURES table i have used the ID number of the date that i wish to assign to that record - using a LEFT JOIN to display the actual date that is pulled from the GAMEDATES table (That which corresponds to the relevant id used in Fixtures)

The problem is that in some of my code i want to display records using sql and sometimes in the where clause i use the following:

WHERE Fixtures.GameDate<=(Date())

obviously meaning WHERE GAMEDATE is LESS THAN or EQUAL to TODAY.

The thing is when i use the join it does not use the where clause and displays all of the records in the FIXTURES table.

Does any one know how to get around this, i have not received any error messages it just isnt displaying the right data

View Replies View Related

Comparing Field Data From Previous Field

Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData

This will work when comparing other fields withing my recordset (so I know the statement works) but it will not work for the field I want to compare. The only difference with this field is that it has null values. Could this be the problem? if so, how do I deal with nulls?

View Replies View Related

Fill Field Based On Another Field

I have a input form with 5 fields. One of the fields is MajorNo and the other is named Description.

I have a reference table in my MS Access database (tblMajor)that lists the major numbers and their descriptions.

I would like to have the description field in my ASP automatically filled based on the major number entered on the form, so the user will only need to input the major number when submitting to the Access table (tblSalesTotal).

View Replies View Related

Pass Hidden Form Field Value To Another Form Field To Insert In Db

I am trying to pass a hidden field value on a form into another field on the
form so that it can then be inserted in the database, to enable me then to
reference that number at a later date.

(The hidden value (1 for example) would then automatically get passed to the
other input field.)

The code for the text field that allows users to type an number into it for
submission to the db is below, but what code do i need within the hidden
field to populate this text field below so that users do not have to type the
number in? Code:

View Replies View Related

How Can I Change One Line Input Field Into Larger Input Field

I have being working with making an edit field over the past few days. The edit function is now working fine. The edit fields that i have are for id, subject, notes, timedate.

All of the edit screens are one line text screens. What I want to do now is increase the size of the notes box to a larger textarea type box to make it easier to edit notes. The notes field in the db is a textarea field. Code:

View Replies View Related

Updating

Well, my script consists in check if the typed code doesn't exist in the DATABASE, but thats not the problem... the problem is that the PAGE1.ASP (that check the code) redirects to the ADD.ASP that will add those codes to the database!

Response.Redirect("add.asp?cod_1=" + cod_1 + "&cod_2=" + cod_2 + "&cod_3=" + cod_3 + "&cod_4=" + cod_4 + "&cod_5=" + cod_5 + "&sexo1=" + sexo1 + "&sexo2=" + sexo2 + "&sexo3=" + sexo3 + "&sexo4=" + sexo4 + "&sexo5=" + sexo5)

That's the line in page1.asp that redirects to the add.asp. So, when the database is completed empty and, the page1.asp checks that there ins't any problem with it and redirect to the add.asp that doesn't update my database!! So, it continues without any record. But, if the database has, at least, one record, the script works normally without any problem!

Another thing that I noticed is that when I, manually, type the adress Http://127.0.0.1/add.asp?cod_1=176096, for example, and the the database is empty, the script does the UPDATE and adds the code to the table!

I have no idea that the problem is. Does any one have a clue?

The goes the add.asp script: ....

View Replies View Related

URL Not Updating

I'm not sure if this is an ASP thing, a IIS thing, or a GoDaddy (where my domain is registerd and forwarded from) thing...

First I'll start by saying I run my own Windows XP web server and do all the coding myself..

I've noticed in the past (and never really gave it much thought, because the site works fine), that when I switch pages within my site, that the URL line is not always updated.

For example, I go into the pictures section, view a few pictures, then select the "Home" tab... The URL will stay with the variables that were passed when I was viewing the pictures. Therefore, if I do a "refresh", the page goes back to the pictures I was previously looking at, not the home page.

I've tried this on multiple computers at multiple sites, and with multiple browsers... And seems to happen rather consistantly...

Anyone have any thoughts?

View Replies View Related

Updating

I am looking at updating a notes part of my data base. I am calling two fields (first name and last) from the data base and putting them into read only text box (as i dont want the details changing). All of this is contained within a form. I am also calling a feild from the database called notes which originally has been inserted using a <textarea> tag. The problem i face is that you cant put values into a <textarea> (ie. i can put data from the database into the value tag of a textbox but <textarea> doesn't have a value tag). Due to this i am putting existing notes onto the page as text. Under this i have do have a <textarea> to put the new notes in.
The problem i have is that i some how need to store the existing data in the notes field and then add it to the new notes that i will be adding. I just don't know how to put the data i am getting from the notes field in the database into a variable.

View Replies View Related

Updating With '

Having problems writing an update script because in one of my fields I'm adding a chunk of HTML that contains ' characters. Obviously this throws up an error. How do I get around this?

View Replies View Related

Updating Db

I'm trying to create and assign variables with the values from my db but can't work out the code getting my " & ' mixed up.

i = 1
do until i = 6 or rsSet.EOF

rBlock(i) = rsSet("rBlock'" & (i) & "'")

i= i + 1
rsSet.MoveNext
loop

View Replies View Related

Updating Db ADO

whats better ADO or SQL
for example, an INSERT statement or an objrecordset.update blah blah?

same with .net

should I C# to update or SQL

View Replies View Related

Updating XML With ASP

I have an XML file which i'm trying to append elements to using an html form and ASP with javascript scripting inside the ASP file. Code:

View Replies View Related

Updating

I have a function below that works fine. It takes a XML dox parses it, etc.

What I need to do is after the update of a record, I need to query the same table again for another record. If it finds this second record, I need to update it.

The problem is I can't get it to work, mostly because I don't completely understand the .open() method. Can I requery and the test for the existance of a returned record - if so how? Code:

View Replies View Related







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