Delete Query

I have this query

strsql = "Delete FROM College_List WHERE
STDID = (Select ID from Students where StudentID='" & getstdid & "')"

i get this error

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

but i want to delete all the records in the child table that have the ID in the parent table which is students.

View Replies


ADVERTISEMENT

Delete Query

i need to delete some values which have dates that are less than today's from a table. The date is in another table so i joined the two tables together and gave a clause

I did this:

DELETE *
FROM RMASerial, Sold
WHERE RMASerial.SoldID=Sold.SoldID And Sold.Warranty_date<Date();

View Replies View Related

Delete Query Not Quite Correct

i need to delete some values which have dates that are less than today's from a table. The date is in another table so i joined the two tables together and gave a clause

I did this:Code:

DELETE *
FROM RMASerial, Sold
WHERE RMASerial.SoldID=Sold.SoldID
And Sold.Warranty_date<Date();

But that doesnt seem to be working.

View Replies View Related

DELETE Query Does Not Find Match

I have a query that accepts input from a form and deletes a row if the form input = the value in the table .if the input is not in the table how do i post to the user that this data was not found in the table?

View Replies View Related

Need To Convert This Sql Query For Access To Identical Sql Query For Sql 2005..

My code retrieves a username and a password from a form. Then this information is compared to some usernames and passwords that are stored in a database. The important thing here is that the comparison must be case sensitive meaning that "passWord" is not the same thing as "password"

I have this code, working fine in access 2003

SQL = "SELECT * FROM users WHERE StrComp(username_column,'" & entered_username_in_form & "',0) = 0 AND StrComp(password_column,'" & entered_password_in_form & "',0) = 0"

but get the following error when I run it against my sql 2005 database.

[Microsoft][SQL Native Client][SQL Server]'StrComp' is not a recognized built-in function name.

I don't know the corresponding t-sql for the query.

View Replies View Related

Query A DB - Pass The Query To Next Page

I am running a querry on an access database and have set the number of records/page displayed at 20. if there are more than 20 records returned, then 1st page will show the first 20, the next page will show next 20 and so on....

The trouble:

the count of total records displayed is correct and the first page is displayed correctly. But when i click on *Next* to go to the next page, all the records of the database get displayed (not the 2nd page of records from the query).

View Replies View Related

Query Access With Multiple Query

I am using ASP/MS ACCESS to see how I can query the same database, via 2 formfields.

{name: - search}Textfield 1: - Search by Category
AND/OR By
{name: - searchT}Textfield 2: - Location

Currently,

strSearchwords = Trim(Request.QueryString("search")); where "search" is the name of Textfield1

Which is fine, but how can I set it so that on Submit, the string from search, and searchT are somehow joined together into one string?

View Replies View Related

FSO Delete

I have this code that deletes a file using FSO but it wont work Code:

View Replies View Related

ADD/DELETE In ASP

I am trying to delete all the records from one table and insert a few in the same table.
When I run the asp it gives me the error message

"Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not delete from specified tables."

Before opening the connection to the database, I tried setting the mode to 3 as follows:

Set Conn = Server.CreateObject("ADODB.Connection")
conn.Mode= 3

Then I open the connection. But it still gives me the same error.

View Replies View Related

Delete Value

How do you delete from the objRs when you choose the value to be deleted form a dropdown menu?

View Replies View Related

Delete

i would like to be able to delete a record from a database this is the code i have atm but it is not working:

if request.querystring("action") = "delete" then
strSQL = "DELETE * FROM DVDDescription WHERE DVDDesc_ID=" & request.querystring("DVDDesc_ID") & ";"
objRS.open strSQL,conn,1,2
'objRS.close

end if

Code:

View Replies View Related

ASP LIKE Query Using Parameterized Query

In Access you use "*" + [passed variable] + "*", + can be replaced with &
Calling a parameterized query in Access requires % be used in place of *,
however, all that I have read show dynamic SQL passed to Access:

WHERE [some column] LIKE '" & ASPvar & "' % ORDER BY ...

However, my call is similar to:

conn.qMyLookup strVar, rs

If I modify the query in Access to:

"%" & [passed variable] & "%"

I get all records. If I only put it at the end, as suggested, I only get
matches at the end, not throughout the column. Code:

View Replies View Related

SQL Delete Timeout

I'm getting an error from something that seems too easy to cause
trouble. Here's the scenario. User fills out a form. User saves. On
submit, an asp script attempts to save the data. it deletes all of
existing child records, and then re-inserts new child records.

Heres the chunk of code thats bombing out with a 'Microsoft OLE DB
Provider for SQL Server error '80040e31' ':

'delete all children for this Parent record
strSQL = "DELETE FROM qcspec_is_tasks WHERE parentID = " & nRecID
debugPrint strSQL
cn.Execute strSQL

The print statement yeilds the following, before the Execute statement
dies:

DELETE FROM qcspec_is_tasks WHERE parentID = 20

If I run the above in query analyzer, it executes instantly.

Incidentally, at this point in time, the table is tiny. Its only 50
rows or so, at the moment.

View Replies View Related

ASP And ASP.net Cookies - Delete It

During the development, I need to test cookies (ASP and ASP.net).

For the first time I test (First username), it writes the cookies into my computer using the First username, and when I want to test second time, using another user name (Second username), it wont't show up the login page, but instead it automatically let me access the protected page (using the first test username).

Question: I want to delete this cookies! How?

I have searched:

Temporary folder, and can't find it.
Document and settings (W2000 Professional), and can't find it as well.

View Replies View Related

'Email' Delete

The easiest way to describe my situation is by using the 'email' example. I retrieve my email messages and place a 'delete' checkbox by each message. I select the messages I want to delete and then click the delete button. They magically disappear.

I'm using ASP-->COM-->Stored Proc. I've envisioned creating a recordset to hand to the COM, then for each record fire the stored proc (although I'm unfamiliar with modifying a recordset before a form submit).

View Replies View Related

Delete In The Same Window

I have this code where I can check mark the items I want to delete and hit the submit key and it will delete the records, but the problem is that when I hit submit it opens another window for the same page and I can see that the records are the deleted, but the page where I checked marked the boxes to delete the records is still there and its still showing the records.

I dont want to open another window, I want all this process to happen in the same page and when I click on the delete button it should delete the records and the same page should refresh. Code:

View Replies View Related

Delete Record

I been working on this code for a long time, code doesn't work and It also doesn't show any error. All I am trying to do is delete record. I click on id number from first page that brings me to this page. Code:

View Replies View Related

Delete Files

Is it possible after i run my process i delete text files from server.
I run a process to read from text files after that i want to delete
these text files so that no one again run the process.I am using ASP.

View Replies View Related

SQL Delete And Inner Join

Basically I'm trying to combine an SQL inner join with a delete statement, like:Code:

var cnn = Server.CreateObject('ADODB.Connection');
cnn.Open(Application('cnn'));
cnn.Execute('delete * from editors_sections inner join editors on editors_sections.editor_id = editors.editor_id where editor_id='+intEditorId+' and editor.isSectionOne=0 or editor.isSectionTwo=0 or editor.isSectionThree=0');
cnn.Close();
But it gives me the following error:

Incorrect syntax near '*'.

Can this be done, and if so, can anyone see where I'm going wrong (I'm using JScript if that makes any difference?)

View Replies View Related

Delete Content

can someone help me. I'm writing an onlineshop in asp and for the shopping cart
i use an array. If someone wants to delete some articles from the cart, i have to
delete them from the array. How i delete only one article (on line) from the array.

View Replies View Related

How Do I Delete Record Using ID ?

I am trying to delete a chosen record out of my Access database using the ID field as the parameter. I can get the script to output the record so I know it has the record, it just won't delete! Code:

View Replies View Related

Delete Record

I'm simply trying to check if the categoryid is currently being used by any catalogue/product items.

Ok, I've created a mini site content management system and I'm stuck on this function that will ensure data integrity...

I'm trying to check if the categoryid I'm trying to delete has any related 'catalogue' items (products); and if so display a message 'Sorry, there are items currently listed under this category. Move the items before trying to delete'. Basically disallow the delete function if any catalogue items share the categoryid. That's it! Simple... right???

Code:

View Replies View Related

Delete File

How can I delete a file which is saved in a folder when the user checked on the checkbox of the file to be removed and click on the Delete button?

View Replies View Related

Automatically Delete

how do i automatically delete records on date submitted

View Replies View Related

Delete Function

if i want to delete from a record like this..
attached a pic. with the rubbish bin icon

<td ><a href="update_plan.asp?ty=D&ID=<%Response.Write rs("planid")%>"><img src="../images/delete.jpg" alt="Delete" border="0" width="20" height="20"></td>

i want to do a response.write so that it will know what is the pk to delete from? can anyone help me on this?after that how can i execute a delete sql statement?
like
<td ><a href="custorder_edit.asp?ID=<% response.write rs2("ExecNo")%>"><img src="../asp/jpeg/delete.jpg" alt="Delete" border="0" width="20" height="20" onclick="document.edit_custorder.action.value = 'delete_edit_orderdelivery'"></td>

View Replies View Related

Delete Categories

I am using MS Access & open 3 table, 1 for Product 1 for Genre, 1 more for Product_Genre (because one product maybe have many categories)

But when I have tried many ways to delete one of categories, also fail to do it.

What I want to do is : When delete a category,

1) it must delete the Product which is under the Category (to be delete)
2) at the same time it must also delete the records from table 'Product_Genre' which is related with the Category (to be deleted)Code:

View Replies View Related

Conformation For A Delete

i need the code that it give me a msg box for asking me if i am sure that i want to delete this item or not?

View Replies View Related

Could Not Delete From Specified Tables.

I am trying to delete records from a MS-Access DB table using the
following query:

strSQL=DELETE FROM MyTable WHERE
[id]=CInt(Request.QueryString("delete"))
con.Execute strSQL

When I run the app on my local IIS 5.1 server (on WinXP SP2), records
get deleted without any problems but when I upload the same file
(which has the above DELETE query) to the actual remote server, then
ASP generates the following error:

Could not delete from specified tables.

I have gone through numerous posts & articles to resolve the issue but
unfortunately the error still persists. The only apprehension that
comes to my mind is could permissions to the directory which houses
the MS-Access DB table be the cause of this error.

Actually in the remote server, the Access DB table resides in a
directory named "db" (without the quotes). When I view the permissions
that IUSR_MachineName has for this "db" directory (through the web
browser - the hosting service has given this option), then I find that
IUSR_MachineName has only the Read permission but when I try to set
this directory's Write & Modify permissions for IUSR_MachineName, then
I am not being allowed to do so. So could this be the cause of the
error?

View Replies View Related

Delete Problem?

I'm tryin to delete a record from an access database. But it just seems out of the blue the delete sql function has just stopped. What do u reckon it could be? Code:

View Replies View Related

Asp: Delete Using Checkbox

I have an asp page that will delete using checkbox. This checkbox I have assigned the username field as the delete refference.

value="'<%=viewLec("username")%>'">

But now..I want to assign an no field to the checkbox as the delete refference, but it did not works!!!

value="<%=viewLec("no")%>">

I think it has to do something with my delete sql command! Code:

View Replies View Related

FSO Can't Delete Folder

I'm trying to delete files and folders using FSO. But everytime i run the script, it took very long time to run and files or folders weren't deleted. Here's the script : Code:

View Replies View Related

Delete Function

I'm having problems with an SQL delete statement.

strQuery = "DELETE ROW FROM tbl_files WHERE fld_filename=" & request.QueryString("id"),objConn,,,adCMDText

objConn.execute strQuery

The error message is:

Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/delete.asp, line 49, column 72

Here is what I am trying to do:

A web page displays a 2 column table. The first column displays the filename, the second column contains a link to the delete page using Querystring("id"), i.e. the url displays "...delete.asp?id=filename"

The delete.asp page (is suppossed to) delete the record from the database that matches the querystring "id" and display a a notification message along the lines of " [filename] Deleted".

If I remove my delete function I still get the correct message (although oviously no record has been deleted) so I am pretty sure the error lies in my SQL statement.

View Replies View Related

Delete Statement

I am working on making a confirmation page for deleting a record in a database. I have the user push the delete link and they go to my delete page. I run a SQL delete statement and they are redirected back to the main page. This works just fine.

However, if I add a simple form to this asking "Are you sure you want to delete?" with a submit button, on-click the user just goes back to the main page without having deleted the record.

Below is my code ...

View Replies View Related







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