Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ADO Error - Method 'Execute' of object '_Command' failed

Posted on 2002-07-23
3
Medium Priority
?
792 Views
Last Modified: 2011-10-03
While executing a UPDATE query through ADO i am getting an error message
Run time error '-2147217887 (80040e21)':
Method 'Execute of object '-command' failed.

I am using
 NT 4 OS with SP4, VB6
 ADO object Library 2.1
 Oracle Server & Client 8.1.7

Tips
----
a) While command object executes this error prompted.
b) When i use adInteger instead of adBigInt datatype,
   this error is not encountered.
c) The same adBigInt datatypes working without any error
   in Oracle Server and client 8.0.6
d) Why this Oracle 8.1.7 is not accepted ?

Thanks in advance

===== Function ========
Public Function UpdateFPAPara_Approve(ByVal apv_by_id As String, ByVal apv_flag As String, ByVal apv_dt As Date, ByVal fpa_para_apvcd As Long) As Integer
   
    On Error GoTo ERR_HANDLER
   
    Dim lcm As ADODB.Command
    Set lcm = New ADODB.Command
    lcm.ActiveConnection = GetConnection
   
    lcm.CommandType = adCmdText
    lcm.Prepared = True
 
    lcm.CommandText = "update FPA_PARA_APPROVE set apv_by_id = ?, approve_fl = ?, approve_dt = ? where fpa_para_apvcd = ?"
   
    lcm.Parameters.Append GetNewParameter(adVarChar, 20, apv_by_id)
    lcm.Parameters.Append GetNewParameter(adVarChar, 20, apv_flag)
    lcm.Parameters.Append GetNewParameter(adDBTimeStamp, , CDate(apv_dt))
    lcm.Parameters.Append GetNewParameter(adBigInt, , fpa_para_apvcd)
       
    lcm.Execute
    UpdateFPAPara_Approve = 1

    Set lcm = Nothing
    Exit Function
   
ERR_HANDLER:
    UpdateFPAPara_Approve = 0
    Set lcm = Nothing
    MsgBox Err.Description, vbCritical, "FPA-cdFPAPara Class"
End Function

0
Comment
Question by:ChakrapaniBabu
[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
3 Comments
 
LVL 46

Accepted Solution

by:
aikimark earned 200 total points
ID: 7173330
If you are going to use dynamic SQL, don't use parameters. Just construct your SQL with the values as part of the string expression.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8040449
Hi ChakrapaniBabu,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept aikimark's comment(s) as an answer.

ChakrapaniBabu, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8095704
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

598 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