473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

asp delete record

hi , help me
i m trying to delete a record form data base but i get this error
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/rajendra/patel/RND/confirm.asp, line 14

and my asp code is
<%

dim v1
v1= trim(Request.Form("name1"))
IF v1 <>"" THEN
%>
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=SQLOLEDB; Data Source=patel; Initial Catalog=patel; User ID=sa; Password=sa;"
<%
DIM SQL,rs
'SQL = "SELECT name FROM add_table WHERE name='" & v1 &"'"
SQL = "SELECT name FROM add_table WHERE name=" & v1
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL,Conn,adOpenKeyset,adLockPessimistic,adCmdText
'rs.open SQL,Conn
IF rs.EOF THEN
Response.Write "Sorry, you do not have any name in that add_table. Please click back on your browser and enter a different name."
ELSE
DO WHILE NOT rs.EOF
rs.Delete
rs.MoveNext
Loop
Response.Write "Your name in: " & add_table & " have been succesffully deleted from your database."
END IF
rs.Close
Set rs = Nothing
Conn.Close
Set Conn = Nothing
%>

<%
ELSE
Response.Write "Please click back on your browser and select a name to delete."
END IF
%>
Oct 16 '06 #1
1 5432
scripto
143 100+
this might be the problem:

DO WHILE NOT rs.EOF
rs.Delete
rs.MoveNext
Loop

if you are deleting the last record (or the only record) you cannot moveNext. Do this instead

DO WHILE NOT rs.EOF
rs.Delete
if not rs.EOF then
rs.MoveNext
end if
Loop
Oct 16 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Someonekicked | last post by:
I have a binary file, and I need to delete a specific number of characters in it. The file contains records, each record has a specific length. So the way I wanna handle deleting is that I will...
9
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
8
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: ...
3
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to...
3
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command...
4
by: Susan Bricker | last post by:
I have a command button on a form that is supposed to Delete the record being displayed. The record is displayed one to a form. The form is not a Pop-Up nor is it Modal. Tracing the btnDelete...
5
by: Bob Bridges | last post by:
Start with two tables, parent records in one and child records in the other, a one-to-many relationship. Create a select statement joining the two. Display the query in datasheet mode. When I...
4
by: Craggy | last post by:
Hi, I am trying to pop up a yes/no message box so that a user can delete a record in a continuous form. The default delete message is a bit sloppy because it seems to move the continuous form to...
5
by: sh26 | last post by:
I can Add and Delete (A, CName, MX and TXT) Dns records on the Dns Server using C# code. The problem I am having is if someone manaully creates a TXT record on the Dns Server, I cannot delete that...
10
beacon
by: beacon | last post by:
Hi everybody, This is probably going to sound unorthodox, but I have to log records that are deleted...I know, go figure. Anyway, I have a form with a (continuous) subform, and on the subform I...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.