|
 |
asp_web_howto thread: Updating Record
Message #1 by "Jonathan Marshall" <jdmarsh2g@h...> on Sun, 16 Dec 2001 17:57:13 +0000
|
|
<html><div style='background-color:'><DIV>How can I trap errors like these and what is
it looking for exactly can not find errors.<BR>Error Type:<BR>Microsoft OLE DB Provider for ODBC Drivers
(0x80040E10)<BR>[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 7.<BR>/app_update_insert.asp,
line 243</DIV>
<DIV> </DIV>
<DIV>app_update_insert.asp
<BR>**************************************************************************************<BR><%</DIV>
<DIV>'Declare variables needed<BR>dim oConn,oRSapp,strInsert,strValues,adCmdText,objCmd,objConn,sqlString<BR>dim
varApplication<BR>dim varOriginator<BR>dim varTitle<BR>dim varProblem<BR>dim varPeopleID<BR>dim
varID<BR>dim varAction</DIV>
<DIV> </DIV>
<DIV>varApplication = Request.form("Application")<BR>varOriginator = Request.form("Originator")<BR>varProblem =
Request.form("Problem")<BR>varTitle = Request.form("Title")<BR>varPeopleID = Request.form("PeopleID")<BR>varID =
Request.form("ID")<BR>varAction = Request.form("Action")</DIV>
<DIV><BR>response.write "<b>Application value:</b>&nbsp;" & varApplication
& "<br>"<BR>response.write "<b>Originator value:</b>&nbsp;"
& varOriginator & "<br>"<BR>response.write "<b>Problem
value:</b>&nbsp;" & varProblem & "<br>"<BR>response.write
"<b>Title value:</b>&nbsp;" & varTitle &
"<br>"<BR>response.write "<b>People ID value:</b>&nbsp;" &
varPeopleID & "<br>"<BR>response.write "<b>Tracking Number
value:</b>&nbsp;" & varID & "<br>"<BR>response.write
"<b>Action value:</b>&nbsp;" & varAction &
"<br>"<BR>response.write Request.Form</DIV>
<DIV>set oRSapp = Server.CreateObject("ADODB.Recordset")</DIV>
<DIV><BR>adCmdText = 1</DIV>
<DIV>strInsert = ("UPDATE app_change SET ID = varID, Application = varApplication, Originator = varOriginator, Title =
varTitle, Problem = varProblem, PeopleID = varPeopleID, Action = varAction WHERE ID=" & varID & "")</DIV>
<DIV> </DIV>
<DIV>sqlString = strInsert</DIV>
<DIV>'Create the command object<BR>set objConn=Server.CreateObject("ADODB.Connection")<BR>objConn.Open
"DSN=application"</DIV>
<DIV><BR>set objCmd = Server.CreateObject("ADODB.Command")<BR>set objCmd.ActiveConnection =
objConn<BR>objCmd.CommandText = sqlString<BR>objCmd.CommandType = adCmdText</DIV>
<DIV> </DIV>
<DIV>'Display the insert string<BR>Response.Write sqlString</DIV>
<DIV><BR>objCmd.Execute</DIV>
<DIV><BR>'Close and dereference database objects</DIV>
<DIV>oRSapp.Close<BR> Set oRSapp = Nothing</DIV>
<DIV> Set objCmd = Nothing<BR>objConn.Close<BR> Set objConn =
Nothing<BR>**************************************************************************************</DIV>
<DIV><BR>Here is
app_update.asp<BR>**************************************************************************************<BR><form
ACTION=app_update_insert.asp method=post></DIV>
<DIV> </DIV>
<DIV> <table><BR> <tr><BR> <td><b&
gt;Application:</b></td><BR> <td><input type=text name=Application
value="<%=oRSsearch("Application")%>"><BR> </td><br><BR>&n
bsp;</tr></DIV>
<DIV> <tr><BR> <td><b>Originator:</b></
td><BR> <td><input type=text name=Originator
value="<%=oRSsearch("Originator")%>"><BR> </td><BR> </tr&
;gt;</DIV>
<DIV> <tr><BR> <td><b>Request
Date:</b></td><BR> <td><INPUT TYPE=TEXT NAME=REQUEST_ON SIZE=10
VALUE="<%=oRSsearch("Request_on")%>"><br></td><BR> </tr&g
t;</DIV>
<DIV> <tr><BR> <td><b>Title:</b></td&am
p;gt;<BR> <td><INPUT TYPE=TEXT NAME=Title SIZE=40
value="<%=oRSsearch("Title")%>"></td><BR> </tr></DIV>
<DIV> <tr><BR> <td><b>Tracking
Number:</b></td><BR> <td><INPUT TYPE=TEXT NAME=ID SIZE=2
value="<%=oRSsearch("ID")%>"></td><BR> </tr></DIV>
<DIV> <tr><BR> <td><b>Problem:</b></td&
amp;gt;<BR> <td><TEXTAREA NAME=PROBLEM COLS=50 ROWS=3
WRAP=PHYSICAL><%=oRSsearch("Problem")%>
</TEXTAREA></td><BR> </tr></DIV>
<DIV> <tr><BR> <td><b>EnterID#:</b></td
><BR> <td><input name=PeopleID size=2
value="<%=oRSsearch("PeopleID")%>">&nbsp;&nbsp;<font color=red>If you forgot your
ID please<a href=ID.asp>CLICK HERE</font></a></td></DIV>
<DIV><BR> </tr><BR> </table></DIV>
<DIV> <center><INPUT TYPE=submit VALUE="Update">&nbsp;<input type=reset
value="Clear Form" ></center></DIV>
<DIV><BR> </form><BR>**********************************************************************
****************</DIV></div><br clear=all><hr>Chat with friends online, try MSN Messenger: <a
href='http://go.msn.com/bql/hmtag1_etl_EN.asp'>Click Here</a><br></html>
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 17 Dec 2001 10:39:54 +1100
|
|
www.adopenstatic.com/faq/80040e10.asp explains common causes of 80040e10
errors.
You need to put in some kind of UI validation and/or modify your database
schema:
www.adopenstatic.com/resources/code/UIvalidation.asp may help here.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Jonathan Marshall" <jdmarsh2g@h...>
Subject: [asp_web_howto] Updating Record
: How can I trap errors like these and what is it looking for exactly can
not find errors.
: Error Type:
: Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 7.
: /app_update_insert.asp, line 243
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |