Задайте вопросЗадайте вопрос
 

ОтвеченоOpen an access vba function in a form using javascript

  • 10 июля 2009 г. 23:23Condor10101010101 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Hi,

    I have created an access vba function which I now want the ability to call from a SharePoint page via JavaScript.  Here's what I have thus far:

    function test() {
    var App = new ActiveXObject("Access.Application")
    App.Visible = true;
    App.OpenCurrentDatabase("fullPath");
    App.Run("Module1!test")
    }
    The Module's name is Module1 and the function is called test.  It appears that everything works OK until line:

    App.Visible = true;
    
    
    
    
    Then the problem occurs in the next line:

    App.OpenCurrentDatabase("fullPath");
    
    
    
    
    Has someone tackled this before?  Thank you!


    BTW,  I'm calling the function from a SharePoint page as follows:

    <div>
    	<form>
    		<input type="button" value="Click me!" onclick="test()" />
    	</form>
    </div>
    
    
    
    
    
    
    
    

Ответы

  • 12 июля 2009 г. 7:45BrijrajRathod Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    Hello,

    use below test function in your code. and please go through comments. Thanks.

    function test()
    {
            var App = new ActiveXObject("Access.Application")       
            //use double \\ for path, if required.
            var fullPath="C:\\work Station\\Access Group\\Open Access Using Java Script\\OpenAccessUsingJavaScript.mdb";  
            //first open data base then set property of visible to true.
            App.OpenCurrentDatabase(fullPath);
            App.Visible = true;
            App.Run("test"); // i am calling test procedure, which is public in module, no need to apply module name to call it.
    }
    Rgrds, Brij http://accessvbadeveloper.wordpress.com
    • Помечено в качестве ответаCondor10101010101 13 июля 2009 г. 17:20
    •  

Все ответы