Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting Records

Status
Not open for further replies.

kaycee79

Technical User
Jan 10, 2004
82
GB
Delete user

I am trying to create a way to delete a user from the database, i have adapted some
code from a book, but i am getting an error message;

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/new/RemoveUser.asp, line 31

line 31 is
objRS.Find "ID=" & varID

the code below is the one i am using (there are 3 files, if required, i will post them up)

Thanks in advance

Code:
<%
Option Explicit
Dim StrConnect
%>

<!-- #INCLUDE FILE=&quot;ProjectConnection.asp&quot; -->


<HTML>
<HEAD>
<TITLE>
User Deleted
</TITLE>
</HEAD>

<BODY>

<%
  Dim varConfirm
  varConfirm = Request.Form(&quot;Confirm&quot;)
  If varConfirm=&quot;no&quot; Then
   Response.Redirect &quot;AdminRemoveUser.asp&quot;
  End If

  Dim varID
  varID = Request.Form(&quot;ID&quot;)

  Dim objRS
  Set objRS=Server.CreateObject(&quot;ADODB.Recordset&quot;)
  objRS.Open &quot;RegisteredUsers&quot;, strConnect, 3,3
  objRS.Find &quot;ID=&quot; & varID
  If objRS.EOF Then
    Response.Write &quot;That username does not exist&quot;
  Else
    objRS.Delete adAffectCurrent
  End If

  objRS.Close
  Set objRS = Nothing
%>

</BODY>
</HTML>
 
kaycee79,

dont try to run before you can walk - try simple examples of asp / ado and move to more advanced stuff - all the things you have posted have been typo's - take your time - think about what you are doing, and it will become clear quicker.

simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top