ACT by sage integration with asp.net [closed]

耗尽温柔 提交于 2019-12-22 08:22:17

问题


Wondering if someone here can help. I have been asked to develop an ASP.Net application which will directly connect (store and retrieve) to the ACT! databse already functional. I am new to ACT and looking for a starting point to integrate it with ASP.Net application. In particular I am looking for answers to the following questions: 1. What database technology is used by ACT? Is SQL Server? In that case, I should be able to connect just like any SQL Server database? 2. Is there any class library or API for .Net from ACT which will help achieve this? 3. Any code example or articles to help implement this will be of great help. Looking forward to responses. Many thanks, Ali


回答1:


I realize this question is pretty old, but I'm posting this for the benefit of any poor souls forced to deal with the ACT Framework.

1: What database technology is used by ACT?
SQL Server (Express or Standard, depending on version & # of users).

Is SQL Server? In that case, I should be able to connect just like any SQL Server database?

Not necessarily. The ACTReader utility (comes with ACT!) will let you create a read only SQL user account to directly your ACT! SQL Server database. You may be able to force your way in but this would probably void any support you might have had from Sage if something goes wrong. Given the heavy joining and funky differences between database column names and interface field names, it might not be a good idea even if you did have sa access.

2: Is there any class library or API for .Net from ACT which will help achieve this?

There might be prewritten wrapper classes out there to simplify the ACT api. I doubt they're free, considering the ACT! help message boards appear to exist mostly for the benefit of ACT! "consultants" to find new clients... Also, you can download the "SDK" from ACT!, but its mostly useless as the examples arent very clear and all the dll files you need to use the .NET ACT! api are installed when you install ACT!

3: Any code example or articles to help implement this will be of great help

I had to learn by bits and pieces of dozens of board postings, but I finally managed to write an C# import utility to grab website contacts from my PHP/MySQL webserver (sorry haven't done any ASP.NET stuff yet). Here is an distilled down example showing just the basics you need to insert a contact into ACT!:

Disclaimer: this is for ACT 2012, unknown if previous or future versions will work the same way

First: ACT! 2010 & 2012 uses .NET 3.5, so Make sure to set your project as such. Also you may have to specify x86 target CPU in your Visual Studio project. Failure to have the correct settings will throw a VersionMismatchError

you need to include references the ACT .dlls, which are in the Global Assembly Cache folders (assuming you have ACT installed on that machine).

For just importing an address, you need the following GAC .dlls:

Act.Framework
Act.Shared.Collections

sample program:

using System;
//etc...

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

namespace ImportToACT
{
    class Program
    {
        static void Main(string[] args)
        {        
            ActFramework ACTFM = new ActFramework();
            ACTFM.LogOn(("\\\\Path\\To\\Your\\padfile.pad"), "Username","Password");

            Contact newContact = ACTFM.Contacts.CreateContact();

            newContact.Company = "Springfield Nuclear Power Plant";
            newContact.FullName = "Homer J Simpson";
            newContact.ContactFields["Contact.Address 1", false] = "742 Evergreen Terrace";
            newContact.ContactFields["Contact.City", false] = "Springfield";
            newContact.ContactFields["Contact.State", false] = "OR";
            newContact.ContactFields["Contact.Country", false] = "United States";
            newContact.ContactFields["Contact.Zip", false] = "90701";
            newContact.ContactFields["Contact.Phone", false] = "(939) 555-0113";
            newContact.ContactFields["Contact.E-mail", false] = "chunkylover53@aol.com";

            newContact.Update();
            ACTFM.LogOff();

            return;
        }        
    }
}

From what I can gather, the ContactFields bool 2nd isReal value determines if you are referencing a real database column (true) or a field name in the act interface (false), which doesnt always correspond to the column name holding field data. I had issues with using the true database column name so I just went the field name route.

Also you will notice that the Contact object has some other properties like FirstName and LastName, but these are read only. For some reason ACT! wants you to enter the FullName and let it parse first, middle and last names.

Good Luck!!




回答2:


This looks like a reasonably good place to start:

http://www.act.com/support/resourcecenter/index.cfm

A quick search reveals you should be able to use oledb and/or ODBC to connect to ACT. It looks like it uses the Pervasive database engine, so there might be something related to that in Google.

Simon



来源:https://stackoverflow.com/questions/2606910/act-by-sage-integration-with-asp-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!