Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now