Jonathan is right, but I'd suggest going one stage further removed.

Creating a reference is version sensitive - it expects a specific
version of UniObjects. For safety I would use a CreateObject. 

Plus this has the advantage that you can use it inside VBScript (which
in case anyone doesn't know is built into every copy of Windows and
very useful for quick utility scripts).

Assuming the session (Sess) is globally defined ...


Function CreateSession()
   On Error Resume Next
   Err = False
   
   CreateSession = True
   
   Set Sess = CreateObject("UniObjects.UnioaifCtrl.1")
   
   If (Err <> False) Or (Sess Is Nothing) Then

        Err = False
        Set Sess = CreateObjects("uniobjects.session.1")
        If (Err <> False) Or (Sess Is Nothing) Then 
           Err = False  
           Set Sess = CreateObject("universe.session.1")
           If (Err <> False) Or (Sess Is Nothing) Then
                CreateSession = False
           End If
        End If
   End If
End Function


Brian  


Jonathan Leckie <[EMAIL PROTECTED]> wrote on
21.01.2005, 10:03:47:
> There is a solution :
> 
> Don't use the "drag and drop" ActiveX control.
> 
> Instead inside VB do the following. Add in the Project References
> "UniObjects Control 3.0"
> 
> In a module or VB form declare the following
> 
> Public UniSession as New UnioaifCtrl
> 
> you can then use the control in the same way e.g UniSession.Connect.
> Remember to set all the properties such as Host, Username, Password before
> issuing UniSession.Connect.
> 
> Remember when finished to issue the following command
> 
> UniSession.Disconnect
> 
> and set UniSession = Nothing
> 
> This fixes the automation errors.
> 
> ----- Original Message ----- 
> From: "Jonathan Leckie" 
> To: 
> Sent: Monday, January 17, 2005 2:00 PM
> Subject: Uniobjects automation error
> 
> 
> > I'm trying to develop a small application using UniObjects with Visual 
> > Basic 6.0. Program is running on Windows XP connecting to a UniData 
> > database across a TCP/IP connection.
> >
> > I can run the program inside Visual Basic IDE  and the program runs fine 
> > but when the program is compiled I get an automation error:
> >
> > Run-time error '-2147417848 (80010108):
> >
> > Automation error
> > The object invoked has disconnected from its clients
> >
> > Anyone know why this is and how it can be fixed.  I have never seen this 
> > type of problem before.
> > 
> 
> 
> 
> -- 
> 
> ************************************************************************
> * This message has been scanned for viruses and dangerous content by      
> * Blairs of Scotland MailScanner, and is believed to be clean.            
> *                                                                           
> * This email and any files transmitted with it are confidential and 
> * intended solely for the use of the individual or entity to which they
> * are addressed.
> *
> * If you have received this email in error please notify us at Blairs
> * of Scotland via email at [EMAIL PROTECTED]
> ************************************************************************
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to