Solved

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

Posted on 2008-10-22
4
1,524 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

622 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