Updating Database Records
Those anyone knows how can I update several rows in a table using form fields with ASP?.
I'm using oracle9i.
Those anyone knows how can I update several rows in a table using form fields with ASP?.
I'm using oracle9i.
I'm trying to update records in the database and the script I'm using is giving me an error:
Type mismatch
/Action_Item/action_items/view_action.asp, line 79
Whis is referring to this line:
response.Write("<tr bgcolor=""" & strBgColor & """><td width=""150"">" & lclArray(0,rowCounter) & "</td>" _
& "<td>" & lclArray(1,rowCounter) & "</td>" _
& "<td>" & lclArray(2,rowCounter) & "</td>" _
& "<td>" & lclArray(3,rowCounter) & "</td>" _
& "<td>" & lclArray(4,rowCounter) & "</td>" _
& "<td>" & lclArray(5,rowCounter) & "</td>" _
& "<td>" & lclArray(6,rowCounter) & "</td>" _
& "<td>" & "<a href='edit_action.asp?action_id=" & RS("action_id") & "'>"&"<img src='edit.gif' border="" alt="">"& "</a></td>" ) ....
The problem concerns 2 tables, cart_products and cart_shoppingcart.
Cart_products contains all the product data (eg, prices, product's key name, etc), but most importantly, it contains the quantity of stock (prod_quantity) for each item.
cart_shoppingcart contains all of the user's items in their shoppingcart, including those that are part of an (customer) order; these have the order_number to differentiate from those that aren't in any order (their Order_number is 'no_order', the others have the order number).
Now, what I want to do is this:
For every item in the order (ie, every entry in cart_shoppingcart that matches the username and order number), take the quantity (x) the customer is ordering, then take the quantity of stock remaining (y), then subtract x from y to create the new stock level (z) and update the appropriate record in cart_products with z (all this with SQl preferably).
I was thinking of using a Do while loop, but realised that it wouldn't work as I'd have to use several SQL statements and then I'd run into a problem the minute ASP reads "objrec.movenext".
what is there i need to look up and add to my code so that if more than one user is logged on to my site and edits information such as stock levels other users aren't under the impression there is stock when it has just been givin out to someone else? the easy was is just to have one user to access it at any one time but i think there will be about 5 -10 users at anyone time viewing the info and if 2 ppl update records at the same time how is it done?
View Replies View RelatedThrough the form action I want to be able to update the existing record. Is it possible to run an update through a join? The statement selects a ticket and the associated contact. The user should be able to change the contents of any field and then hit the submit button the update save the ticket. Code:
View Replies View Relatedi want to know how to update records by login
i mean to say when a user will login by his name and password his records of his name n password from the database will dispay on page and he will be able to update
after login m redirecting the page to update.asp .
how can i move the values how parameters i.e loginname and password.
I have created a page that calls multiple records from an access database. I would like for the user to go through and update the data, press update and it updates to the database and returns to the same page.
this has been accomplished all bar one thing, it doesn’t update the database! What have I missed? Code:
I have a master/detail table configuration in a SQL database.Each record in the master table can have many records, which are stored in the details table.I need to create an update page that will allow the user to view, update or add new records within the details table that is associated to a master table record.
So, say I have 7 fields in the detail table and I'm pulling 20 records from the table that is associated to a specific master record. I would have 20 rows each with 7 columns that need to be updated or added to.
The columns contain dropdown menus,which will hold the value from each field in the detail table But,I also need to pull data from other tables that will hold the other values for the dropdown menus.
I need a code that will update multiple records on a list thru checkbox.
If the record is selected, the details that was updated on the selected
record will copy the same value as what is updated.
I am having trouble getting records to insert and update properly. This is not a consistent problem. It is intermittent. The page will allow me to correctly update 2 or 3 times generally, however after that it will double up the data in the insert and update.
Here is the code I am using. Code:
I am having trouble with the edit, update and deleting of records. I got the codes from a user in a different forum. Now I can't find ant help from that forum. Here is a link to a zip file with the pages and database in it.
bkdphoto.com/problem.zip
Simply open the listings.asp page then click on one of the Edit or Delete labels. I am getting the following message when I do:
Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/Tests/New Folder2/delete.asp, line 7
I got an asp page that supposed to add,delete records from access 2000 mdb file. It loads all the records but when i try to delete or update i get these errrors. Code:
View Replies View RelatedI have a database generated form that I would like users to be able to update by selecting a checkbox. Say the page displayed has six records on it and the user wants to delete one or more of the records. They would click the checkbox and hit a "delete" button.
Then the database would be updated and the user redirected back to the page that would now show all the records that weren't deleted. Sort of like Yahoo mail, you get a list of all the bulk mail, select the ones that you want to delete, hit a delete button, and the page is updated to show what e-mail is left. How do I do this using ASP?
I'm trying to pull the last 5 records from my database.
<% j=5
rs.MoveLast
While ((j>0) AND (NOT rs_article.BOF))%>
''Execute HTML and data insertion here
<%rs_article.MovePrevious
j=j-1
Wend%>
Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic.
Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.
i wrote a shopping cart using cookies found out thatIE 7 won't let me add more cookies after a certian number. decided to use DB along with cookies and now i have very weired problem never encountered before Code:
View Replies View RelatedI have a stock control database, I want
first the item sold and recorded as sold in the sale table
secondly the item will be deleted from the stock table
third the item wil be automatically reordered in the order table.
is this possible please. I am using Dreamweaver/access and some of ASP that is generated,
how to update database using information in a form? I'm using dreamweaver but it seems like it doesn't work properly.
View Replies View RelatedI have this form that people fill out with information and it updates. I'm fetching from two tables and it doesn't seem to update any forms related to the second table. Code:
View Replies View RelatedI am using an Access Database and I want to be able to update user address records using VBScript via Asp. Looked at many sites and cant work out an answewr. All I want is for the user to enter there new details into a text box hit submit and the address fields within the database to be updated automatically.
View Replies View Relatedwhenever i try to add a new entry to a database through ASP i keep getting the following message:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
i have enabled WRITE in IIS and i have made sure that the database is not read-only in ODBC. Funny thing is it was working fine a few weeks before but now when i try and add a new record that message keeps coming up. I am fresh out of ideas. I have created a new DSN in ODBC but it still comes up with that message.
ive noticed loads of online apps that allow emails sent to a particular
address, to update a database i.e. ta-da.com - can this be achieved with
COMless scripting in asp?
I would like to be able to update an image I have stored in a database by uploading it through a form. The current pages I have now will only add a new entry to the database. I would like the customer to be able to change the image on their index page through the form. How can I change the following code to do that?
showPicture.asp ....
I have a form that when the user inserts the password data it is supposed to update the member info in the database with the password but instead it just adds a new row with the password and leaves the id requiring the password blank. SO it does add to the database but just not in the correct row.
Here is the code that I have:
i have this shopping cart i'm working on and it keeps giving me this error and the original code is on the bottom. Code:
View Replies View RelatedI'm trying to edit a database, its a small table that holds users login details. but i want to be able to edit them, IE new email etc..
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open constring
strSql = "UPDATE userinfo SET email='" & email & "', info='" & info & "',news='" & news & "' WHERE useronline = username"
Set rs = Conn.Execute(strSql)
Set rs = Nothing
Conn.Close
Set Conn = Nothing
All usernames are unique, but it changes 'Email, info and news' in ALL the records, i just want it to change the 1 record.
I have created a nice form that i want on my site for users to fill in detail. But i was wondering if anyone knew any good tutorials on how i can get this info sent to my database?
View Replies View RelatedIs there any way you can put a variable in the values in an update command?
If oRS("n4") <> 0 then
Response.Write ("<tr>")
Response.Write ("<td>4</td>")
Dim qn4
qn4 = oRS("n4")*intQuantity
strsql = "INSERT INTO report (q1) VALUES (qn4)"
Set oRS2 = oConn.Execute(strSQL)
Response.Write ("<td>Meter box, meter and test block</td>")
Response.Write "<td>" & oRS("n4")*intQuantity & "</td></tr>"
end If
im doin some code on asp where ive got an excel file and run it against a database file. i am trying to code it so that it runs asp code that checks the data in the database and if the data isnt present in the database- the code insert it , but if its already in the database- it should be updated.
Ive used sql commands, connection and a few loops-to run to this- it adds new data to the database but it overrides and re- inserts the data when run a second time.
i am trying to build a page that my client can log onto with a password and update information daily, if there is someone who can point me in the right direction or tell me how to do this it will save me days of research trying to find it myself.
View Replies View RelatedCurrently i am using this function to update the database for the values of the checkboxes. Anyidea on how to go about including the values of those not selected.
0= not checked 1=checked
MenuName | Super | IT
Menu1 1 1
Menu2 0 1
Code:
for each chk in Request.Form("opt")
sSQL = "UPDATE GroupAccess SET IT = 1 WHERE MainMenuID = " & chk
Conn.execute(sSQL)
next
I know this is a redundant question but I can't find a straight answer anywhere. I've got an online registration page that I just want to save name, address, etc ... to a record in an Access 2000 database via ASP on a site of ours.
I know it's a permissions issue. How do I make my connection to the database where I will have rights to update, or add records, to the database? My local test environment works fine so the update code and logic are fine.
I need to know the specifics of how to do this on our host server. I've done this simple task before a couple years ago, but things obviously changed since then. My Web_Account has Read, Write, and Executable rights, but it dies everytime it tries to update my record to the table.
I'm building a shopping-cart like feature with Dreamweaver MX 2004, an access database and ASP & VbScript.
I'm now at the point where I need to add several rows to the same table in the database. Each time the amount of rows that need to be added tot the database varies from 1 row to however many orders a customer places. I'm cappable to make this function for one single row. But not for orders with several rows. Code:
im in the process of creating a MySQL database and I am trying to figure out how I am going to accomplish what i need done. I have 2 scenarios to solve:
1) When a user clicks a button.. I need the action to be set on a timer so that the event will take place in X number of seconds.
2) I need to be able to have a couple thousand rows of data that will need to be continually updated every second.
ie. a person has a bank account that is to gain .0001 th of a penny every second. i m not really sure where to start with this.. I am setup on an MySql database and will be using ASP and VB.