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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB command error: out of acceptible range...

Status
Not open for further replies.
May 31, 2000
13
US
ADODB.Command error '800a0bb9' <br><br>The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. <br><br>/sqlchk.asp, line 19 <br><br><br><br>That is the error I get when i try to run my page that is trying to delete all of my info from my database.&nbsp;&nbsp;I am pretty much just copying the text straight from the &quot;Beginning ASP Databases&quot; book but I think I may have an error in my sqlDelete string:&nbsp;&nbsp;<br>Could somebody take a peek at this code and perhaps suggest where I should concentrate?<br><br><br>&lt;%@ Language=VBScript %&gt;<br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;%<br>Dim objConn<br><br>Dim objCmd<br>Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br> objConn.Open &quot;suites&quot;, &quot;usrname&quot;, &quot;password&quot;<br><br>strDelete = &quot;DELETE IP_addr,lastName,firstName,phone,suite,pchook_ans FROM PChookup WHERE IP_addr = 24.113.113.141 &quot;<br><br>Set objCmd = Server.CreateObject (&quot;ADODB.command&quot;)<br>Set ObjCmd.ActiveConnection = objConn<br>objCmd.CommandText = strDelete<br>objCmd.CommandType = adCmdText<br><br>objCmd.Execute<br>Set objCmd = Nothing<br>objConn.Close <br>set objConn = Nothing<br><br><br><br><br><br>%&gt;<br>&lt;P&gt;&nbsp;&lt;/P&gt;<br><br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br>
 
Try putting quotes around the ip address value:<br>'24.113.113.141' <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
nope... was hopeful, but it didn't work.&nbsp;&nbsp;exact same error.<br>Thought it would just be my coding.&nbsp;&nbsp;I have only been at it for a week or so now.
 
Now that I look more closely at your SQL,&nbsp;&nbsp;it looks like you're trying to delete certain fields in records with a particular IP address.&nbsp;&nbsp;This isn't possible.&nbsp;&nbsp;You have to delete the entire record.<br><br>You'll still need the quotes around the IP value though. <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
i have tried the following:<br><br>strDelete = &quot;Delete IP_addr, pcHook_ans, phone, lastName, firstName, suite FROM PChookup where IP_addr = 24.113.113.141&quot;<br><br>strDelete = &quot;Delete * FROM PChookup where IP_addr = 24.113.113.141&quot;<br>strDelete = &quot;Delete * FROM PChookup where IP_addr = '24.113.113.141'&quot;<br><br>I always get the same error.&nbsp;&nbsp;Wouldn't the &quot; * &quot; delete the entire record?
 
Hi Scoobydope,<br><br>Just change your sql statement to &quot;delete from PChookup where IP_addr = '24.113.113.141' &quot;<br>Delete command will delete the entire record from the table. You cannot delete a particular field from a table.<br><br>It must work now.<br>
 
&lt;%@ Language=VBScript %&gt;<br>&lt;%OPTION EXPLICIT%&gt;<br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;%<br><br>Dim objConn<br>Dim strDelete<br>Dim objCmd<br>Dim adCmdText<br>Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br> objConn.Open &quot;suites&quot;, &quot;sa&quot;, &quot;&quot;<br><br>strDelete = &quot;Delete FROM PChookup where IP_addr='24.113.113.141'&quot;<br><br>Set objCmd = Server.CreateObject(&quot;ADODB.command&quot;)<br>Set ObjCmd.ActiveConnection = objConn<br>objCmd.CommandText = strDelete<br>objCmd.CommandType = adCmdText<br><br>objCmd.Execute<br>Set objCmd = Nothing<br>objConn.Close <br>set objConn = Nothing<br><br><br><br><br><br>%&gt;<br>&lt;P&gt;&nbsp;&lt;/P&gt;<br><br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br><br><br><br><br><br><br><br>is my entire page... and I Still get the same error..... grrrrr,.
 
Oh, <br>Now i got where exactly ur doing wrong. adcmdtext is not a user defined variable, it is a vbconstant. So delete the declaration statement for the adcmdtext variable and try to execute the code.If it does not work that means you have not inluded adovbs.inc file in your file or it is not existing in your project.<br><br>Kirankumar<br>
 
AH HAH!<br><br>YOU ARE&nbsp;&nbsp;T H E&nbsp;&nbsp;M A N !!! (no sexism intended)<br><br>I actually defined adcmdtext as a variable just to give it a shot.&nbsp;&nbsp;see if that helped.&nbsp;&nbsp;I also threw in the &quot;option explicit&quot; to see if that helped me at all.<br><br>Maybe I skipped a couple of chapters in my &quot;ASP Databases&quot; book, but he didn't make any mention of the &lt;!--#include file=&quot;adovbs.inc&quot;--&gt; tag.<br><br>Anyway, I un-defined the variable, threw in the adovbs.inc line and tried it again...<br><br>TA DA&nbsp;&nbsp;all references to my IP address is out of the list.&nbsp;&nbsp;now this little four page combo is working exactly as I intended it to work.<br><br>YAY my first ASP and first Database!<br><br>I can't thank you enough,.&nbsp;&nbsp;I never would have known even what a vbconstant was .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top