Deleting Records In A One-to-one Relationship
I am trying to get my code to delete a related record in a one-to-one relationship. The code I am trying is as follows:
mySQL = "DELETE FROM tblPurchaseOrderLine WHERE ((tblPurchaseOrderLine.lngPurchaseOrderLineID)="& PurchaseID &");"
myRS.Open mySQL, objConn, 1, 3
However, tblPurchaseOrderLine is related to tblAccessoryPackOrderLine of lngPurchaseOrderLineID. Do i need to reference both table in the statement?
View Replies
ADVERTISEMENT
I am using ASP with SQL for my database.The problem I have is that even after I have ordered certain items from the shopping cart table on the webpage, I cannot remove them -
that is the entire list shows up the next time the table is opened.
is there any way I can delete the items once ordered so as to not let them show in my table?
View Replies
View Related
I am not sure if this is the right place to ask. but... I need to delete records where two fields in the same record are equal. I am not sure how to go about this.will this work?
strQ ="DELETE FROM Request_Notify WHERE Field1 = Field2"
View Replies
View Related
I was wondering the correct way to delete records from two different tables using inner join
Ex.{
DELETE tblPunchlines.Punchline, tblCast.LastName, tblCast.FirstName
FROM tblCast INNER JOIN tblPunchlines
ON tblCast.EmployeeID = tblPunchlines.EmployeeID
WHERE tblCast.EmployeeID = 3
AND tblPunchlines.EmployeeID = 3
}
Can anyone show me the correct way to do this
View Replies
View Related
I have a link on my page for each db record:
<a href="<%= strFileName %>?sc=delete&strArticleID=<%= recordset_obj("article_id") %>">Remove</a>
when i click the link, it goes to the correct "case" and will run through my deleteRecord subroutine. I checked it with output at the very beginning and end of the delete routine.
my problem is that nothing happens and i want the record to be deleted.
here is the delete routine: Code:
View Replies
View Related
I have this list of records (from an Access DB) and would like to use check boxes to delete 1 or many records. I think there is something wrong with the SQL though, cause the records are not deleting when the form is submited. Code:
View Replies
View Related
I may have made a typo somewhere. I am trying to delete collections from RelProdCollection Table that has a certain record with Product ID number of __ and then readd them based on the user's choices on the edit form. Code:
View Replies
View Related
If I have an access database with the fields Title, Artist, Description, DiscNo, TrackNo, Price and ID(Autonumber)
What would be a single-page script to remove only records where DiscNo= string entered into a text field in a form?
Example: I enter into the text field "SC8200" which relates to 18 records in the database. I click submit and all 18 records are deleted. Code:
View Replies
View Related
Can I loop through a recordset and with each record, see if the value of a field is higher than 5. If it higher than 5, just delete that record, not the whole record set and continue the loop.
I am accustomed to using a sql statement to selecting an entire recordset based on similar criteria and deleting the whole recordset in one swoop, but not this time. Code:
View Replies
View Related
I get this message when trying to delete:
The column prefix 'username' does not match with a table name or alias name used in the query. I am not sure what this error is. I checked all over the place for the problem.
View Replies
View Related
Can I do the following things in the global.asa file?
When sessions starts:
Add a record into my database
When session ends:
delete it where rs("sessionid") = Session.SessionID...
?
I'm pretty sure I can, but...I've heard not ALL things can be done in global.asa...
Do I create an object, and a connection? How would I do it? Since I want a database in MY database, not in memory like I've seen...
View Replies
View Related
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
View Replies
View Related
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 Related
If there is three table,
let say A,B and C
C store the B id, and B store the A id
now what i trying to do is search from C table to get result in A
and display the result from A table..
hv any idea?
View Replies
View Related
I have big issue over here....and i seeking help from u all.....well u see I have 2 asp(dreamweaver mx) pages with contained insert data server behaveiour....the problem is the database which connected to these 2 asp pages is contained 2 table which is link relationship....so when try to insert data to the secondary form it came out wit an error stated cannot update or insert data to the table because of contained relationship
View Replies
View Related
I have a web interface where I can upload images. I have two tables, one table holds thumbnail images and the other table holds the full scale version of the thumbnail image. So, in my web application, I have one form that uploads the thumbnail image and inserts all the relevant information into the thumbnail images table.
I have another form that uploads the larger image and inserts all the relevant information into the table that holds the information for full scale version of the image. The problem is how can I relate the thumbnail image to the corresponding full scale image?
I have to insert the thumbnails and larger images in the same sequence so they have the same id numbers. I'm trying to find a way to upload the images in any order and still have the correct relationship between the images.
View Replies
View Related
I need some help optimising my object design. Since one article has 1+
authors, I assume the logical way to represent this is for my Article object
to have a Authors property, of type "array", capable of representing any
number of authors.
The code I have written (below) works, but is very inefficient; if I want
the asp page to fetch a list of 30 authors using GetAuthors(30), there will
be a total of *31* calls to the database - one call in GetArticles(), and
one call to GetAuthors() for EACH article! Code:
View Replies
View Related
I want to display a kind of two-tier one-to-many relationship, for
which, in the olden days, I would have used a series of nested loops
and multiple calls to the db. Code:
View Replies
View Related
(I include a bmp file to make sure u all understand what my problem is)..as U all can see from the bmp I supply with this message.. I got 2 Table which is Master and Child table...the problem is I kindda want to make it like a Parent Child Relationship like In ms Access.
View Replies
View Related
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".
View Replies
View Related
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.
View Replies
View Related
This code works fine, it deletes the record that already exist in the database and displays a message to the user the record has being deleted.... but it also it has a problem, if you enter a record to delete from the database and this record does not exist it displays the message that the record has being deleted, while instead it should display an error that this record does not exist in the database.
Code: ...
View Replies
View Related
Ive run into a little trouble. I am sure all of you have used hotmail. Well you know when you select all items to delete, i would like to do something like that, however not delete, but update a field from no to yes.
I would like to add checkboxes to an asp table. So if the user selects say three items they then click on a button, say marked and for each item, it will go to the table and find each record in turn and update the corresponding field from a no to a yes.
Updating is no problem. The problem is, how do i add checkboxes to corresponding asp table. So that particular checkbox corresponds to that particular record. I don't know how to link them together.
Can someone help me out please?
View Replies
View Related
I have a form that contains many pages. If someone clicks on delete, the application takes the user back to page 1 instead back on page in the breadcrumb trail. It is fine when the user is on page 2 but they could be on page 10 and click delete and then they are back to page one. I want to have the application go back on page at a time each time they click on delete. Here is what I have for code:
If LEN(page & " ")=0 Then
page = 1
End If
page = CInt(page)
If i = page Then
response.write "<font color=""#CC0000""><strong>[page " & cstr(i) & "]</strong></font> "
View Replies
View Related
I have a script which allows a user to upload and delete files from the
server.Is it possible (and if so how) to do a check to see if the folder is empty
(ie if the last file in a particular folder is deleted by a user) and if it
is empty, delete the folder?
View Replies
View Related
I'm having trouble creating a one record recordset then deleting it. I've never done this before. The code below returns: "Type mismatch: objRS".
Code:
View Replies
View Related
On my webpage users can upload files and also delete those files. Everything seems to work, but when they upload a file that contains spaces, I am having problems getting the file deleted, for example: "This is my file.txt"
Is there a way I can delete this file. I have tried to take out the spaces, but the file still doesn't delete:
<%=Replace(Request("MyFile")," ","+")%>
View Replies
View Related
this is my code but when i delete all the record there is error dispalyed ?
elseif (strType = "Delete") then
strSQLDelete= " Delete From events where id = " + ID
conn.execute strSQLDelete
response.redirect "eventform.asp"
View Replies
View Related
I am using cookies to store the user name and login state on the site. I am having some problems logging people out.
Firstly wanted to make the cookie values null but having some trouble with that
Response.Cookies("Login")("UserGood") = ""
Response.Cookies("Login")("Usercode") = ""
doesn't appear to do anything?
What would be really cool would be to delete to cookie in the logout script, can that be done from ASP?????
View Replies
View Related
I have a little app running in ASP which lists a bunch of files that are in a directory. This is attained using the following code:
View Replies
View Related
I'm trying to delete 2 files using fso. The mail file name is stored in an
access db.
using the code below I can delete the main file but not the thumbnail.
The thumbnail has the same file name plus the suffix "_small" so if the main
file is called "mypicture.jpg" the thumbnail is called "mypicture_small.jpg"
The main file is being deleted but no matter how I try I cannot get the
thumbnail deleted. They are both in the same folder with the same permissions.
Code:
View Replies
View Related
I'd like to have a remove all button in my shopping cart.
is it possible to delete a cookie with asp?
View Replies
View Related
How can I delete the files using ASP?Following is th code :
var objFso = Server.CreateObject("Scripting.FileSystemObject")
var strFileName = Server.MapPath(".") + ""+ "SubmittedDoc.xml"
if (objFso.FileExists(strFileName))
objFso.DeleteFile(strFileName)
This is not working.
View Replies
View Related