Community
Showing results for 
Search instead for 
Do you mean 
Reply

Beginner help - error connecting with SDK

New Member
Posts: 7
Country: USA

Beginner help - error connecting with SDK

[ Edited ]

I have created a .aspx page and I have added C# code from the first example in the SDK to it - "Getting a table name" - to try and make a connection to the database and log in.

 

This is the code that I have right now:

 

<%@ Page Language="C#" %>
<%@ Import Namespace="Act.Framework" %>

<script runat="server">
    ActFramework ACTFM = new ActFramework();
    ACTFM.LogOn("D:\\ACTDB\\SchillerGroundsCareDev.pad","username","password");
</script>

 

I have been going through forum posts and found a few that said to copy certain .dll files over from the /Global Cache/ folder to the /Program Files/ ACT/ directory and I did this.  I found that it was necessary to use this line for referencing the ACT.Framework assembly or it would throw an error.

 

 <%@ Import Namespace="Act.Framework" %>

 

I'm' now getting an error on this line of code:

 

ACTFM.LogOn("D:\\ACTDB\\SchillerGroundsCareDev.pad","username","password);  

 

The error that I'm getting is as follows:

 

CS1519: Invalid token '(' in class, struct, or interface member declaration

 

Is there something wrong with the way that I am passing the path to the .pad file?  What else could be wrong that would cause this line to throw an error?  Could I be missing a reference to an assembly?

 

I am able to connect to the same data source using Visual Studio using this information (from my .udl file):

 

Provider=ACTOLEDB2.1;Data Source=D:\ACTDB\SchillerGroundsCareDev.pad;User ID=ACTService;Password=!act2012sgc!#;Persist Security Info=True

 

Any help that might get me pointed in the right direction is appreciated.

 

Thanks!

 

 

Employee
Posts: 1,163
Country: USA

Re: Beginner help - error connecting with SDK

I could be wrong, but just at a glance it appears there's a quotation mark missing after password. 

 

 

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 7
Country: USA

Re: Beginner help - error connecting with SDK

That was my not copying the entire line when I pasted it in my post.

 

Here is an the same code even more simplified to try to catch any syntax errors:

 

<%@ Page Language="C#" %>

<%@ Import Namespace="Act.Framework" %>
<%@ Import Namespace="Act.Shared.Collections" %>

 

<script runat="server">

    ActFramework ACTFM = new ActFramework();

   

    string pathDB = "D:\\ACTDB\\SchillerGroundsCareDev.pad";
    string userID = "username";
    string pwd = "password";

   

    ACTFM.LogOn(pathDB, userID, pwd);

</script>

 

I am getting an error for this line:

ACTFM.LogOn(pathDB, userID, pwd);

 

What could I be doing wrong.  Could there be a problem with how I am passing the path to the database?

 

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Beginner help - error connecting with SDK

Check out this page. It talks about the generic "Invalid Token" error

 

http://www.velocityreviews.com/forums/t80207-compiler-error-message-cs1519-invalid-token-using-in-cl...

 

-- Jim 

New Member
Posts: 3
Country: United_Kingdom

Re: Beginner help - error connecting with SDK

Hi,

Where did you find the dlls for the ACT SDK.

 

I've downloaded the zip file for ACT 2013 SDK but the dlls are missing (only the documentation is in the zip file).

 

I've downloaded the version 2010, 2011, and 2012 and those zip archives have also only the documentation for the SDK and not the dlls.

 

I tried to find the dlls in "Program Files" of ACT install dir but I could not find "Act.Framework.dll" or "Act.Framework.Contacts.dll"

 

 

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Beginner help - error connecting with SDK

They are located in the GAC folder and you can reference them there.

 

I always copy them from the installation image and move them to a local folder.

 

C:\Act!_Premium_Web_v16\ACTForWeb\GlobalAssemblyCache\

 

 

-- Jim 

Copper Contributor
Posts: 123
Country: Canada

Re: Beginner help - error connecting with SDK

You can get the DLL from the ACT extracted installation files folder:

C:\<wherever you extracted the files to>\Sage ACT! 2013 Premium\ACT_Premium_2013\ACTWG\GlobalAssemblyCache

Then you can put the file in a folder called ActReferences or something easy to find.

The you just have to add the reference to the dll in your project.

Once you have that reference to that DLL you can add the using statements:

 

using Act.Framework;
using Act.Framework.Contacts;
using Act.Framework.Groups;

 and so on.

New Member
Posts: 3
Country: United_Kingdom

Re: Beginner help - error connecting with SDK

Thanks a lot. Now I found them Smiley Happy