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

Cannot understand this error

Status
Not open for further replies.

unicorn11

Programmer
Jun 10, 2000
392
IN
This is the error that the asp turned up when i tried to add a new record set to my database<br><br>please help! :(<br><br>Microsoft OLE DB Provider for ODBC Drivers error '80040e21' <br><br>Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. <br><br>/rep/entered.asp, line 55 <br> <p>Unicorn11<br><a href=mailto:webmaster@tripmedia.com>webmaster@tripmedia.com</a><br><a href= > </a><br>Hi there it all likeminded fellows!!!!!!
 
do you know if you can successfully connect to the data source even?&nbsp;&nbsp;If not you may need to update or reinstall the odbc/ado drivers <p>John Durbin<br><a href=mailto: > </a><br><a href= > </a><br>ICQ VFP ActiveList #73897253
 
Dear Unicorn11,<br><br>What is the platform, web server, database and lets see the code up to line# 55. And while your at it, what version of MDAC is installed?<br><br>-pete
 
Well it is nt4 with iis 4 <br><br>the code is given below<br><br><FONT FACE=monospace>&lt;%@ Language=VBScript %&gt;<br>&lt;%Response.Buffer = True%&gt;<br>&lt;!--#include file=&quot;Connection.asp&quot; --&gt; <br>&lt;%<br><br>If Request.Form(&quot;product_id&quot;) = &quot;&quot; Then<br><br>&nbsp;&nbsp;Response.Write (&quot;The contents of this page is not viewable&quot;)<br><br>Else<br>%&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;table cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Product Id&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;product_id&quot;)%&gt; &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Product Name&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;product_name&quot;)%&gt; &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Rate&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;rate&quot;)%&gt; &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Description&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;description&quot;)%&gt; &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Image Path&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;img_path&quot;)%&gt; &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Quantity&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;quantity&quot;)%&gt;ml &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;Product Type&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&lt;td&gt;&lt;font face='arial' size='-1'&gt;&lt;%=Request.Form(&quot;product_type&quot;)%&gt; &lt;/font&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br>&nbsp;&lt;/table&gt;<br>&nbsp;&lt;!-- #include file=&quot;adovbs.inc&quot; --&gt;<br>&lt;%<br>&nbsp;dim rs, sql, id, vari<br>&nbsp;'Set rs = server.CreateObject (&quot;ADODB.Recordset&quot;)<br>&nbsp;id = Request.Form(&quot;product_id&quot;)<br>&nbsp;vari =&nbsp;&nbsp;Cstr(id)<br>&nbsp;sql = &quot;Insert into product_mst (product_id, product_name, rate, description, img_path, quantity, product_type)&quot;<br>&nbsp;sql = sql + &quot; values ('&quot;& vari & &quot;','&quot; & Request.Form(&quot;product_name&quot;) & &quot;',&quot; & Request.Form(&quot;rate&quot;) & &quot;,'&quot; & Request.Form(&quot;description&quot;) & &quot;','&quot; & Request.Form(&quot;img_path&quot;) & &quot;',&quot; & Request.Form(&quot;quantity&quot;) & &quot;,&quot; & Request.Form(&quot;product_type&quot;) & &quot;);&quot; <br>&nbsp;'sql = &quot;select * from product_mst&quot;<br>&nbsp;Response.Write sql<br>&nbsp;set rs = con.Execute(sql)<br>&nbsp;'Response.Write (<br>&nbsp;' rs.Open sql, con,1, 3<br>&nbsp;'&nbsp;&nbsp;rs.AddNew <br>' rs(&quot;product_id&quot;) = vari<br>' rs(&quot;product_name&quot;) = Request.Form(&quot;product_name&quot;)<br>' rs(&quot;rate&quot;) = Request.Form(&quot;rate&quot;)&nbsp;&nbsp;<br>' rs(&quot;description&quot;) = Request.Form(&quot;description&quot;)<br>' rs(&quot;img_path&quot;) = Request.Form(&quot;img_path&quot;)<br>' rs(&quot;quantity&quot;) = Request.Form(&quot;quantity&quot;)<br>' rs(&quot;product_type&quot;) = Request.Form(&quot;product_type&quot;)<br>&nbsp;' rs.Update<br>&nbsp;Response.Write (&quot;&lt;p&gt;&lt;font face='arial' size='-1'&gt;The new product with the above details was &lt;br&gt;added to the Database&lt;/font&gt;&lt;/p&gt;&quot;)<br>'rs.close<br>'Set rs = Nothing<br>%&gt;<br>&lt;ul&gt;<br>&nbsp;&lt;li&gt;&lt;a href=&quot;dataentry.asp?type=2&cat=&lt;%=Request.Form(&quot;cata&quot;)%&gt;&quot;&gt;Click here to add another product to the same catagory&lt;/a&gt;<br>&nbsp;&lt;li&gt;&lt;a href=&quot;dataentry.asp?type=1&quot;&gt;Click here to add a product to a new catagory&lt;/a&gt;<br>&lt;/ul&gt;<br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br>&lt;%<br>&nbsp;<br>End If<br><br>%&gt;<br><br><br><br>i have used both rs.addnew method and the insert statement in sql both ways it does not help! <p>Unicorn11<br><a href=mailto:webmaster@tripmedia.com>webmaster@tripmedia.com</a><br><a href= > </a><br>Hi there it all likeminded fellows!!!!!!
 
Dear Unicorn11,<br><br>These two items first:<br><br>1)<br>&gt;Response.Write sql<br><br>You should be able to copy the output SQL statement into your database environment (Access, SQL Server, whatever) and successfully execute it.<br><br>2)<br>&gt;set rs = con.Execute(sql)<br><br>The SQL statement you are executing does not return a result set. I have never executed equivalent code so I am not sure what type of error it might or might not produce.<br><br>Let me know how it's going<br>-pete<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top