Solved

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

Posted on 2010-11-23
5
1,027 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

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

Suggested Solutions

Title # Comments Views Activity
OSQL to execute sql command 26 24
SQL STANDARD CORE 7 31
batch file or script 4 24
Substring works but need to tweak it 14 13
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

839 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