Solved

Microsoft OLE DB Provider for SQL Server error '80040e14'

Posted on 2008-10-22
4
1,515 Views
Last Modified: 2012-05-05
Help, i'm getting the following error -
Microsoft OLE DB Provider for SQL Server error '80040e14'

Prepared statement '(@P1 nvarchar(50),@P2 nvarchar(225),@P3 nvarchar(50),@P4 float,@' expects parameter @P9, which was not supplied.

/vacancyapplication.asp, line 77

my code is below -

Any ideas?

<%Session("EID") = UploadFormRequest("notifyemail")%>
<%
If (CStr(UploadFormRequest("MM_insert")) = "apply") Then
  If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd
 
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_recruta2_STRING
    MM_editCmd.CommandText = "INSERT INTO dbo.JBApplication (JBAPName, JBAPEmail, JBAPCV, JBAPAdvertID, JBAPClientID, JBAPEmployeeID, JBAPSiteID, JBAPScore, JBAPCoveringLetter) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" 
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, UploadFormRequest("notifyname")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 225, UploadFormRequest("notifyemail")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, UploadFormRequest("cv")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 5, 1, -1, MM_IIF(UploadFormRequest("vacancyid"), UploadFormRequest("vacancyid"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 5, 1, -1, MM_IIF(UploadFormRequest("clientid"), UploadFormRequest("clientid"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 5, 1, -1, MM_IIF(UploadFormRequest("employeeid"), UploadFormRequest("employeeid"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 5, 1, -1, MM_IIF(UploadFormRequest("siteid"), UploadFormRequest("siteid"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202, 1, 50, UploadFormRequest("score")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 202, 1, 4000, UploadFormRequest("taMessage")) ' adVarWChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "afterapplication.asp"
    If (UploadQueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
      Else
        MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
      End If
    End If
    Response.Redirect(MM_editRedirectUrl)
  End If
End If
%>

Open in new window

0
Comment
Question by:garethtnash
4 Comments
 
LVL 23

Expert Comment

by:Kamaraj Subramanian
ID: 22775184
0
 
LVL 6

Expert Comment

by:divyeshhdoshi
ID: 22775188
May be u have supplied param1,param2,...,param9 instead on p1,p2,...,p9
if it is then replace param with p.
0
 
LVL 3

Accepted Solution

by:
Andy Green earned 500 total points
ID: 22775257
Hi

This can also be security, or you are trying to insert null values. Can you run Profiler to see what is actually hitting the database. If you can capture the SQL then you can debug it in analyser.

Don't you just love these error codes?

Andy
0
 

Author Comment

by:garethtnash
ID: 22775368
Hi All - thanks for your input, it actually was a name ID mismatch on the description textbox, thanks anyway
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question