Automation Error with Statistica in VBA macro in Access 2003 - Statistica Visual Basic - Statistica - Dell Community

Automation Error with Statistica in VBA macro in Access 2003

Automation Error with Statistica in VBA macro in Access 2003

This question is answered
We are a German company developing solutions with Statistica for client firms. 
 
In a certain project, we need to integrate a Statistica graph into the application which uses a VBA macro in Microsoft Access 2003. 
 
In Access, Stastica 8.0 is declared and accessed as an application objekt and used for the generation of Statistica graph objects. 
 
With the Desktop version of Statistica (Basis, Professional), the VBA macro in Access works without any problems, and all of the features function as desired. 
 
Unfortunately the same macro does not work with the Enterprise version that our client uses.
 
With the following declaration and line of code, an automation error occurs. 
 
Dim appStat As New STATISTICA.Application
appStat.VISIBLE = False
 
 
Error: 
Microsoft Visual Basic
Laufzeitfehler (English: run-time error): ‚-2147220992 (80040200)’
Dieser Vorgang erfordert eine Verbindung zur STATISTICA-Enterprise-Database, die momentan aber nicht verfuegbar ist. Möglicherweise aufgrund einer fehlerhaften Datenbankverbindung-Information. 
(English: This process requires a connection to the Statistica Enterprise database, that is not accessible at present. This is perhaps because of a defective database connection.)
 
The VBA code, that works with the Desktop version of Statistica,  throws the error with the Enterprise version. 
Perhaps Statistica Enterprise expects an authentication for the Enterprise server, although we do not need to use this in our application. 
 
I would like to ask:
Is automation with the Statistica application objekt, that we need for our client, possible at all with the Enterprise version?
If yes, what do we need to do to get it to function error-free?
 

 

 

Verified Answer
  • A call to Application.SWSInfo() is required.  You need to do it once, immediately after you first instantiate the application object.  

    One method is to pass a specific Enterprise username and password like so (this example is in C#):
     
    STATISTICA.Application app = new STATISTICA.ApplicationClass();
    app.
    SWSInfo("UserName", "Password", "", "", "", "");
     
    To use integrated login you can specify "integrated" as the 6th parameter:
     
    STATISTICA.Application app = new STATISTICA.ApplicationClass();
    app.SWSInfo("", "", "", "", "", "integrated");
All Replies
  • A call to Application.SWSInfo() is required.  You need to do it once, immediately after you first instantiate the application object.  

    One method is to pass a specific Enterprise username and password like so (this example is in C#):
     
    STATISTICA.Application app = new STATISTICA.ApplicationClass();
    app.
    SWSInfo("UserName", "Password", "", "", "", "");
     
    To use integrated login you can specify "integrated" as the 6th parameter:
     
    STATISTICA.Application app = new STATISTICA.ApplicationClass();
    app.SWSInfo("", "", "", "", "", "integrated");