Can Not Update A Record If There Is A ' In The Text Field
i'm trying to figure out why i can not update a record if in the text box there is a ' anywhere in the field..
View Repliesi'm trying to figure out why i can not update a record if in the text box there is a ' anywhere in the field..
View Repliesi just wanna know how to be able to update certain fields without touching the others
for example if the form has 3 fields
description, name and age....
if i wanted to update the database from these fields, but only update the description while leaving the ohters as they are, which means blank fields in form...
now if i do that on my form, it will clear other 2 fields in the database and only update the description... how can i fix that so that when there's blank fields in form in won't clear the data in database ?
This is probably a easy answer for you guys. Just trying to find the easiest way to do this. I want to click on a link and update a field in a recordset, but don't want
to leave the current page.
HrngID is the link. I want to change the Canceled field from a 1 to 0 when clicking on the link . I know I can use a onclick event, but not sure if these is an easier way. Can I do like a onclick and run a SQL statement on one line?
I am using Windows XP profesional and Access 2000 but are experiencing
problems updating or adding new records to my database with asp.
I have installed IIS 5.1 on my computer but also on my internet site I am
having problems to add a new rec. or update one.
The error message is something like:
< Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
query. >
I get this message on my web site as well as when I try some new tests, with
other databases, on my local PC's IIS. Does anybody know what is wrong? It
used to work okay earlier on my web site?
i can add the record in first table but cant get it to do with the second one one of the field in the first table the "mktid" which is the primary and is a forgeiner key in the second table how can i have it insert or update in the second one Code:
View Replies View Relatedadd/update a record in first table and 2nd i can add the record in first table but cant get it to do with the second one
one of the field in the first table the "mktid" which is the primary and is a forgeiner key in the second table how can i have it insert or update in the second one
addnew.html
Code:
I have a table in the db and one field in the db is an email field various records can have the same email address in. When an email address changes from x to y I want to be able to change an email address x in every record in the table to y, how would I do this?
View Replies View RelatedASP VB. I have 1 recordset where I pull the order in.
I have another that I pull in the on-hand qty.
I used a repeat region and now I have it working to display the new on-hand qty. Now I just need to update the recordset with the qty on hand.
ok im trying to update a record.. i have my edit form working (i think) and now im just making the code to update that record..
im gettin this error tho
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. Code:
I have to compare 2 tables: orderA and orderB, if the record exists in both table orderB and orderA, just do a update to the quantity field in orderB (add orderA.quantity to orderB.quantity). Otherwise a new record has to be insert into orderB.
Do I have to loop through the recordset of orderB, then use select statement to see whether the record exists in orderA or not, and determine whether to update/insert record? I am using Access database. I just afraid that looping through each record in recordset (maybe >=30 record each time) would make the transaction getting slow (or even hang??). Can I do this in one SQL statement?
I have a .asp page that displays an HTML page: view_msg.asp
There is a link (anchor tag) on that page that when clicked, sends the user to another page. I would like to also execute a MySQL query when that link is clicked. The DB is already open and connected to the page. The current current tag looks like this:
<a href="view_messages.asp"><IMG SRC="example.gif"></a>
and the MySql command I want to send is:
UPDATE Messages SET `fromDisplay`="N" WHERE idMessage=" & idMsg "
In english: When someone clicks on the link I want to execute a MySQL command to set the field value to N... how do I do that?
I know this is a very rookie question - but I don't know enough about asp to know how to execute the command here the way I want. Do I have to turn the image/button into a <FORM> 'submit' button</FORM> and use a redirect? Or, would I use an ONLCKICK. What would the correct syntax be?
I'm new to ASP so I'm using DWMX as a crutch. It created the db connection and recordset code for me and all I want to do is have the page update the db with the result of a variable.
In plain English, I'm trying to update a field called Score in the table quizOne with the results of the variable score where the username field matches the session variable MM_Username. The recordset is called update_score.
Based on other tutorials and forums, I tried this: ....
how to Update Record On Page Load. I have one feild in my database that I want to subtract 1 from each time the page is loaded.
View Replies View RelatedI have a form on a website for logged-in customers to update their contact details, when the customer update their contact details it should update the record in the database and at the same time the updated contact details should be sent to me by email.
I'm not an expert in ASP 3.0 and therefor I'm using dreamweaver 8 to create asp pages(ASP 3.0 VB), but dreamweaver does not have such kind of fuction(server behavior) to do this and so I have to create this by hand.
Now I already have page with the form that updates the record in the database, and I also have another page that does the mailing(CDONTS), first it updates the record in the database and in dreamweaver I have set "after insert the record go to mail_processing.asp" , but this does not work.
I can only get one to work, either only update the record or only mail the form data.
How can I make it to update and mail at the same time?
I have made several Access-based CMSs but now I am using SQL Server. I can read the records but my first attempts at writing are resulting in new records (with new ID) but all the fields are null.
I am posting the data from a form to the same page and an if /then statement catches the flag in the URL and runs the update script below. All the field names are correct. Code:
I need to alter a dremweaver Update Record function but am a bit lost with it. I basically need to take the values from 3 drop downs that let you selct the date (day, month year). I've written a variavble that adds these together to make a date:
JJ_theDate = Request.Form(selectDay) & "-" & Request.Form(selectMonth) & "-" & Request.Form(selectYear)
but have no idea how/where to slot this in with Dreamwevers code (below) that does the SQL update.. Code:
this is a problem that is cropping up for the other developer here and i can't seem to find anything wrong. this code has worked for months and then the last couple of days it started sporadically not working. i'm thinking that it has to do with a performance issue but i'm not sure.
i don't use the ado .addnew or .update, so i'm a bit unfamiliar with the workings of it. here is a brief overview of the code.
ordRs.AddNew
... do the field updates
ordRs.Update
order = cint(ordRS.fields("order_id")
the problem is that order sometimes ends up as null, it's not getting the order_id field after the update. like is said, it's sporadic. anyone have any thoughts here?
ive got a table filled by a recordset with a column named "STATUS"
each record is a sale transaction. the status of this transaction is either open or closed. right now the table displays whats in the database as is, but i want to add the functionality to be able to close a transaction from the table.
i was thinking of 2 methods, one would be a check to see if the field = open, and if it is, make that field a link to a small popup that verifies the user wants to close the transaction then does its lil sql thing aand updates the table.
the other way i was thinking was to check if its open and make it a drop down list that will update table when submitted.
im veering more toward the former idea(not a fan of drop downs)
I have a list of names and a box with the age like this:
Name [20]
Name [26]
Name [15]
So i have his code:
I have a main window which shows all records from a table. When a user clicks on "Edit" for a record, a popup showing information of the selected record is displayed.
The user then changes the information on the popup and clicks "OK" button which calls an ASP page to update that record in the table. Everything works with no problem up to this stage.
My problem start after the update process. I need to know how to close the popup and then refresh the main window showing the updated information....
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.
Why is it that this does not work in MySql?
RS.Fields("Fullname").value = "Bob"
Is it because MySql does not support this?
The code below is a bit more representative of what I'm doing:
<!--#INCLUDE FILE="Database_Open.asp"-->
<%
sql ="SELECT * FROM CustomerBase WHERE " & _
"UserName='" & username & "' AND " & _
"SECRETWORD='" & password & "' "
RS.Open Sql, Connection, 3
IF RS.EOF THEN
'redirect code here
ELSE
RS.Fields("Fullname").value = "Bob"
RS.Update
%><!--#INCLUDE FILE="Database_Close.asp"--><%
Response.Redirect ("Menu_Account.asp")
END IF
%>
I'm having a spot of trouble trying to update fields in a access database using asp. I can delete and add fields thru the asp page but when i attempt to modify the fields i get a page not found error message. Code:
View Replies View Relatedi 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 RelatedI have a asp form that has a dynamic drop-down box that a user selects a value from. Once the user makes a selection I use the onChange event to capture the selection and pass this value to a vbscript sub.
The sub then makes a adsi query using this value to retrieve additional information. This all works. I used a msgbox to display the retrieved value and it is correct. My problem is how do I update a field on the form with this retrieved value?
Say I have a field containig some text, for example: The quick brown fox jumped over the fence. How do I only show the first 4 words of the sentance, i.e: The quick brown fox...
View Replies View RelatedI'm trying to delete some record information but only a set number of fields. when i run the following, it deletes all the record and not the field information in the given records:
set rs = server.CreateObject ("adodb.recordset")
StrSql = "DELETE field4, field5, field6," _
& " field7, field8, field9" _
& " FROM tblStock" _
& " WHERE field1 ='" & Request("loc") & "'" _
& " AND field2 ='" & Request("pdt") & "'" _
& " AND NumberOut =" & Request(" numberout")
'DEBUG ONLY
'Response.Write StrSql & "<br>"
'Response.End
cn.Execute StrSql
My products table has a weight field that I need to populate. A bunch of them have it and a bunch of them don't, but I need them all to have one. The weight is the same, 3, for all the records. I also have an Include field in that table. I want to make the weight field 3 for all records where the include field is true (it's a yes/no checkbox in access.)
I'm using Dreamweaver and I can build the SQL statement just fine but I'm not sure of how to loop through this to set the field for each of these records.
I am developing small asp application.There is a database called db.mdb and there are three tables(tblUser,tbsImport,tblcitylist) In tblcitylist there are two fiedls
1.Town
2.LReg
According to the relevent town there is a LReg (Lreg is a name already assign to the town)
this part is ok.
In my tblUser there is a field called Town and LReg (Same as above table)
But here LReg is empty.I mean there is a default value called "N/A"
I need to create a asp page for following purpose
* i need to read tblcitylist table and according to that I need to fill the LReg fields of TblUser Code:
Okay Whenever a user logs in we want to track the last time they logged in. My login script worked perfect before this now I can figure it out. All I did was add the way the table opens and the objRS.Update. Code:
View Replies View RelatedTrying to update 2 fields. my database is read only..
Microsoft JET Database Engine error '80040e09'
Cannot update. Database or object is read-only.
/sendd.asp, line 16
this is line 16: rsAddComments.AddNew
is this something to do with my server directory permissions?
code .....
I've declared a variable for the current date and want to use the UPDATE function to update the date field in a single record.
UPDATE lms_users Set leaver_date ="&MakeDate" WHERE user_id="473"
I know I have the date format in the variable as if I response.write it to the screen is displays correctly (28/08/2004). I must be doing something really silly, but can't see it.
I have a form where the first field is a dynamic drop-down that pulls from a db (Access). The fields associated with the query are task_id, task_name and task_rate. The field has the value of "task_id" and the label of "task_name".
In the second form field, I would like the default value to be determined by the selection made in the first field. Based on the selection of the first form field, I would like the default value of the this field (task_rate) to be populated with the associated task_rate value of the selection chosen above.