How to return success/failure message in a VBA program that uses ADODB

I have this little VBA program that uses ADODB to execute a SQL Server Agent job remotely.  How do I add a message box at the end that would give some feedback to the user, if the execution command was successfully sent to the server or if it failed?
Sub Test_SSIS()
Dim conn As Object
Set conn = CreateObject("ADODB.Connection")
conn.Provider = "sqloledb"
conn.Properties("Prompt") = adPromptComplete
conn.Open = "Data Source=MYSERVER;USER ID=JOHNDOE;"
conn.Execute "exec msdb.dbo.sp_start_job 'Test_remote_job_execution'"
End Sub

Hi Tim,
When I looked up the BOL about the ADO.Connection
EXECUTE method, something came to my sight.
"An ExecuteComplete event will be issued when this operation concludes." You may reference the
ExecuteComplete. A quick glance at the event, it contains the execute result set and errors if occured.
Regarding your description, your question is more relevant about VBA, I suggest you post your question on a dedicated VBA forum. It is appropriate and more experts will assist you.
Here is a relevant link you can reference
Visual Basic of Application
If you have any feedback on our support, please click
here.
Eric Zhang
TechNet Community Support

Similar Messages

  • How to read success/failure message while running sqlldr through php?

    Hi All,
    currently i am running sqlldr through PHP . i want to read both success and failure message from sqlldr.
    sometimes it fails to load data, but it shows record inserted
    is there ant way to figure it out succ or failure?

    With SQL Loader you can get errors at several levels.
    At the command line level by reading $? after it runs since it sets $ERROR_LEVEL correctly.
    It also creates many types of log files which can then be parsed that include but are not limited to:
    The [control file name].log and the [control file name].bad file which are created wherever you would like them to be created and named any way you would like them. The [control file name].bad file contains all records that were considered unacceptable by SQLLDR and therefor simply testing for that files existence will start you down the road to programatically dealing with errors.
    Yes I know the documentation for SQLLDR is worse then stereo instructions that started out in Japanese, then were translated to Greek then to Korean then finally into English but there are some pretty good examples out there.

  • When I return from a screen saver or a program that uses the whole screen, firefox 4b7 returns a black screen.

    Any time the computer is left for a long duration of time (powers off monitors or goes into screen saver) firefox returns black and must be closed.
    The same problem occurs when using a program that goes into full screen (game, etc.)

    You can try to disable hardware acceleration.<br />
    Tools > Options > Advanced : General: Browsing: [ ] "Use hardware acceleration when available"

  • How do I retrieve text messages from a iPhone 4S that doesn't work anymore?

    How do I retrieve text messages from a iPhone 4S that doesn't work anymore?

    If the phone isn't working, you can't.  If you have a backup on your computer, you may be able to extract them from the backup using 3rd party software such as iPhone Backup Extractor (see http://www.iphonebackupextractor.com).

  • How to list ABAP programs that uses a SAP script form?

    Hello everybody.
    Can you please tell me how to list all ABAP programs that uses a particular SAPscript forms? That is, given a form name, I can then list all programs that uses that form.
    Thanks in advance. I'm trying to Google this same info but I'm having a hard time formulating my search terms.
    Thanks.
    -- Carl

    Hi Carl,
      You can get them from table TNAPR,
      Give the FORM NAME and all the programs are listed
    check this table also TTFXP ,   TTXFPT
    Message was edited by: Chandrasekhar Jagarlamudi
    Message was edited by: Chandrasekhar Jagarlamudi

  • How to know the tcodes/programs that uses a user exit

    Hi, anybody knows given the user exit (function module) how will i know the tcodes/programs that uses it? the where used list doesn't return any.

    Hi,
      You will find the enhancement for the exit EXIT_SAPLCOZF_001 ,go to se11>enetr MODSAP Table name in Memeber postion you can enter your function module name EXIT_SAPLCOZF_001>now you will get the enhancement COZF0001 (trx SMOD)
    yOU will find whre the exit is called from the t.code Try this method:
    All exits have the program name as part of their own name, for eg, EXIT_SAPLCOZF_001. In this, SAPLCOZF is the program that the exit is called in, you can use this program name and search for transaction codes related to the program (in SE93).
    The only hitch in the above method is when the program name is a function group program name (SAPL*), in which case you will have to drill down into the function group to find the corresponding tcode.
    Or
    Go to SMOD transaction.
    Enter the Enhancement Name in SMOD.
    Open in Display mode.
    Now get the package name from the window.
    Now go to transaction SE80.
    Choose package from the listbox
    and enter the package name.
    Now it will display the list of Transactions associated with the project.
    Regards
    Kiran Sure

  • HT201622 How do I install apps on a new iPhone 6 that uses a different Apple ID than the one used to purchase the apps?

    How do I install apps on a new iPhone 6 that uses a different Apple ID than the one used to purchase the apps?

    Sign in to the iPhone or connect the phone to the computer and sign into the store using the original ID and download the apps to the phone?

  • How do I set up or know what zip program I use?

    How do I set up or know what zip program I use...not familiar with this.

    It's built-in to OS X. It's called Archive Utility and can be found in the /System/Library/CoreServices/ folder.

  • How can I stop my Air from moving my programs that I leave open to other windows where I didn't leave them?

    How can I stop my Air from moving my programs that I leave open to other windows where I didn't leave them?

    Try toggling this preference (circled):

  • BPM - PI/XI Integration to get success/failure message from PI into BPM?

    Hello Experts,
    I happen to run into following scenario:
    I have a BPM Process created in NWDS CE 7.2. This process allowes to create a record in SAP. When a user requests to create a record and fill out the required details, it goes to approver for approval. Upon approval, record gets checked-in to MDM and then from MDM it is syndicated to SAP R3 using an IDOC. Now, what I need is, if PI/XI is succesful to create that record in R3, then the success message should be sent to BPM for performing some further actions. And if it is a failure message returned from PI/XI then BPM will take a different lane.
    Can I do this? If yes how? I read about PI Integration Repository, Java Mapping APIs etc but to be frank I am not able to understand it at all. Please help.
    Ameya

    Thanks John,
    Before I close this thread, following are my understandings:
    1) I need an intermediate event who's trigger will be mapped to PI service
    2) That means, PI will use this webservice for sending the reply back to BPM event
    3) Accordingly BPM flow will be decided
    End-point URL is the WS URL and that is also available in WS Registry. Apart from this, whatever PI side configurations or development is required that is out of our purview. Is that correct?
    Ameya

  • How to return data from message bean ? ? ?

    Hi ... I have developed one simple application in JMS ...
    I have created one jsp page, one message bean and one remote EJB ...
    Now i m sending message to message bean .... i m also receiving message in message bean and i m calling one simple EJB method on that message called ...
    This all things are working well. But i wanted to return some data from that EJB to my JSP page .
    for example ...
    there is one sayHello() method in EJB which i m calling from message bean as i got message from JSP page .
    if i m printing that string in server log than its working well .
    now i wanted to return that string from that EJB method to JSP page.
    How can i achieve this ? can any one help me please ...
    actually i wanted to return whole XML file but recently as a newbie i m trying to just return hello world string .
    please help me for this problem ....
    thnks ...

    if you want to return a result, then you probably shouldn't be using a message bean. message beans for for asynchronous tasks. session beans for for synchronous tasks. thus it would make much more sense to have your jsp call the session bean directly.

  • How to assign ALV for parent node and child node that uses supply method.?

    HI Dear friends,
        I need to display header details ( VBAK ) and Item details ( VBAP ). I have created two node like HEADER_NODE inside this i have created ITEM_NODE for this item node i use supply function 'GET_ITEMS'  any way it is working only when crete two separate table and binding but when i come to work with ALV i am totally confused .. i have created two 'View Controller UI Elements'   when i try to map HEADER_NODE  it mapped properly but for ITEM_NODE it shows mapping already defined. return status message as 'Action Cancelled' . In result both ViewContainer shows only HEADER_NODE data only.
    How to achive ALV for  Parent, child node that uses supply function ? ?
    Thank you

    Delete Mapping is not enabled, that means there is no mapping done yet.
    I just tried what you are saying and the application works and i am able to map the header table and item table and also again i could map the tables any number of times.. i didn't get any such message, sorry i couldn't recreate the scenario. might be there is something wrong in the context.
    i just did it like this.
    Please also move this to Web DynPro Discussion, Hope that would be helpful.
    Message was edited by: Syed Ghulam Ali

  • How to compile and link a C program that uses the FSEvents framework

    I've been trying to compile a program from the command line that uses the FSEvents framework. I can compile and link the code in Xcode and it runs correctly.
    At the moment I have the following command line:
    cc -Wall -g -o Watcher *.c -framework CoreFoundation -framework FSEvents
    I'm running Snow Leopard and noticed that FSEvents is not in the Frameworks directory under /System/Library as it was in Leopard.
    The link error is:
    ld: framework not found FSEvents
    collect2: ld returned 1 exit status

    I'm not sure what the point is if it builds in Xcode, but the build log should show you every command it uses throughout the process--copy and paste.

  • How to return an error message from a zbapi that I have written

    Hello Friends
    I have written a simple ZBAPI that I have created. Here is the simple code that I have written which just inserts some value. How can I send information back using BAPIRETURN if the insertion was not successfull.
    Is it enough just to define BAPIRETURN in the EXPORT TAB or is there any extra coding I have to do?
    Your response or feedback will be greatly appreciated.
    Following is the simple code of insertion that I have written.
    FUNCTION ZBAPI_ADD_CONFIG.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(CONFIG_DATA) TYPE ZCONFIG_STRUCTURE
    *" EXPORTING
    *" VALUE(MESSAGE) TYPE BAPIRETURN
    tables: ZDAMPER_CONFIG.
    ZDAMPER_CONFIG-CONFIG_ID = CONFIG_DATA-CONFIG_ID.
    ZDAMPER_CONFIG-APPL_FILE_NAME = CONFIG_DATA-APPL_FILE_NAME.
    ZDAMPER_CONFIG-APPL_VER = CONFIG_DATA-APPL_VER.
    ZDAMPER_CONFIG-CONFIG_DESC = CONFIG_DATA-CONFIG_DESC.
    ZDAMPER_CONFIG-CONFIG_EXT_QTY = CONFIG_DATA-CONFIG_EXT_QTY.
    ZDAMPER_CONFIG-CONFIG_STATUS = CONFIG_DATA-CONFIG_STATUS.
    ZDAMPER_CONFIG-CONFIG_TYPE = CONFIG_DATA-CONFIG_TYPE.
    ZDAMPER_CONFIG-CONFIG_UFLD_1 = CONFIG_DATA-CONFIG_UFLD_1.
    ZDAMPER_CONFIG-CONFIG_UFLD_2 = CONFIG_DATA-CONFIG_UFLD_2.
    ZDAMPER_CONFIG-CONFIG_UFLD_3 = CONFIG_DATA-CONFIG_UFLD_3.
    ZDAMPER_CONFIG-CONFIG_UFLD_4 = CONFIG_DATA-CONFIG_UFLD_4.
    ZDAMPER_CONFIG-CONFIG_UFLD_5 = CONFIG_DATA-CONFIG_UFLD_5.
    ZDAMPER_CONFIG-CONFIG_VALID = CONFIG_DATA-CONFIG_VALID.
    ZDAMPER_CONFIG-CRT_TS = CONFIG_DATA-CRT_TS.
    ZDAMPER_CONFIG-CRT_USER_ID = CONFIG_DATA-CRT_USER_ID.
    ZDAMPER_CONFIG-PDCT_ID = CONFIG_DATA-PDCT_ID.
    ZDAMPER_CONFIG-PROSPECT_ID = CONFIG_DATA-PROSPECT_ID.
    INSERT ZDAMPER_CONFIG.
    ENDFUNCTION.

    Just declaring the return parameter is not enough. In your example you need to check the return code of the INSERT and populate the message parameter accordingly. Only then you'll get values in there.
    Regards,
    Michael

  • How to return array of String to a java program.! ??

    Hi All,
    I am new to JNI programming. so trying with simple example. I am having one problem. I have one array of String in my Java program. I want to reverse all the elements in this array and want back this new array in the same form i.e. array of string. So how can I do this ??
    Please guide me.....
    The function of defination of array in my java code is
    public native String[] getReverseStringArray(String[] arrString);
    where as my array is like:
    String[] arrStr = {"one", "two", "three", "four", "��������","�c��","�J�^�J�i"};
    and I am calling function in C file like:
    arrStr = employee.getReverseStringArray(arrStr);
    and the function defination in my c file is
    JNIEXPORT jobjectArray JNICALL
    Java_Emp_getReverseStringArray (JNIEnv *env, jobject obj, jobjectArray arr)
    // some code will come here......
    So can anybody tell me how to do this ??
    Thanx in advance...
    Pandurang
    [email protected]

    Hi,
    this is quite simple. Here an example function that works like this:
    JNIEXPORT jobjectArray JNICALL Java_cadagent_ugopen_UgAssembly_jni_1getStructure
    (JNIEnv *env, jclass cls, jstring part)
    jobjectArray retvals = NULL;
    jstring j_val = NULL;
    int child_count = 5;
    /* initialize return array */
    j_val = (*env)->NewStringUTF(env, "");
    retvals = (*env)->NewObjectArray(env, child_count, (*env)->FindClass(env, "java/lang/String"), j_val);
    for (i=0;i<child_count;i++)
    j_val = (*env)->NewStringUTF(env, "some text");
    (*env)->SetObjectArrayElement(env, retvals,i, j_val);
    return retvals;
    Hope this answers you question.

Maybe you are looking for

  • Best 2D Graphics to Timeline workflow?

    Hello, I'm currently in the latest version of Final Cut and mostly working in the HDV 1080i format. I'm trying to figure out what the most professional workflow to import graphics and images into my timeline is. I have Photoshop and Fireworks CS3 as

  • Finder not picking up external HD

    I have an external HD that have connected to the mac before in fact I believe it is in OX forma, but regardless when I connect the drive I can see if it disk utility but I can select it. It doesn't show up in finder but I do get a message saying that

  • IMac (Early 2009) always wakes from sleep after Security Update 2010-001

    I posted this already in the Snow Leopard section, but wasn't able to get a resolution to the problem: http://discussions.apple.com/thread.jspa?threadID=2309613&tstart=0 I tried all the suggested things, but my iMac still always wakes from sleep and

  • Space management in BW

    Dear All,        I would like to know tables where i can get information on space occupied by cubes,concerned PSAs,indexes,infosources. Yours truly, Ratish

  • My iPad screen has shadow from previous open screen

    Example: When I open Facebook application, I cannot see the photo because the photo blur cause from the previous screen appear as a background of the photo.