Solved

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

Posted on 2008-10-22
4
1,513 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

803 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