Solved

Syntax error or access voilation. 80040E14 Error running vbscript that runs stored procedure

Posted on 2010-11-23
5
1,029 Views
Last Modified: 2012-05-10
Hi,

I'm having a problem running a vbscript that runs a stored procedure with an output parameter.
Here is a snippet of what I have...

          Set objParamIn = objCommand.CreateParameter("@inID",3,1,,InVariable)          
            objCommand.Parameters.Append objParamIn
            Set objParamOut = objCommand.CreateParameter("@outResult",3,2,,)
            objCommand.Parameters.Append objParamOut
            Set rsYourRecordSet = objCommand.Execute

I get a Microsoft VBScript compilation error
on this line...

Set objParamOut = objCommand.CreateParameter("@outResult",3,2,,)

If I give it a bogus value like...

Set objParamOut = objCommand.CreateParameter("@outResultCode",3,2,,emptyvalue)

It compiles and reaches the execute, but fails and gives this error...

Syntax error or access voilation. 80040E14
Microsoft OLE DB Provider for SQL Server

Not sure what I'm doing wrong here.
0
Comment
Question by:silentthread2k
5 Comments
 
LVL 13

Accepted Solution

by:
samic400 earned 167 total points
ID: 34204689
This line:
Set objParamOut = objCommand.CreateParameter("@outResult",3,2,,emptyvalue)

You have defined as a 4-byte signed integer. What type of value is it from the table in your stored procedure?

What is the value of emptyvalue - are you sure it is a value of an integer and not a string or NULL?

0
 

Author Comment

by:silentthread2k
ID: 34205818
Hi, the SP definition has both input and output parameters as "integer"

In the VBScript, I just declare emptyvalue like this...
Dim emptyvalue
and it's not used until the SP is called.
0
 
LVL 4

Assisted Solution

by:trythisone
trythisone earned 167 total points
ID: 34206263
This is probably due to using an invalid value.  See the following link for more information:

http://tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-80040e14-errors.html
0
 
LVL 19

Assisted Solution

by:Bhavesh Shah
Bhavesh Shah earned 166 total points
ID: 34220991
Hi,

check out this link.

http://www.andreavb.com/forum/viewtopic_4924.html

it might helps
0
 

Author Closing Comment

by:silentthread2k
ID: 34233484
:-)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

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.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

685 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