Community
Showing results for 
Search instead for 
Do you mean 
Reply

Logon code fails

Accepted Solution Solved
Copper Contributor
Posts: 28
Country: United_Kingdom
Accepted Solution

Logon code fails

 

I have this code which gives a declaration expected error on the last line.  ActFwk is not recognised - no Intellisense. 

Public Class Form1
    Dim ActFwk As New Act.Framework.ActFramework()
    Const ACTPadFile As String = "C:\Users\Public\Documents\ACT\ACT Data\Databases\ACT2013Demo.PAD"

    '* Login to the sample database using default administrator

    ActFwk.logon(ACTPADFile, "peter", "")


End Class

 Any suggestions - presumably there is something wrong with the Dim statement.  Thanks.

 

 

 

 


Accepted Solutions
Solution
Accepted by topic author PeterK
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 28
Country: United_Kingdom

Re: Logon code fails

Thank you - absolutely right !

 

Just for completeness here is the code that compiles and seems to connect:

 

Public Class Form1

    Dim ActFwk As New Act.Framework.ActFramework
    Const ACTPadFile As String = "C:\Users\Public\Documents\ACT\ACT Data\Databases\ACT2013Demo.PAD"

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


        ActFwk.LogOn(ACTPadFile, "chris huffman", "")


    End Sub

End Class

And the other reminders:

You need the Target framework to be .NET 4   - not  .NET4  Client Profile.   (Project -> Properties ->Compile -> Advanced Compile Options).

 

You need to add references for Act.Framework.dll   and Microsoft.Practices.Unity.dll

 

Thank you again.

 

 

 

 

 

 

 

View solution in original post


All Replies
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Logon code fails

Try this

 

Dim ActFwk As Act.Framework.ActFramework
ActFwk = Act.Framework.ActFramework()

 

-- JIm 

Copper Contributor
Posts: 28
Country: United_Kingdom

Re: Logon code fails

Thanks but:

ActFwk = Act.Framework.ActFramework()

 gives a declaration expected message.

 

The login line also, as before, gives the same message.

Nickel Contributor
Posts: 175
Country: USA

Re: Logon code fails

[ Edited ]

The reason it isn't working is because your Logon statement isn't inside a subroutine or function. Your best bet is to add an event handler, such as to the Form Load event, and put the logon statement in there. If this is a plugin, I believe there is a special event/method that you need to put your "initialization" code into (From here it looks like it should be the OnLoad method).

Solution
Accepted by topic author PeterK
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 28
Country: United_Kingdom

Re: Logon code fails

Thank you - absolutely right !

 

Just for completeness here is the code that compiles and seems to connect:

 

Public Class Form1

    Dim ActFwk As New Act.Framework.ActFramework
    Const ACTPadFile As String = "C:\Users\Public\Documents\ACT\ACT Data\Databases\ACT2013Demo.PAD"

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


        ActFwk.LogOn(ACTPadFile, "chris huffman", "")


    End Sub

End Class

And the other reminders:

You need the Target framework to be .NET 4   - not  .NET4  Client Profile.   (Project -> Properties ->Compile -> Advanced Compile Options).

 

You need to add references for Act.Framework.dll   and Microsoft.Practices.Unity.dll

 

Thank you again.