How to start microsof access with parameter through runtime.exec

Hi,
I try to start access with parameter like this:
String[] cmd = new String[4];
cmd[0] = "C:\\Programme\\Microsoft Office\\OFFICE11\\MSACCESS.EXE";
cmd[1]= "C:\\MyDB.mdb ";
cmd[2] = "/cmd";
cmd[3] = "parameter1 parameter2";
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
However the access mdb startet but it seems not to take the parameter i want to put in to access.
Have anyone an Idea, what is wrong here?
Thanks

Hi
What do you expect Access to do?
The /cmd command line option sets the value that is returned by VBA Command function (see http://msdn2.microsoft.com/en-us/library/aa211469(office.11).aspx).
If you want to start a macro, you would need the /x switch (see http://office.microsoft.com/en-us/access/HA101666051033.aspx).
Hope this helps
Christoph

Similar Messages

  • How to exec command with parameters through runtime.exec()

    im trying to run a command prompt passing in parameters. Right now im creating a .bat file like this
    c:
    cd C:\SOMEDIR
    ant deploy moreparameters
    and then passing in the file name into the exec command. It is running fine but im trying to use the runtime.destroy() command and it doesnt close the ant command, it only closes the bat file which was already closed. Is there a command I could pass into the exec() method to run the ant command with the parameters without using a bat file?

    im getting a CreateProcess: ant deploy -Dswasm=swasm error=2
    When i try to do
    cmds[0] = "ant";
    cmds[1] = "deploy";
    cmds[2] = "-Dswasm=all-bs";
    Process p = runTime.exec(cmds, null, new File("C:\\Program Files\\apache-ant-1.6.1\\bin"));
    its like it cant find ant. But it finds java command fine. What should i pass into the second parameter, it says "If envp is null, the subprocess inherits the environment settings of the current process. " Does that mean it will take the window system enviroment variables? if not what string would i pass in to set where ant is?

  • How to start a application with a login window?

    hi there
    does anyone have any idea on how to start an application with a login window? a login window is the first frame or window to be displayed when an application starts running. and only correct login id and password have been entered the real application will start. any sample out there? thank you.

    You can start a new thread by making a thread object and passing it an implementation of a runnable object. Runnable has just one method, public void run(), this is was gets executed in a second thread. perhaps the code you would use would look something like this.
    <code>
    // set up thread for login window
    new Thread(new Runnable() {
    public void run() {
    // construct your login window here
    // when you are done processing the
    // password....
    if(goodPassword) {
    authorized = true; // a global variable
    notifyAll(); // don't forget this
    else {
    System.exit(42);
    }).start();
    // control does not stop this code gets executed while
    // the above thread is running.
    // Set up main program here. This is done in the
    // backround.
    while(!authorized) {
    synchronized(this)
    { wait(50); }
    // now when the user logs in this frame pops
    // up real quick.
    myFrame.setVisible(true);
    </code>
    Hope you can figure it out.. good luck :)

  • Apple tv 2 - root password has been changed to non default.   I need to access apple tv 2.   how do i get access with a forgotten password

    apple tv 2 - root password has been changed to non default.   I need to access apple tv 2.   how do i get access with a forgotten password

    Welcome to the Apple Community.
    It depends on which password you are referring to, but generally speaking you can always restore the Apple TV.

  • How to start java applet with netbeans 6.1

    hey,
    I want to learn how to start java applet (with database) with netbeans.. I'm new to java...can you show me how can i start..if you have any doc about it can you send it to me..thank you..:)

    You really should be asking this NetBeans question at the NB site - these forums are for Java language topics, not NB support.
    [http://www.netbeans.org/kb/61/web/applets.html]
    Almost any NB question you have can be answered by either the NB web documentation or the NB program's Help.

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • Does anyone know how to connect wireless speakers with itunes through airplay?

    Does anyone know how to connect wireless speakers with itunes through airplay? I am not getting the airplay icon in itunes.

    JBL doesn't have any speakers called "Spiral" that I can find, but anyway, perhaps something in this Apple support article on AirPlay troubleshooting will help:
    http://support.apple.com/kb/TS4215
    Regards.

  • How to start Integration server with the user XISUPER

    Hi,
    How to start Integration server with the user XISUPER?
    Regards,

    Mahesh,
    In the post installation document, under Creating User XISUPER,
    I see the following,
    1.You must now log on to the Integration server host with the user XISUPER, to switch the initial password to a valid password.
    2.You must restart the J2EE engine to transfer the user creation to the J2EE immediately.
    I am unable to proceed here.Can you please help me to resume the post installation steps ?
    Thanks,

  • How to create a node with attributes at runtime in webdynpro for ABAP?

    Hi Experts,
             How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
    I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
    I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
    Please help!
    Thanks
    Gopal

    Hi
       I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
    Note
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    My code is like the following:
    TYPES: BEGIN OF t_type,
                CARRID TYPE sflight-carrid,
                CONNID TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
      dyn_node   type ref to if_wd_context_node,
      rootnode_info   type ref to if_wd_context_node_info,
      i_node_att type wdr_context_attr_info_map,
      wa_node_att type line of wdr_context_attr_info_map.
          wa_node_att-name = 'CARRID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
          insert wa_node_att into table i_node_att.
          wa_node_att-name = 'CONNID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
          insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
                                       attributes = i_node_att
                                       is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    Message was edited by: gopalkrishna baliga

  • How to set task description with paragraphs at runtime

    Hi Experts, How to set task description with paragraphs at runtime. Now, i can set single content in task description.however, not sure, how to set content which have paragraphs.

    Hi,
    You can use HTML tags in the Task descritption.
    Open the task not the workflow and there you can provide
    <p> content/containers </>
    You can use even <u>- Underlined text.
    <h> for bold text
    Thanks,
    Sarayoodharan.K

  • Start a new java process using Runtime.Exec() seems to ignore the -Xmx

    I am working with a process that requires a minimum of 1.5 GB to run and works better if more is available.
    So I am determining how much memory is available at startup and restarting the jre by calling
    Runtime.exec("java -Dcom.sun.management.jmxremote=true -Xmx1500M -jar XXX.jar")
    which reinvokes the same process with a new max memory size.
    The initial call to the process is
    java -Dcom.sun.management.jmxremote=true -Xmx3500M -jar XXX.jar
    The initial call returns 3262251008 from Runtime.maxmemory()
    When reinvoked through Runtime.exec() as above
    Runtime.maxmemory() still returns 3262251008
    Is there a way to separate the new process from the size specified by the parent process?

    That is strange. Here is a program I wrote which calls itself recursively.
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.List;
    import java.util.ArrayList;
    import static java.util.Arrays.asList;
    public class MemorySize {
        public static void main(String... args) throws IOException, InterruptedException {
            System.out.println("Maximum memory size= "+Runtime.getRuntime().maxMemory());
            if (args.length == 0) return;
            List<String> cmd = new ArrayList<String>();
            cmd.add("java");
            cmd.add("-cp");
            cmd.add(System.getProperty("java.class.path"));
            cmd.add("-Xmx"+args[0]+'m');
            cmd.add("MemorySize");
            cmd.addAll(asList(args).subList(1,args.length));
            Process p = new ProcessBuilder(cmd).start();
            readin(p.getErrorStream());
            readin(p.getInputStream());
        private static void readin(final InputStream in) {
            new Thread(new Runnable() {
                public void run() {
                    try {
                        byte[] bytes = new byte[1024];
                        int len;
                        while((len = in.read(bytes))>0)
                            System.out.write(bytes, 0, len);
                        in.close();
                    } catch (IOException e) {
                        e.printStackTrace();
            }).start();
    }If you run this with the args 128 96 33 222 it prints out
    Maximum memory size= 66650112
    Maximum memory size= 133234688
    Maximum memory size= 99942400
    Maximum memory size= 35389440
    Maximum memory size= 231014400

  • How to start a Workflow with a Dynpro action button.

    Hi @ all,
    i have the problem, that i want to start a workflow with a self-made dynpro.
    The dynpro consist the following information who had to be transported in the workflow.
    Stacknr.
    User
    Date
    Time
    and a tif data file
    Somebody have an idea how it works?
    i am very new in workflow. So if you want to help me than please with a step by step guide.
    Thanks a lot.
    Regards Phil

    Hi,
    Please go through the wiki. There are plenty of instructions. Also, this is commonly discussed topic, so try to search first. The key for your problem is that there are function modules to tirgger workflows (either directly or with an event).
    Regards,
    Karri

  • Stored Procedure in access with parameter name

    Hi, i'm new in JDBC.
    I came from Ado.Net.
    I want to call a stored procedure in access and set my parameters by name and not by index.
    When i try to call the SP with params by index it works as expected,
    but with param names it give me this exception:
    java.lang.UnsupportedOperationException
    Is there a way to call SP with parameter names?
    BogN,

    Well, it still doesn't work. Here is part of the code, have a look please.
    public DisplayQueryResults() {
       String studattUrl = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D:/StudAtt/StudAtt.mdb";
       String mustbUrl = "jdbc:odbc:mustb";          
       try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          studattConn = DriverManager.getConnection(studattUrl);
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          mustbConn = DriverManager.getConnection(mustbUrl, "sa", "");               
    private void getTable() {
       try {
          stmtStudAtt = studattConn.createStatement(resultSet.TYPE_SCROLL_SENSITIVE, resultSet.CONCUR_READ_ONLY);
          stmtMustb = mustbConn.createStatement();
          CallableStatement callSP = studattConn.prepareCall("{call mustbFaculty}");
          resultSet = callSP.executeQuery();
          displayResultSet(resultSet);
       }

  • How to start developing forms with weblogic server???

    I am a beginner. I saw someone working on developer 6i and I love the ease so I come to oracle. BUT now I find this weblogic server for desktop applications (forms) too.
    1. Please recommend me a book for developing desktop applications in weblogic server.
    2. Is it possible to use Mysql as database while developing forms in weblogic server?
    Many thanks

    I am a beginner. I saw someone working on developer 6i and I love the ease so I come to oracle. BUT now I find this weblogic server for desktop applications (forms) too.You have to keep in mind that Oracle Developer Suite 6i (Forms/Reports) is over 10 years old and was primarily a Client/Server development environment. Yes, a Forms 6i application could be deployed to the web, but infrastruction has changed many times in the 10+ years since Forms 6i was introduced.
    1. Please recommend me a book for developing desktop applications in weblogic server.Are you talking about an Oracle Forms application deployed through the WebLogic application server? If so, take a look at Developing Oracle Forms Applications or Oracle9i Developer: Developing Web Applications with Forms Builder. These are older books, but they will give you the basics of Oracle Forms development. Once you have the basics of Forms Development, then you can refer to the product documentation for specifics on the particular version of Forms you are using:
    Oracle Forms 10g Online Book - Contents or <a href="http://download.oracle.com/docs/cd/E12839_01/index.htm>Oracle Fusion Middleware Documenation LIbrary</a> and select the Portal, Forms, Reports and Discoverer option.
    {quote2. Is it possible to use Mysql as database while developing forms in weblogic server?{quote
    You can use MySQL with your web app only if you are not using Oracle Forms! Oracle Forms will only communicate with an Oracle Database. There are methods available to access data from non-Oracle database, but they involved linking your Oracle Database to the non-Oracle database and accessing the data through the Oracle Database.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to start universe development with excel reports?

    hi,
    I have about 6 reports in excel with the help of which i have to create universe. Please help how to start and how i can make the universe? Examples will help much better.
    How to study the reports and start with development?

    Hi Vaibhav,
    Kindly check the below thread.
    How to create a Universe with excel?
    Regards,
    Tanb Gupta

Maybe you are looking for