Solved

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

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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

740 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