Update A Field For A Bunch Of Records At Once?
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.
View Replies
ADVERTISEMENT
how to update a database from a dynamic table with checkbox. Their is only one field I would like to change and that is the one with the checkbox.
I am using Dreamweaver and I create a dynamic table, add the update record and I get BOF EOF error. The database does have data in it. Code:
View Replies
View Related
Can someone tell me how I can take a bunch of form fields using Request.Form, and put them in a array. And then, how do I send that in and INSERT sql.
View Replies
View Related
I want to select a bunch of records where a certain field is equal to the following.
Code:
if game <> "" thensql = "SELECT DISTINCT game, system FROM wallpaper WHERE system = 'ps2' AND system = 'gba' AND system = 'gf' AND system = 'xbox' AND system = 'xbox360' AND system = 'gba' AND system = 'ds' AND system = 'pc' AND system = 'psp' AND system = 'ps3' ORDER by ID DESC LIMIT 0, 10"
Set rschanmedia = Server.CreateObject("ADODB.Recordset")
rschanmedia.Open sql, conn, 3, 3
The script works fine but when I run it it doesn't display any records at all! Yet when I run a script where system is <> to something it works fine! What's wrong?
View Replies
View Related
I have a form with mutiple records. Each record has got 2 fields to update. How to update mutiple records at the same time??
View Replies
View Related
I want to make modifications to the first 10 records in my database. I know that I can do it quite easily with the RecordSet object, but for speed, I was wondering if I could use pure SLQ?
View Replies
View Related
how to update multiple records on one submit. Say for example i have number of records on a html table, user performs changes on some of the records, and hits the submit button at the end and all these value have to be updated into the sql query.
View Replies
View Related
How do I update multiple records in a table in ASP using loops ? For example.
I have a table with the following colums
ID | Col1 | Col2
-------------------------
1 | 50 | 100
2 | 25 | 130
3 | 55 | 70
I want to add *66* and *77* into the ID # *1* and ID # *3*
respectively. So the result should be
ID | Col1 | Col2
-------------------------
1 | 116 | 177
2 | 25 | 130
3 | 121 | 147
Note: All datatype of the colums are integer.
View Replies
View Related
how can update the multiple records at a time ? what loop will use to update the multiple records ? Code:
View Replies
View Related
How can I go about updating multiple records or deleting multiple records
from a DB at a time?
View Replies
View Related
I just had a problem where I needed to update a bunch of records from a single form submission. I am sure there are lots of better ways to solve this, but I offer the code I came up with. Also I’m asking if there are any better ways.
The form page had a form in it with a table. Each row in the table had a database record in it. In each row, sat the input field titled “myOrder” and a hidden field called “myID”. The table was a repeat region, so that each field was populated dynamically from each record in the database. The number of records was dynamic in that they increased or decreased by the category the user was in.
The page submitted to my mass_update page.
Here is the relevant part of the code that took each “myID” and “myOrder” data and then updated the database record:...
View Replies
View Related
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?
View Replies
View Related
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)
View Replies
View Related
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:
View Replies
View Related
I display work request records from a db table into a .html table dynamically by cycling through the db table until RS.EOF.
To the right of each record displayed I have two checkboxes, "chk_dev_accept", "chk_dev_sendnotif". These are the only editable items on the page.
"chk_dev_accept" is clicked by the developer to assign the work request to his/herself.
"chk_dev_sendnotif" is clicked if the developer wants to notify the customer that the status of the job has changed (optional and automatic - I don't have a problem with this part).
Upon clicking the "Update Record" button, I want the records with the checkboxes clicked to update.
The db record fields that would be updated are: "dev_developer" (The developer that will do the job, read from a cookie) and "dev_proj_status" (changed to 'Assigned'). These two fields should update when the "chk_dev_accept" is clicked and form submitted. I want the developer to check as many records as he/she wishes.
My problem is I'm not sure how to code that <input checkbox....> tag, and then, how to take that checked value to select the appropriate records to update.
View Replies
View Related
I have a shoppingcart which is saved in an array. When the user goes to the checkout and and presses the order button the contents of the array gets saved in a databasetable. This all works fine.
The problem that I have is that I want the articles that the user ordered get subtracted from the Quantity I have got in my database. But I don't know how to tell the database which records have to be updated. Code:
View Replies
View Related
I have a list of registrants and I want to use a check box after each record
to show those who attend and then post all with one submit button.
View Replies
View Related
I got a test asp page which connects to Northwind.mdb database. This page
pulls all the rows from the Customers table. One column i.e. GoodStatus has
been added to the customers table. The following is the code to display all
records of the customers table with some customization. Code:
View Replies
View Related
I wish to update certain records in a access database where the placeID is a certain number and the coststypeID can be other numbers. I am using the following code:
View Replies
View Related
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
%>
View Replies
View Related
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 Related
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
I 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?
View Replies
View Related
I already have this piece of code that inserts multiple rows of data into a single table at once. Code:
View Replies
View Related
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:
View Replies
View Related
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 Replies
View Related
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 Related
Trying 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 .....
View Replies
View Related
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.
View Replies
View Related
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.
View Replies
View Related
is there any one know how to make function to update db field and to be called on checking a check books.
View Replies
View Related
What I would like to happen on this page is that when a user selects a company name from a drop down list, his selection autopopulates the cID field based on the selection. The drop down list is getting its choices from the customer table.
As I am still a novice, I am sure there is a way to do it I have not been able to get it right. Code:
View Replies
View Related
I've got a table with three fields:
ref (Autonumber)
notice (memo)
expdt (Date)
I'm trying to use an SQL statement to delete all records where expdt < the current date (Now). Here is the code I'm using:
<%
If Request.Querystring("act") = "clean" Then
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open ConnStr
strExpdt = cdate(Now())
sql = "DELETE FROM tblNboard WHERE expdt < " & Now()
conn.Execute sql
conn.close
set conn = nothing
strResponse = "All expired notices have successfully been deleted."
End If
%>
However, this just gives me the following error:
Syntax error (missing operator) in query expression 'expdt < 11/12/2003 19:54:25'.
What am I doing wrong??
View Replies
View Related