Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_ado_rds thread: Microsoft OLE DB Provider for SQL Server error '80040e14'


Message #1 by "Srinivasan Prasanna" <Sri_Core@m...> on Wed, 3 Apr 2002 14:47:59 -0500
------=_NextPart_001_0006_01C1DB1E.8C823590
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

 
I have a form which has three columns promo code, promoID and Promo categ
ory. But this page does not work and I am getting this error. Any help fr
om any one will be great.
Microsoft OLE DB Provider for SQL Server error '80040e14' 
Insert Error: Column name or number of supplied values does not match tab
le definition. 
addnewpromo.asp, line 131 
 
 <%@ Language=3DVBScript %>
<% Response.Buffer=3Dtrue%>
<HTML>
<HEAD>
<META NAME=3D"GENERATOR" Content=3D"Microsoft Visual Studio 6.0">
<link rel=3D"stylesheet" type=3D"text/css" href=3D"/admin/styles/mktgpack
age.css">
<BASE TARGET=3D"mktgpromo">
</HEAD>
<!-- #INCLUDE VIRTUAL=3D"/includeschat/adovbs.inc" -->
<BODY onLoad=3D"document.addnewpromo.PromoCode.focus()">
<FORM ACTION=3D"addnewpromo.asp" NAME=3D"addnewpromo" METHOD=3D"POST">
<CENTER>
<P>
<TABLE BORDER=3D"0" WIDTH=3D"300">
 <TR>
  <TD COLSPAN=3D"3" HEIGHT=3D"32">
   <P ALIGN=3D"CENTER"><SPAN CLASS=3D"intro">Add New Promo</SPAN>
  </TD>
 </TR>
 <TR>
  <TD WIDTH=3D"15%" class=3D"TH"><CENTER><B>Promo Code</B></CENTER></TD>
  <TD WIDTH=3D"15%" class=3D"TH"><CENTER><B>Promo ID</B></CENTER></TD>
  <TD WIDTH=3D"70%" class=3D"TH"><CENTER><B>Category</B></CENTER></TD>
 </TR>
 <TR>
  <TD WIDTH=3D"15%"><CENTER><INPUT TYPE=3D"TEXT" NAME=3D"PromoCode" SIZE=3D
"10" MAXLENGTH =3D "5" class=3D"textbox"></CENTER></TD>
  <TD WIDTH=3D"15%"><CENTER><INPUT TYPE=3D"TEXT" NAME=3D"PromoID" SIZE=3D
"10" MAXLENGTH =3D "9" class=3D"textbox"></CENTER></TD>
  <TD WIDTH=3D"70%">
   <CENTER>
   <%
   dim conn,sql,rsCategory,strConn
   set conn=3Dserver.createobject("ADODB.connection")
   strConn =3DApplication("sWebConnStr")
   conn.open(strConn) 
   
   sql=3D "select * from MktgPromoCategory order by CategoryDesc"
   set rsCategory=3Dconn.execute(sql)
   %>
   <select NAME=3D"PromoCategory">
    <option value=3D'0'>Select Category
    <%
    do while not rsCategory.eof
     %>
     <option value=3D'<%=3DrsCategory("MktgPromoCategoryID")%>'><%=3DrsCa
tegory("CategoryDesc")%>
     <%
     rsCategory.movenext
    loop
    %>
   </select>
   </CENTER>
  </TD>
 </TR>
 <TR>
  <TD colspan=3D3><center><br>
   <INPUT TYPE=3D"SUBMIT" NAME=3D"Submit" VALUE=3D"Add Promo" class=3D"su
bmit"  onclick=3D"window.close();">
   &nbsp<INPUT TYPE=3D"button" NAME=3D"Cancel" VALUE=3D"Cancel" class=3D"
submit"  onclick=3D"window.close();">
  </TD>
 </TR>
</TABLE>
</CENTER>
</FORM>
<%
 if Request("submit") =3D "Add Promo" then
 'on error resume next
 set Conn=3Dserver.createobject("ADODB.connection")
 strConn =3D Application("sWebConnStr")
 Conn.open(strConn) 

 sql=3D "select count(*) from MktgPromo where promocode =3D'" & Request("
promocode") & "' and promoid =3D " & Request("PromoID")
 dim rsPromoExists
 set rsPromoExists=3Dconn.execute(sql)
 if rsPromoExists(0) > 0 then
  rsPromoExists.close
  set rsPromoExists=3Dnothing
  Response.Redirect "mktgpromo.asp?errormessage=3D1" 
 end if
 rsPromoExists.close
 set rsPromoExists=3Dnothing
 'Set cmd =3D Server.CreateObject("ADODB.Command")
 'With cmd
 ' .ActiveConnection =3D Conn
 ' .CommandText =3D "spUpdatemktgPackagecharge"
 ' .CommandType =3D adCmdStoredProc
 'End With
 'Response.Write request("promocode") & "<br>"
 'Response.Write request("PromoID") & "<br>"
 ' set Conn=3Dserver.createobject("ADODB.connection")
 ' strConn =3D Application("sWebConnStr")
 ' Conn.open(strConn)
 
  Set cmd =3D Server.CreateObject("ADODB.Command")
  With cmd
   .ActiveConnection =3D Conn
   .CommandText =3D "insmktgpromo"
   .CommandType =3D adCmdStoredProc
  End With
  
  Set prm =3D Server.CreateObject("ADODB.Parameter")
  With prm
   .Name =3D "@PromoCode"
   .Direction =3D adParamInput
   .Type =3D adchar
   .Size =3D 5
   .Value =3D Request("promocode")
  End With
  'Response.Write prm & "&nbsp;Promocode"
  cmd.Parameters.Append prm
 
  Set prm =3D Server.CreateObject("ADODB.Parameter")
  With prm
   .Name =3D "@PromoID"
   .Direction =3D adParamInput
   .Type =3D adinteger
   .Size =3D 4
   .Value =3D Request("PromoID")
  End With
  cmd.Parameters.Append prm
  
  Set prm =3D Server.CreateObject("ADODB.Parameter")
  With prm
   .Name =3D "@piPromoCategoryID"
   .Direction =3D adParamInput
   .Type =3D adinteger
   .Size =3D 4
   .Value =3D Request("PromoCategory")
  End With
  cmd.Parameters.Append prm
  
  cmd.Execute
  conn.close
  set conn =3D nothing
  set cmd =3D nothing 
  Response.Redirect "mktgpromo.asp" 
end if %>
</BODY>
</HTML>
Thanks
SriGet more from the Web.  FREE MSN Explorer download : http://explorer.m
sn.com

Message #2 by lingasamyk@h... on Tue, 16 Apr 2002 07:28:41
Hi
 
   Following may be the root cause for the problem
   [1] Check does the parameters passed to the stored procedure matches 
with the parameters of the stored procedure.
   [2] Check the insert statement used in the stored procedure.
       in the insert statement mention the columns that you are going to 
insert eg., insert into table (column1,column2) values (param1,param2)

Regards,
LingasamyK
Message #3 by "rama kanth" <balina@p...> on Thu, 18 Apr 2002 12:31:41 +0530
hi,
   thanx for u r reply and as u suggested i checked those causes and they
were right but the same code which i am using in vb is working fine but when
it comes to asp i am getting error.
what may be the other cause .

now i am getting error like

   ADODB.Command error '800a0bb9'

	Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one 	another.

if u require i will send the code for u r reference
regards
rama kanth

-----Original Message-----
From: lingasamyk@h... [mailto:lingasamyk@h...]
Sent: Tuesday, April 16, 2002 7:29 AM
To: ASP_ADO_RDS
Subject: [asp_ado_rds] Re: Microsoft OLE DB Provider for SQL Server
error '80040e14'


Hi

   Following may be the root cause for the problem
   [1] Check does the parameters passed to the stored procedure matches
with the parameters of the stored procedure.
   [2] Check the insert statement used in the stored procedure.
       in the insert statement mention the columns that you are going to
insert eg., insert into table (column1,column2) values (param1,param2)

Regards,
LingasamyK
To unsubscribe send a blank email to %%email.unsub%%


Message #4 by "Hornisher, Charlie" <CHORNISH@c...> on Thu, 18 Apr 2002 08:14:52 -0700
I had a similar message recently and discovered that the range I allowed for
a looping function wasn't big enough. I increased the range and the ASP code
ran fine. Another possiblity is that you need to include an adovbs.inc file
to reference constants definitions. This has helped me in the past with
"wrong type or in conflict".  Hope this helps. Good luck.

-----Original Message-----
From: rama kanth [mailto:balina@p...]
Sent: Thursday, April 18, 2002 12:02 AM
To: ASP_ADO_RDS
Subject: [asp_ado_rds] Re: Microsoft OLE DB Provider for SQL Server
error '80040e14'


hi,
   thanx for u r reply and as u suggested i checked those causes and they
were right but the same code which i am using in vb is working fine but when
it comes to asp i am getting error.
what may be the other cause .

now i am getting error like

   ADODB.Command error '800a0bb9'

	Arguments are of the wrong type, are out of acceptable range, or are
in
conflict with one 	another.

if u require i will send the code for u r reference
regards
rama kanth

-----Original Message-----
From: lingasamyk@h... [mailto:lingasamyk@h...]
Sent: Tuesday, April 16, 2002 7:29 AM
To: ASP_ADO_RDS
Subject: [asp_ado_rds] Re: Microsoft OLE DB Provider for SQL Server
error '80040e14'


Hi

   Following may be the root cause for the problem
   [1] Check does the parameters passed to the stored procedure matches
with the parameters of the stored procedure.
   [2] Check the insert statement used in the stored procedure.
       in the insert statement mention the columns that you are going to
insert eg., insert into table (column1,column2) values (param1,param2)

Regards,
LingasamyK
To unsubscribe send a blank email to %%email.unsub%%



To unsubscribe send a blank email to %%email.unsub%%


  Return to Index