CONTENTS

Section I         ACT! OLE Database Object

Chapter 1       Getting Started with the OLE Database Object.......................................... 17

Conventions used in this section........................................................................... 17

Syntax conventions....................................................................................... 17

Terminology.................................................................................................. 18

Parameter types.................................................................................................. 18

Special data types............................................................................................... 19

Overview of the ACT! OLE Database Object........................................................... 21

Features and limitations of the ACT! OLE Database Object............................... 22

System requirements..................................................................................... 22

Development languages................................................................................. 22

Using the Database Object with Visual C++..................................................... 22

Understanding key files........................................................................................ 24

Using the type library........................................................................................... 25

ACT! Database Unique ID field considerations........................................................ 25

ACT! OLE Database Object definitions.................................................................. 26

ACT! OLE object model........................................................................................ 27

What’s new......................................................................................................... 28

Changes for ACT! 3.0.6.................................................................................. 28

Changes for ACT! 3.0.7.................................................................................. 29

Changes for ACT! 4.0..................................................................................... 29

Changes for ACT! 4.0.2.................................................................................. 30

Changes for ACT! 2000.................................................................................. 30

 


 

Chapter 2       Using Database Object Properties and Methods...................................... 33

Common properties and methods.......................................................................... 34

Add Method.................................................................................................. 38

Close Method................................................................................................ 39

Data Property................................................................................................ 39

Delete Method............................................................................................... 40

Edit Method.................................................................................................. 41

Error Property............................................................................................... 41

Execute Method............................................................................................ 42

FieldCount Property....................................................................................... 42

Fields Property.............................................................................................. 43

FindDuplicates Method (requires ACT! 2000 or later)......................................... 43

GetDataEx Method (requires ACT! 4.0.2 or later).............................................. 44

GetDuplicateCriteria Method (requires ACT! 2000 or later)................................. 46

GetSort Method (requires ACT! 4.0 or later)...................................................... 47

GoTo Method................................................................................................ 48

IsBOF Property............................................................................................. 48

IsEOF Property............................................................................................. 49

IsLocked Property......................................................................................... 49

IsOpen Property............................................................................................ 49

Jump Method................................................................................................ 50

LastError Property......................................................................................... 50

LockLevel Property........................................................................................ 51

Lookup Method............................................................................................. 51

LookupKeyword Method................................................................................. 52

MoveFirst Method.......................................................................................... 53

MoveLast Method.......................................................................................... 53

MoveNext Method.......................................................................................... 53

MovePrevious Method.................................................................................... 54

Name Property.............................................................................................. 54

Position Property........................................................................................... 54

Query Property.............................................................................................. 55

Rebuild Method............................................................................................. 55

RecordCount Property.................................................................................... 55

SetDataEx Method (requires ACT! 4.0.2 or later).............................................. 56

SetDuplicateCriteria Method (requires ACT! 2000 or later).................................. 57

Sort Method.................................................................................................. 58

Update Method.............................................................................................. 59

 

Activity object properties and methods.................................................................. 60

Clear Method................................................................................................ 62

ClearClearedFilter Method.............................................................................. 62

ClearContactScope Method............................................................................ 62

ClearDateScope Method................................................................................ 63

ClearGroupScope Method.............................................................................. 63

ClearPriorityFilter Method............................................................................... 63

ClearRecurring Method................................................................................... 64

ClearTimedFilter Method................................................................................ 64

ClearTimelessFilter Method............................................................................ 64

ClearTypeFilter Method.................................................................................. 65

ClearUnclearedFilter Method........................................................................... 65

ExceptionInfo Property................................................................................... 65

FirstScheduledWith Property.......................................................................... 66

GetDaysOfMonthBits Method......................................................................... 67

GetDaysOfWeekBits Method.......................................................................... 68

GetRecurringFrequency Method...................................................................... 69

GetRecurringUntilDate Method........................................................................ 70

GetWeeksOfMonthBits Method...................................................................... 71

HasAlarm Method.......................................................................................... 72

HasDetails Method (requires ACT! 2000 or later)............................................... 72

IsClear Method.............................................................................................. 73

IsOutlookActivity Method (requires ACT! 2000 or later)...................................... 73

IsRecurring Method........................................................................................ 74

IsTimeless Method........................................................................................ 74

NextScheduledWith Property (requires ACT! 4.0 or later)................................... 75

RecurringChangeMode Property...................................................................... 76

recurringType Property................................................................................... 76

SetClearedFilter Method................................................................................. 77

SetContactScope Method.............................................................................. 77

SetDateScope Method................................................................................... 78

SetGroupScope Method................................................................................. 79

SetPriorityFilter Method................................................................................. 79

SetRecurringDays Method.............................................................................. 80

SetRecurringDaysAndWeeksofMonth Method.................................................. 80

SetRecurringWeekDays Method..................................................................... 82

SetTimedFilter Method................................................................................... 83

SetTimeless Method...................................................................................... 83

SetTimelessFilter Method............................................................................... 83

SetTypeFilter Method..................................................................................... 84

SetUnclearedFilter Method............................................................................. 84

Unclear Method............................................................................................. 85

Contact object methods....................................................................................... 86

LoadLookUpQuery Method (requires ACT! 3.0.6 or later)................................... 86

LookupMyRecord Method (requires ACT! 2000 or later)..................................... 86

SetAsMyRecord Method (requires ACT! 4.0 or later)......................................... 87


 

Database object properties and methods............................................................... 89

ActiveUserCount Property.............................................................................. 91

Activity Property............................................................................................ 91

ActVersion Method (requires ACT! 3.0.6 or later).............................................. 92

BeginBatchInsert Method (requires ACT! 4.0.2 or later)..................................... 92

BeginBatchUpdate Method (requires ACT! 4.0.2 or later)................................... 93

Close Method................................................................................................ 95

Contact Property........................................................................................... 95

CurrentUser Property..................................................................................... 95

DatabaseVersion Method (requires ACT! 4.0 or later)........................................ 96

Email Property.............................................................................................. 96

EndBatchInsert Method (requires ACT! 4.0.2 or later)........................................ 97

EndBatchUpdate Method (requires ACT! 4.0.2 or later)...................................... 97

GetDatabasePath Method (requires ACT! 4.0 or later)....................................... 97

GetTableId Method (requires ACT! 3.0.6 or later)............................................... 98

GetTableNameFromId Method (requires ACT! 3.0.6 or later)............................... 99

GetTableNameFromIndex Method (requires ACT! 3.0.6 or later)......................... 99

GetUniqueId Method.................................................................................... 100

Group Property............................................................................................ 100

IsInBatchMode Property (requires ACT! 4.0.2 or later)..................................... 100

IsLocked Property (requires ACT! 4.0.2 or later).............................................. 101

IsMultiUser Property.................................................................................... 101

IsOpen Property.......................................................................................... 101

IsOpening Property...................................................................................... 102

Lock Method (requires ACT! 4.0.2 or later)..................................................... 102

LogTransactions Property............................................................................. 103

MajorVersion Property.................................................................................. 103

MinorVersion Property.................................................................................. 104

Name Property............................................................................................ 104

NoteHistory Property.................................................................................... 104

Open Method.............................................................................................. 105

OpenEx Method (requires ACT! 4.0 or later)................................................... 105

PhoneFormatting Property............................................................................ 106

Relations Property (requires ACT! 3.0.6 or later)............................................. 106

TableCount Method (requires ACT! 3.0.6 or later)............................................ 107

Unlock Method (requires ACT! 4.0.2 or later).................................................. 107

Users Property............................................................................................ 107

ValidateUser Method.................................................................................... 108

Version Property (requires ACT! 3.0.6 or later)................................................ 109

Email object methods........................................................................................ 110

ClearContactScope Method (requires ACT! 3.0.7 or later)................................ 110

SetContactScope Method (requires ACT! 3.0.7 or later)................................... 110

ExceptionInfo object properties and methods........................................................ 112

Add Method................................................................................................ 112

Clear Method............................................................................................... 113

Count Property............................................................................................ 113

Remove Method........................................................................................... 113

Seek Method............................................................................................... 114

Value Method.............................................................................................. 114

Fields object properties and methods.................................................................. 115

AutoPopulate Property (requires ACT! 2000 or later)........................................ 116

BeginBatch Method (requires ACT! 4.0.2 or later)............................................ 117

Count Property............................................................................................ 118

DecimalPlaces Property............................................................................... 119

EndBatch Method (requires ACT! 4.0.2 or later).............................................. 119

EntryRule Property (requires ACT! 4.0.2 or later)............................................. 119

EntryTrigger Property................................................................................... 120

Exists Property........................................................................................... 121

ExitTrigger Property..................................................................................... 121

FieldId Property (requires ACT! 3.0.7 or later)................................................. 122

FieldIdAt Property (requires ACT! 3.0.6 or later).............................................. 122

Flags Property............................................................................................. 123

GetLinkToList Method (requires ACT! 2000 or later)......................................... 123

HasPopupList Property................................................................................ 124

Id Property.................................................................................................. 125

InitialValue Property..................................................................................... 125

IsBlockSync Property.................................................................................. 125

IsCutHistory Property................................................................................... 126

IsIndexed Property....................................................................................... 126

IsPrimary Property....................................................................................... 127

IsSortable Property...................................................................................... 127

Label Property............................................................................................. 128

Length Property........................................................................................... 128

Modifiable Property...................................................................................... 129

PopUpInfo Property.................................................................................. 129

SetLinkToList Method (requires ACT! 2000 or later)......................................... 130

Type Property.............................................................................................. 131

UnLinkLists Method (requires ACT! 2000 or later)............................................ 132

Group object properties and methods.................................................................. 134

AddContact Method..................................................................................... 135

AddSubGroup Method (requires ACT! 2000 or later)........................................ 135

AssignParent Method (requires ACT! 2000 or later)......................................... 136

ChangeToParentGroup Method (requires ACT! 2000 or later)............................ 137

ChangeToSubGroup Method (requires ACT! 2000 or later)................................ 137

ClearContactScope Method (requires ACT! 3.0.7 or later)................................ 138

ContactCount Property................................................................................. 138

GetParent Method (requires ACT! 2000 or later).............................................. 139

GetSubGroup Method (requires ACT! 2000 or later)......................................... 139

GetSubGroupCount Method (requires ACT! 2000 or later)................................ 140

GetSubGroupList Method (requires ACT! 2000 or later).................................... 141

GroupType Method (requires ACT! 2000 or later)............................................. 142

Members Property....................................................................................... 143

RemoveContact Method............................................................................... 143

SetContactScope Method (requires ACT! 3.0.7 or later)................................... 143

ListTable object methods.................................................................................... 145

ClearScope Method (requires ACT! 2000 or later)............................................ 145

GetScope Method (requires ACT! 2000 or later).............................................. 146

SetScope Method (requires ACT! 2000 or later).............................................. 146

Members object properties................................................................................. 148

Name Property............................................................................................ 149

UniqueId Property........................................................................................ 149

NoteHistory object methods................................................................................ 150

History types............................................................................................... 150

ClearAttachmentFilter Method....................................................................... 152

ClearContactScope Method.......................................................................... 152

ClearGroupScope Method............................................................................. 152

ClearHistoryFilter Method............................................................................. 153

ClearNoteFilter Method................................................................................. 153

SetAttachmentFilter Method......................................................................... 153

SetContactScope Method............................................................................. 154

SetGroupScope Method............................................................................... 154

SetHistoryFilter Method................................................................................ 155

SetNoteFilter Method................................................................................... 155

PopupInfo object properties and methods............................................................. 156

Add Method................................................................................................ 156

Clear Method............................................................................................... 157

PopupCount Property................................................................................... 157

Remark Method........................................................................................... 158

Remove Method........................................................................................... 158

Value Method.............................................................................................. 158

Relations object properties and methods.............................................................. 160

Count Property (requires ACT! 3.0.6 or later).................................................. 161

GetColumn1ID Method (requires ACT! 3.0.6 or later)....................................... 162

GetColumn2ID Method (requires ACT! 3.0.6 or later)....................................... 162

GetRelationType Method.............................................................................. 162

GetTable1ID Method (requires ACT! 3.0.6 or later)........................................... 163

GetTable2ID Method (requires ACT! 3.0.6 or later)........................................... 163

UsesRelationTable Method (requires ACT! 3.0.6 or later)................................. 163

Sales object methods........................................................................................ 165

AssociateWithContact Method (requires ACT! 2000 or later)............................ 165

AssociateWithGroup Method (requires ACT! 2000 or later)............................... 166

CompleteSale Method (requires ACT! 2000 or later)........................................ 167

ReopenSale Method (requires ACT! 2000 or later)........................................... 168

Users object properties and methods................................................................... 170

Access Property.......................................................................................... 171

AddUser Method (requires ACT! 4.0 or later)................................................... 171

CheckIsPhonebook Method (requires ACT! 4.0 or later)................................... 173

Count Property............................................................................................ 174

CurrentUserAccess Method (requires ACT! 3.0.6 or later)................................ 174

CurrentUserId Method (requires ACT! 3.0.6 or later)......................................... 174

CurrentUserName Method (requires ACT! 3.0.6 or later)................................... 175

CurrentUserSecurity Method (requires ACT! 3.0.6 or later)............................... 175

Exists Property........................................................................................... 176

GetPassword Method (requires ACT! 4.0 or later)............................................ 176

IsValidPassword Method.............................................................................. 177

Name Property............................................................................................ 177

Security Property......................................................................................... 178

SetAsPhonebook Method (requires ACT! 4.0 or later)...................................... 178

SetPassword Method................................................................................... 179

UniqueId Property........................................................................................ 179


Chapter 3       OLE Database Object Error Codes........................................................... 181



 


 

 

 

CHAPTER  I-1

Getting Started with the OLE Database Object

This section consists of three chapters that describe the ACT!TM OLE Database Object component of the ACT! Software Development Kit (SDK). It is written for programmers who want to use the ACT! OLE Database Object to build applications that can interact with an ACT! database.

To use this section, you need to be familiar with and using the following:

·         ACT! for Windows, version 3.0.3 or later

·         Microsoft Windows 95, Windows 98, Windows 2000, or Windows NT 4.0

·         Microsoft Visual Basic, version 4.0 or later, or Microsoft Visual C++ 4.0 or later

Microsoft Visual Basic for Applications can be used as an alternative development language to access data in Microsoft Access and Excel versions in Microsoft Office 95, and Microsoft Access, Excel and Word versions in Microsoft Office 97 through Office 2000.

Conventions used in this section

This section provides syntax conventions and terminology used in this section.

Syntax conventions

bold                                   Command names, function names, properties, methods, and other text you need to type are shown in bold.

ALL CAPITALS                File names and messages are shown in all CAPITAL letters.

Courier                          Example code is shown in a monospaced Courier font. Comments in the code are preceded by an apostrophe ('Comment). If a line of code does not fit on a single line of the page, the remaining code is indented on the next line. Code examples are not case sensitive.

italic                                  Parameters, return variables, data structure names and text that represent the type of text to be entered rather than a literal series of characters are shown in italic.

[brackets]                          Optional items in syntax statements are enclosed in brackets ([ ]). For example, [password] indicates that a password can be used with the command, but is not required. In commands, include the information within the brackets, without the brackets.

Parameter1|Parameter2     Parameters are separated by a vertical bar (|) to indicate a mandatory choice between two items. Only one of the items can be specified.

Items that you can repeat are indicated by an ellipsis (… ) For example, devicename [...] indicates that you can optionally specify more than one device, separating the device names with a space.

Terminology

ACT! database                   The term database, in relation to an ACT! database, refers to the set of tables and their associated indexes in an ACT! database.

Table                                  The term table refers to a specific table in an ACT! database.

Parameter types

The following table lists the data types that are referenced in this section. Parameter names follow Hungarian notation, beginning with a lowercase letter or letters that indicate the data type.

Parameter syntax

Data type

date

Date and time in Short Date style and Time style from Windows Regional Settings (DATE in Visual C++)

iParameter

Short integer

lParameter

Long integer

szString

String, terminated by a null character (BSTR in Visual C++)

True|False

Boolean

vParameter

Variant (VARIANT in Visual C++)

Special data types

This section describes the format for date and time values and phone numbers used by the OLE Database Object, which is different from the native format used to store this information in an ACT! database.

Date and time formats

The OLE Database Object gets and returns date and time values formatted according to Windows Regional Settings Short Date style and Time style.

Using the regional settings for the United States, for example, the date and time is formatted as follows:

M/d/yy h:mm:ss tt          example: 8/19/97 6:28:29 PM

Using the regional settings for Australia, for example, the date and time is formatted as follows:

d/MM/yy H:mm:ss         example: 19/08/97 18:28:29

Date and time field values must be in the following ranges:

Portion

Description

Range

yyyy

Year

1970 - 2038

MM

Month (January = 01)

01 - 12

dd

Day

01 - 31

hh

Hours after midnight

00 - 23

mm

Minutes after hour

00 - 59

ss

Seconds after minute

00 - 59

Phone formats

The OLE Database Object returns phone numbers in the default of the canonical address format, or formatted as displayed in the ACT! application, depending on the value set by the PhoneFormatting property of the Database object.

When setting data in a phone field, the OLE Database Object accepts only a TAPI canonical-formatted phone number.

A canonical address is an ASCII string with the following structure:

+CountryCode space [(AreaCode) space] SubscriberNumber

The phone number string is continuous with the exception of exactly one space after CountryCode and exactly one space after the optional AreaCode.

+                               ASCII Hex (2B). Indicates that the number that follows uses the canonical format.

CountryCode            A variable length string containing only the digits 0-9. It identifies the country in which the address is located.

space                         Exactly one ASCII space character (0x20). The space is used to delimit the end of the CountryCode part of an address.

[(AreaCode) space]   A variable length string containing only the digits 0-9. The optional AreaCode is the area code part of the address. If present, it must enclosed in parentheses and followed by a space as a delimiter.

SubscriberNumber    A variable length string containing the digits 0-9 and formatting characters, including any of the following dialing control characters:

AaBbCcDdPpTtWw*#!,@$?

The subscriber number cannot contain the left parenthesis or right parenthesis character (which is used only to delimit the area code), and cannot contain the “|”, “^”, or CRLF characters, which are used to begin the following fields. Most non-digit characters in the subscriber number are spaces, periods (“.”), and dashes (“-”).

The following is an example of an Australian phone number in TAPI canonical format, with a breakdown of its different parts:

   +61 (3) 8236887

Country Code                61 (Australia)
Area Code                    3
Subscriber Number        8236887

For a complete list of country codes and default formats look at the PHONE.FMT file. This file is installed in the ACT folder.

Caution: Do not modify the PHONE.FMT file.

Overview of the ACT! OLE Database Object

Developers can access and manipulate ACT! data using the ACT! OLE Database Object. The primary function of the OLE Database Object is to allow non-ACT! applications to open and access an ACT! database. The design of the OLE Database Object helps maintain the integrity of the ACT! database, including its indexes and tables, when a foreign application accesses it. It also allows for simultaneous access to the ACT! databases by foreign applications while ACT! has the database open.

How can developers use an ACT! OLE Database Object?

The goal of the OLE Database Object is to allow developers to access an ACT! database for reading, changing, adding, and deleting data in an integral manner. Using the OLE Database Object ensures that when an ACT! database is accessed to read or change data, all default values and rules will operate, unless the defaults are intentionally overwritten. Also, the OLE Database Object provides developers with a set of tools in the form of OLE automation objects with associated methods and properties.

Note: Direct access to ACT! databases via other application drivers or direct manipulation performed inside foreign applications is not documented or supported and is highly discouraged.

How does the OLE Database Object affect the ACT! user interface?

This object provides only for data access and has no links to the ACT! user interface in the OLE Database Object. ACT! user interface access is provided by the ACT! OLE Application Object. You may notice, however, that if you have a foreign program that uses the OLE Database Object to add data, the ACT! UI can detect the update in its views if that database is open.

Note: The OLE Database Object requires the proper version of ACT! be installed on the user’s system.

Is the OLE Database Object a database tool for developing applications that can access ACT! data?

YES! The OLE Database Object is a set of interfaces and other tools for building applications that can interact with an ACT! 3.0 or later database. OLE facilitates application integration by defining a set of standard interfaces (groupings of semantically related functions) through which one application accesses the services of another.

Features and limitations of the ACT! OLE Database Object

The OLE Database Object only works with 32-bit developer tools, such as Microsoft Visual Basic 4.0 or later, Microsoft Visual C++ 4.0 or later, or Microsoft Visual Basic for Applications.

The OLE Database Object provides the following functions:

·         The ability to open and close the database

·         Access to all data table objects

·         Table navigation methods

·         Table properties and field attributes

·         Field data retrieval and assignment

·         Lookups

·         Sorting

·         Support for multiple ACT! databases opened at the same time by a single OLE application

The OLE Database Object does not provide the following functions:

·         Creation of new databases

·         Scheduling an activity with more than one contact

System requirements

Before you use the ACT! OLE Database Object, you should have the following applications already installed on your computer:

·         ACT! for Windows, version 3.0.3 or later. We recommend using the latest update. To receive an update, choose ACT! Update from the Help menu.

·         Microsoft Windows 95, Windows 98, Windows 2000, or Windows NT 4.0.

Development languages

Many programmers who work with the OLE Database Object work with Microsoft Visual Basic. Hence, most of the examples in the documentation of the database object are designed for the Visual Basic programmer. However, a type library is supplied and consequently, the integrated development environment (IDE) of Microsoft Visual C++ can be used to automatically generate prototypes for the object methods.

Using the Database Object with Visual C++

The following basic steps can help you get started using ACT! automation libraries using Microsoft Visual C++ 4.0 or later and Microsoft Foundation Class (MFC) library. To use the OLE Database Object in an application written using Visual C++, you first need to first create a wrapper class around the OLE objects supported by the OLE Database Object.

To create a wrapper class:

1        Create a new MFC project and enable OLE automation.

2       Open the class wizard and click Add Class.

3       Select the From Type Library option.

4       When prompted for the name of the type-library, choose ACTOLE.TLB from the ACT! program files folder. The Confirm Classes dialog appears.

5       Click OK or select only those classes that you need, then click OK.

Visual C++ will automatically generate MFC wrapper classes for all methods and properties supported by the OLE Database Object.

For more information on how to use OLE automation in Visual C++, see Visual C++ online help.

Example VISUAL C++ code

IDatabase Database;

Database.CreateDispatch("ACTOLE.DATABASE", pException);

Database.Open("c:\\act\\database\\act5demo.dbf");

m_ListBox.ResetContent();

if( Database.GetIsOpen() )

{

   // Attach to the GROUP object.

   IGroup Group  ;

   LPDISPATCH groupDispatch = Database.GetGroup();

   Group.AttachDispatch(groupDispatch, TRUE);

   // Enumerate all of the GROUPS.

   Group.MoveFirst();

   while( !Group.GetIsEOF() )

   {

       CString szOutput;

       ConvertVariantToString( Group.GetData(GF_Name), szOutput);

          m_ListBox.AddString( szOutput );

       // If there are contacts for this group enumerate them.

       if( Group.GetContactCount() > 0 )

       {

          // Attach to the MEMBERS object.

          IMembers Members;

          LPDISPATCH membersDispatch = Group.GetMembers();

          Members.AttachDispatch(membersDispatch, TRUE);

              Members.MoveFirst();

          while( !Members.GetIsEOF() )

          {

              CString memberString;

              memberString.Format("--> %s", Members.GetName());

              m_ListBox.AddString(memberString);

              Members.MoveNext();

          }

       }

       Group.MoveNext();

   }

   Group.ReleaseDispatch();

   Database.Close();

   Database.ReleaseDispatch();

}

else

{     

   AfxMessageBox("database did not open");

}     

Note:   This example assumes that you are logging on to a single-user database.

Using properties in Visual C++

For each property, the ACT! Database Object creates corresponding sets of Get and Set methods in an MFC wrapper class. Read-only properties, however, have only a Get method. If you are using Visual C++, check the C++ header file generated by Visual C++ (ACTOLE.H) for the methods that correspond to properties documented in this manual.

The following table lists examples of properties and corresponding methods to use in Visual C++.

Property Name

Type

VISUAL C++ Method

Database.ActiveUserCount

Read Only

Database.GetActiveUserCount()

Activity.NextScheduledWith

Read/Write

Activity.GetNextScheduledWith()
(to get the value of the property)

Activity.SetNextScheduledWith()
(to get the value of the property)

Understanding key files

The following table lists key ACT! files used by the ACT! OLE Database Object. These files are stored in the ACT! program files folder.

File

Description

ACTOLE.DLL

OLE library containing the ACT! OLE Database Object.

ACTOLE.TLB

Type library that contains functions within the ACT! OLE Database Object. Methods contained in the type library need to be used directly by Visual C++ developers. In Visual Basic type library functions are handled automatically at run time.

ACTEVENT.OCX

OLE event notification control module, used by third-party applications for receiving event notification. An event is generated, for example, when the contact is changed in the Contact View.

ACTREG.EXE

The ACT! Windows registry update utility. This utility can be run manually if necessary to register ACT! OLE controls as a troubleshooting procedure.

Using the type library

Support is provided for ACT! 3.0, ACT! 4.0, and ACT! 2000 data access within a 32-bit development environment for ACT! 3.0 or later. The OLE Database Object (ACTOLE.DLL) is an OLE automation server with objects implemented as a Windows dynamic link library of methods and properties used to simplify communications between OLE programmable languages and an ACT! database. The object is a Visual C++ programmed module using internal buffers to move information to and from the database. If you add or change information, you will fill a buffer with the appropriate data, and then call a method to move the data into the ACT! database. If you request information from the OLE Database Object, buffered data will be returned to your client application. The ACTOLE.DLL makes calls into the ACT! database layer ADAL.DLL. The ACTOLE.DLL and type library ACTOLE.TLB are installed with the ACT! application and placed in the ACT folder.

The database object provided with ACT! 2000 is incompatible with the databases in ACT! 3.0 or ACT! 4.0 format. Before you use the ACT! 2000 database object, you must convert ACT! 3.0 and ACT! 4.0 databases into ACT! 2000 format.

ACT! Database Unique ID field considerations

ACT! database Unique ID field values are created by calculating a unique value, then modifying it to contain printable characters. The resulting value is a left-justified string, which is padded with enough trailing spaces to complete the 12 character fixed-length Unique ID field. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

Caution: Do not use the Visual Basic Trim function or any other method to trim the length of the Unique ID string, or the resulting Unique ID will be invalid.

ACT! OLE Database Object definitions

The ACT! OLE Database Object defines the following objects:

Object

Definition

Activity object

This object contains scheduled activity information for the active Database object.

Contact object

This object contains information about the ACT! contacts.

Database object

This is the OLE creatable object that contains the ACT! database information and objects. This is the programmable interface for Activity, Contact, Email, Group, and NoteHistory objects.

Email object

This object contains e-mail information for the active Database object.

ExceptionInfo object

This object contains the recurring exception information for a particular activity.

Fields object

This object contains the data properties for a specified ACT! field.

Group object

This object contains group and membership information for the active Database object.

ListTable object

This object contains product, product type, and main competitor data for use by the Sales object in ACT! 2000 or later.

Members object

This object contains membership information for the active Group object.

NoteHistory object

This object contains notes and historical information for the active Database object.

PopupInfo object

This object contains the popup information for a valid field.

Relations object

This object contains relational information between table objects of the active Database object.

Sales object

This object contains data for sales process management for the active Database object in ACT! 2000 or later.

Users object

This object contains the user information for the active Database object.

ACT! OLE object model

The following chart shows the relationships of objects in the ACT! OLE Database Object model:

 

 


What’s new

The ACT! OLE Database Object requires ACT! 3.0.3 or later. This section lists changes to the OLE Database Object for ACT! releases 3.0.6, 3.0.7, 4.0, 4.0.2, and 2000.

Changes for ACT! 3.0.6

The Relations object and the following properties and methods have been added for ACT! 3.0.6:

Object

New Properties

New Methods

Contact

 

LoadLookUpQuery

Database

Relations

ActVersion
GetTableId
GetTableNameFromId
GetTableNameFromIndex
TableCount
Version

Fields

FieldIdAt

 

Relations (new)

Count

GetColumn1ID
GetColumn2ID
GetRelationTable
GetRelationType
GetTable1ID
GetTable2ID
UsesRelationTable

Users

 

CurrentUserAccess
CurrentUserId
CurrentUserName
CurrentUserSecurity

Additional parameters have been documented for the following properties:

Object

Properties

Added parameters

ACT! database common objects

Data property
Query property

szValue (optional)
szString (optional)

Activity object

FirstScheduledWith property

szUniqueID (optional)

Database object

PhoneFormatting property

iValue (optional)

Fields object

DecimalPlaces property

iDecPlace (optional)

 

EntryTrigger property

szExecutableName (optional)

 

ExitTrigger property

szExecutableName (optional)

 

Flags property

lFlag (optional)

 

IsBlockSync property

True|False

 

Label property

szLabel (optional)

 

Type property

iType (optional)

Users object

Security property

lValue (optional)

Changes for ACT! 3.0.7

The following methods have been added to the ACT! OLE Database Object for ACT! 3.0.7:

Object

New Properties

New Methods

Email

 

ClearContactScope
SetContactScope

Fields

FieldId

 

Group

 

ClearContactScope
SetContactScope

Changes for ACT! 4.0

The following properties and methods have been added for ACT! 4.0:

Object

New Properties

New Methods

ACT! database common objects

 

GetSort

Activity

NextScheduledWith

 

Contact

 

SetAsMyRecord

Database

 

GetDatabasePath
DatabaseVersion
OpenEx

Users

 

AddUser
GetPassword
CheckIsPhonebook
SetAsPhonebook

Changes for ACT! 4.0.2

The following functions have been added to the ACT! OLE Database Object for ACT! 4.0.2:

·         Batch mode operations for faster import and update operations on locked ACT! databases.

·         Functions for getting and setting data to multiple fields in ACT! database tables in one operation.

·         Set function added to the IsCutHistory property of the Fields object.

The following properties and methods have been added for ACT! 4.0.2:

Object

New Properties

New Methods

ACT! database common objects

 

GetDataEx
SetDataEx

Database

IsInBatchMode
IsLocked

BeginBatchInsert
BeginBatchUpdate
EndBatchInsert
EndBatchUpdate
Lock
Unlock

Fields

EntryRule

BeginBatch
EndBatch

Changes for ACT! 2000

The following objects have been added for ACT! 2000:

·         ListTable object

·         Sales object

The following properties and methods have been added for ACT! 2000:

Object

New Properties

New Methods

ACT! database common objects

 

FindDuplicates
GetDuplicateCriteria
LookupKeyword
SetDuplicateCriteria

Activity

 

HasDetails
IsOutlookActivity

Contact

 

LookupMyRecord

Fields

AutoPopulate

GetLinkToList
SetDuplicateCriteria
SetLinkToList
UnLinkLists

Group

 

AddSubGroup
AssignParent
ChangeToParentGroup
ChangeToSubGroup
GetParent
GetSubGroup
GetSubGroupCount
GetSubGroupList
GroupType

ListTable

 

ClearScope
GetScope
SetScope

Sales

 

AssociateWithContact
AssociateWithGroup
CompleteSale
ReopenSale



CHAPTER I-2

Using Database Object Properties and Methods

This chapter contains descriptions of the different properties and methods that apply to the various ACT! OLE database objects. The chapter is divided into sections devoted to the following ACT! Database Object properties and methods:

·         Common properties and methods applying to more than one object

·         Activity object properties and methods

·         Contact object methods

·         Database object properties and methods

·         Email object methods

·         ExceptionInfo object properties and methods

·         Fields object properties and methods

·         Group object properties and methods

·         ListTable object methods (require ACT! 2000 or later)

·         Members object properties

·         NoteHistory object methods

·         PopupInfo object properties and methods

·         Relations object properties and methods

·         Sales object methods (require ACT! 2000 or later)

·         Users object properties and methods

Most sections show a list of properties and a list of methods in table form (some have only one of each), followed by an alphabetized list combining these properties and methods, which supplies details and, in some cases, examples. “See also” cross references are provided that refer to other properties and methods within the same object unless another object is listed.

Common properties and methods

The following common properties and methods apply to more than one ACT! database object. The database objects the property or method applies to are listed in the following table.

Properties

Property name

Objects

Parameter(s)

Parameter type(s)

Value type

Access

Data

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

iFieldID
[, szValue]

Short Integer, String

Date/Variant

Read/Write

Error

Activity, Contact, Database, Email, ExceptionInfo, Fields, Group, ListTable, Members, NoteHistory, PopupInfo, Relations, Sales, Users

None

 

Boolean

Read Only

FieldCount

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Short Integer

Read Only

Fields

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Object/
LPDISPATCH

Read Only

IsBOF

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Boolean

Read Only

IsEOF

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Boolean

Read Only

IsLocked

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Boolean

Read Only

IsOpen

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Boolean

Read Only

LastError

Activity, Contact, Database, Email, ExceptionInfo, Fields, Group, ListTable, Members, NoteHistory, PopupInfo, Relations, Sales, Users

None

 

Short Integer

Read Only

LockLevel

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Short Integer

Read Only

Name

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

String

Read Only

Position

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Long Integer

Read Only

Query

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

szString

String

String

Read/Write

RecordCount

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Long Integer

Read Only

Methods

Method name

Objects

Parameter(s)

Parameter type(s)

Return type

Add

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Void

Close

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Void

Delete

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Void

Edit

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

Void

Execute

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Void

FindDuplicates

Contact, Group

None

 

Void

GetDataEx

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

iFieldArray, szValueArray

Short Integer,
String

Void

GetDuplicateCriteria

Contact, Group

iField1ID,
iField2ID,
iField3ID

Short Integer,
Short Integer,
Short Integer,

Short Integer

GetSort

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

iField1ID, iDirection1,
iField2ID, iDirection2,
iField3ID, iDirection3

Short Integer,
Short Integer,
Short Integer,
Short Integer,
Short Integer,
Short Integer

Short Integer

GoTo

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

szUniqueID

String

Void

Jump

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

lValue

Long Integer

Void

Lookup

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

iFieldID, szKeyword, iLookupType

Short Integer, String,
Short Integer

Void

LookupKeyword

Contact, Email, Group, NoteHistory

szKeyword

String

Void

MoveFirst

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Void

MoveLast

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Void

MoveNext

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Void

MovePrevious

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Void

Rebuild

Activity, Email, Group, ListTable, Members, NoteHistory, Sales

None

 

Void

SetDataEx

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

iFieldArray, szValueArray

Short Integer,
String

Void

SetDuplicateCriteria

Contact, Group

iFieldID1,
iFieldID2,
iFieldID3

Short Integer,
Short Integer,
Short Integer

Void

Sort

Activity, Contact, Email, Group, ListTable, Members, NoteHistory, Sales

iField1ID, iDirection1,
iField2ID, iDirection2,
iField3ID, iDirection3

Short Integer,
Short Integer,
Short Integer,
Short Integer,
Short Integer,
Short Integer

Void

Update

Activity, Contact, Email, Group, ListTable, NoteHistory, Sales

None

 

String

Add Method

Description    Adds a new record with default field values in the current object.

Note: Use the AddSubGroup method in the Group object to add a subgroup record.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Add

Comments     Creates a new record buffer with default field values so that field data can be assigned using the Data property. The new record is committed using the Update method or aborted if any record navigational method is called.

See also         Data, Delete, GoTo, Move…, Update
FirstScheduledWith, NextScheduledWith in Activity object

Example        

'VB This example demonstrates how to add a new contact record.

dim objData as object

dim szUniqueId as string

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.CONTACT.Add

'Set field data

objData.CONTACT.Data CF_Company, "WhatCo"

objData.CONTACT.Data CF_Name, "Chris Huffman"

objData.CONTACT.Data CF_Address1, "20323 SomeWhere Avenue"

objData.CONTACT.Data CF_Title, "President"

 

'Update the records contents

szUniqueId = objData.CONTACT.Update

objData.Contact.GoTo (szUniqueId)

 

objData.Close

set objData = Nothing

 

*VF This example demonstrates how to add a new contact record.

objData = CreateObject("ACTOLE.DATABASE")

objData.Open (dbName)

 

objData.CONTACT.Add

* Set field data

objData.CONTACT.Data (CF_Company) = "WhatCo"

objData.CONTACT.Data (CF_Name) = "Chris Huffman"

objData.CONTACT.Data (CF_Address1) = "20323 SomeWhere Avenue"

objData.CONTACT.Data (CF_Title) = "President"

 

* Update the records contents

szUniqueId = objData.CONTACT.Update

objData.Contact.GoTo (szUniqueId)

 

objData.Close

objData = null

 

Close Method

Description    Closes the current table. The table schema and record information is discarded.

Objects          Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Close

See also         IsOpen
Open in Database object

*VF
objContact.close
objSales.close

Data Property

Description    Gets and sets the data for a specified field in the specified object.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Data iFieldID [, szValue]

Parameters    iFieldID                 A short integer that specifies the unique field ID for the specified table. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

[szValue]                A string that specifies the data to set for the specified field. Omit this optional parameter to get the data in the field.

Value type      Date/Variant, Read/Write

Comments     Make a call to Add or Edit before setting data to a field, while not making intervening navigational calls. Follow the Data assignment by Update to commit the data to disk. All field data is passed and retrieved in string format only. Use the Type property in the Fields object to get the required data type for the data.

See also         Add, Edit, FieldCount, IsBOF, IsEOF, RecordCount, Update
Type in Fields object

Example         'This example demonstrates how to retrieve data from a record.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

Dim tableObject As Object

Set tableObject = objData.CONTACT

 

tableObject.MoveFirst

 

'Get the name of the contact

dim strOutput as String

strOutput = tableObject.Data(CF_Name)

 

set tableObject = Nothing

 

objData.Close

set objData = Nothing

Delete Method

Description    Deletes the currently selected record.

Caution: This is a single step process that cannot be reversed. Before deleting a parent group record, delete its subgroup records.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Delete

Return type   Void

See also         Add, GoTo, IsLocked, LockLevel, Move…

Edit Method

Description    Prepares the current record for editing and applies a record lock.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Edit

Return type   Void

Comments     This method enables the current record buffer to be edited and sets default field values so that field data can then be assigned using the Data property. The edited record is committed using the Update method or aborted if any record navigational method is called. To make sure the edit will succeed, call IsLocked immediately before calling this method and LockLevel immediately after.

See also         Data, GoTo, IsLocked, LockLevel, Move…, Update

Example         'This example demonstrates how to edit an existing contact record.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.CONTACT.MoveFirst

objData.CONTACT.Edit

 

'Change the address

objData.CONTACT.Data CF_Address1, "20323 Somewhere Avenue"

 

'Update the records contents

objData.CONTACT.Update

 

objData.Close

set objData = Nothing

Error Property

Description    Returns the error status of True for the object after a call that generated an error. Returns False if no error was generated on the last call. The error status is set to False at the beginning of each operation. If an error status of True is returned, call LastError to get the error code. See the last chapter of this section for error code descriptions.

Objects          Activity, Contact, Database, Email, ExceptionInfo, Fields, Group, Members, NoteHistory, PopupInfo, Relations, Users
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Error

Value type      Boolean, Read Only

Comments     This status should be checked after any call is made that may generate an error. Otherwise, further errors may be propagated that will overwrite the failing process or a successful call will hide the error, because error status is reset to False at the beginning of each operation.

See also         LastError

Execute Method

Description    Executes a query that has been set by the Query property and clears any previous query.

Objects          Contact, Group
Also applies to Activity, Email, Members, and NoteHistory objects in ACT! 3.0.7 or later.
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Execute

Return type   Void

See also         Query

Example         'This example demonstrates how to use queries.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.CONTACT.Query = "CONTACT contains ""Smith"""

objData.CONTACT.Execute

 

'*** Can now retrieve data for record(s)

objData.Close

set objData = Nothing

 

FieldCount Property

Description    Returns the number of fields in the table object. Use this value to iterate through the Data property and Fields property.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.FieldCount

Value type      Short Integer, Read Only

See also         Data, IsBOF, IsEOF, RecordCount

*VF
nFieldCount =objContact.FieldCount
* Listing the fields in a record
for nX =1 to nFieldCount
       ? ltrim(str(nX)) +cField +'=', cContent, ''
endfor
 

Fields Property

Description    Returns a Fields object. The Fields object returned by this property is directly associated with its parent object. For example, if the parent object is Contact, then the Fields object is initialized with the fields for the Contact table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Fields

Value type      Object/LPDISPATCH, Read Only

See also         Fields object

Example         'This example demonstrates how to retrieve fields object from a list object.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Obtain the Fields object for the Contact object

dim fields as object

set fields = objData.CONTACT.FIELDS

 

objData.Close

set objData = Nothing

FindDuplicates Method (requires ACT! 2000 or later)

Description    Uses the duplicate checking criteria to search for duplicate contacts and groups in the Contact table or Group table. After executing this command, the Current lookup contains the duplicates.

Objects          Contact, Group

Syntax            object.FindDuplicates

Return type   Void

See also         GetDuplicateCriteria, SetDuplicateCriteria

Example         'The following code finds duplicates and then enumerates through the

'duplicate records.

 

Dim objDatabase as object

Set objDatabase= CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

'Assign the correct table object

Set objContact = objDatabase.Contact

If objDatabase.IsOpen Then

   'Find the duplicate contacts in this database

   objContact.FindDuplicates

   List1.AddItem objContact.recordCount & " duplicate contacts Found!"

 

   'Enumerate all the duplicates in the contact table

   objContact.MoveFirst

   While Not objContact.IsEOF

       List1.AddItem "CONTACT: " & objContact.Data(CF_Name)

       List1.AddItem "TITLE: " & objContact.Data(CF_Title)

       List1.AddItem "COMPANY: " & objContact.Data(CF_Company)

       List1.AddItem objContact.Data(CF_City) & ", " &

          objContact.Data(CF_State)

       objContact.MoveNext

   Wend

   Set objContact = Nothing

   objDatabase.close

End If

Set objDatabase = Nothing

GetDataEx Method (requires ACT! 4.0.2 or later)

Description    Returns an array of strings containing the data for each field specified in an array of fields.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.GetDataEx iFieldArray, szValueArray

Parameters    iFieldArray            Returns an array of short integers (or pointers to short integers in VISUAL C++) that represent the field IDs of fields for which to get the data contained in the fields.

szValueArray         Returns an array of strings (or BSTRs in VISUAL C++) for the data that is returned for the specified fields. The same number of elements must be specified for the iFieldArray and the szValueArray parameters.

Note: In Visual C++, use VARIANT.pparray instead of VARIANT.parray for pointers to elements in the array.

Return type   Void

See also         SetDataEx

Example         'This example demonstrates getting data from multiple fields and sending

'it to a file.

 

Dim NoteIdArray(10) As Integer

Dim OutputArray(10) As String

Dim objData As Object

Dim objNoteHistory As Object

Dim count As Double

Dim LastRecord As Long

Dim FileNum

 

NoteIdArray(0) = NHF_ContactId 'Field ID constant

NoteIdArray(1) = NHF_UserTime     'Include Actfield.bas

NoteIdArray(2) = NHF_Type

NoteIdArray(3) = NHF_Text

 

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

If objData.IsMultiUser Then

   objData.ValidateUser "Chris Huffman", ""

End If

If objData.IsOpen = False Then

   MsgBox "Failed to open database"

End If

 

Set objNoteHistory = objData.NoteHistory

LastRecord = objNoteHistory.recordcount

count = 1

'Get a free file number

FileNum = FreeFile

'Open GetNoteHistory.TXT for append

Open "GetNoteHistory.txt" For Append As FileNum

objNoteHistory.MoveFirst

 

Do While (count <= LastRecord)

 

   objNoteHistory.GetDataEx NoteIdArray, OutputArray

 

   Write #FileNum, OutputArray(0), OutputArray(1), OutputArray(2),

       OutputArray(3)

   count = count + 1

   objNoteHistory.MoveNext

   If objNoteHistory.IsEOF Then

       Exit Do

   End If

Loop

Close FileNum    'Close the file

Set objNoteHistory = Nothing      'Clean up

ObjData.Close

Set objData = Nothing

GetDuplicateCriteria Method (requires ACT! 2000 or later)

Description    Returns short integer values for the field IDs for the duplicate checking criteria for the Contact table or Group table.

Object            Contact, Group

Syntax            object.GetDuplicateCriteria (iFieldID1, iFieldID2, iFieldID3)

Parameters    iFieldID1               A short integer (or pointer to a short integer in VISUAL C++) that represents the field ID type for the first field for duplicate checking (find a match for data in this field).

iFieldID2               A short integer (or pointer to a short integer in VISUAL C++) that represents the field ID type for the second field for duplicate checking (then find a match for data in this field).

iFieldID3               A short integer (or pointer to a short integer in VISUAL C++) that represents the field ID type for the third field for duplicate checking (then find a match for data in this field).

See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

See also         FindDuplicates , SetDuplicateCriteria

Example         Dim objDatabase as object

Set objDatabase = CreateObject("ACTOLE.DATABASE")      'Open the database

objDatabase.Open dbName

 

'Assign the correct table object

Set objContact = objDatabase.Contact

 

If objDatabase.IsOpen Then

   'Get the current duplicate criteria

objContact.GetDuplicateCriteria DupCriteria1, DupCriteria2,

   DupCriteria3

   List1.AddItem "Duplicate criteria is :  Match on   " & DupCriteria1 &

       " and then on  " & DupCriteria2 & "  and then on " & DupCriteria3

'Set the duplicate criteria as match on User1 then Department and then

'on Title

   objContact.SetDuplicateCriteria CF_User1, CF_Department, CF_Title

   Set objContact = Nothing

   objDatabase.close

End If

 

Set objDatabase = Nothing

GetSort Method (requires ACT! 4.0 or later)

Description    Returns short integer values for the field IDs and sort directions of the sorted fields for the active sort of an ACT! database table. A value of 0, 1, 2, or 3 is returned specifying the number of fields sorted for the table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.GetSort iField1ID, iDirection1, iField2ID, iDirection2, iField3ID, iDirection3

Parameters    iField1ID               A short integer (or pointer to a short integer in VISUAL C++) that represents the field ID for the first field in the sort order.

iDirection1            A short integer (or pointer to a short integer in VISUAL C++) that represents the sort direction for the first field. Values returned are 0 for ascending order or 1 for descending order.

iField2ID               A short integer (or pointer to a short integer in VISUAL C++) that represents the field ID for the second field in the sort order.

iDirection2            A short integer (or pointer to a short integer in VISUAL C++) that represents the sort direction for the second field. Values returned are 0 for ascending order or 1 for descending order.

iField3ID               A short integer (or pointer to a short integer in VISUAL C++) that represents the field ID for the third field in the sort order.

iDirection3            A short integer (or pointer to a short integer in VISUAL C++) that represents the sort direction for the third field. Values returned are 0 for ascending order or 1 for descending order.

See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

Return type   Short Integer

See also         Sort
IsSortable in Fields object

Example        

'VB This example gets the sorted fields in the contact table.

Dim i As Integer

Dim objDatabase as object

Dim iSortFld1, iSortFld2, iSortFld3 as integer

Dim iSortOrder1, iSortOrder2, iSortOrder3 as integer

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

'Assign the correct table object

Set objContact = objDatabase.CONTACT

   If objDatabase.IsOpen Then

       i = objContact.GetSort(iSortFld1, iSortOrder1, iSortFld2, iSortOrder2, iSortFld3, iSortOrder3)

       lstDisplay.AddItem "i = " & i & "  Sort Order = " & iSortFld1 &

          " ," & iSortOrder1 & " ," &  iSortFld2 & " ," & iSortOrder2 &

          " ," & iSortFld3 & " ," & iSortOrder3

       Set objContact = Nothing

       objDatabase.Close

   End If

Set objDatabase = Nothing

*VF This example gets the sorted fields in the contact table.

i =0

store iSortFld1, iSortFld2, iSortFld3 to 0

store iSortOrder1, iSortOrder2, iSortOrder3 to 0


objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

* Assign the correct table object

objContact = objDatabase.CONTACT

   If objDatabase.IsOpen Then

       i = objContact.GetSort(iSortFld1, iSortOrder1, iSortFld2,iSortOrder2, iSortFld3, iSortOrder3)

       lstDisplay.AddItem "i = " & i & "  Sort Order = " & iSortFld1 &

          " ," & iSortOrder1 & " ," &  iSortFld2 & " ," & iSortOrder2 &

          " ," & iSortFld3 & " ," & iSortOrder3

       objContact = null

       objDatabase.Close

   EndIf

objDatabase = null

 

GoTo Method

Description    Goes to the specified record and makes it the current record, if it exists.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.GoTo szUniqueID

Parameters    szUniqueID            A string that specifies the Unique ID of the record.

Return type   Void

See also         Data
UniqueID in Users object

'VB
cUniqueId ="Q/QA+ #FV2^"
set objContact.Goto cUniqueId
 
*VF
cUniqueId ="Q/QA+ #FV2^"
objContact.Goto(cUniqueId)
 

IsBOF Property

Description    Returns True if the current record is the first record in the table or False if the current record is not the first record in the table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.IsBOF

Value type      Boolean, Read Only

See also         RecordCount

IsEOF Property

Description    Returns True if an attempt has been made to move past the last record in the table or False if the current record is not the last record in the table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.IsEOF

Value type      Boolean, Read Only

See also         RecordCount

IsLocked Property

Description    Returns True if the current record is locked or False if it is not locked. Call this property immediately before calling Edit to determine if the record can be edited.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.IsLocked

Value type      Boolean, Read Only

Comments     Use LockLevel to determine if the current record is unlocked or has been locked by the current user or by a network user.

See also         Add, GoTo, Edit, LockLevel, Move…

IsOpen Property

Description    Returns True if the current table object is open or False if it is not open. Call this property to determine if a database has been successfully opened.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.IsOpen

Value type      Boolean, Read Only

See also         Close,
Open in Database object

Jump Method

Description    Goes to a specified position within the table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Jump lValue

Parameters    lValue                    A long integer that specifies the new position in the list, in the range between 1 and RecordCount.

Return type   Void

See also         Position, RecordCount

Example        

'VB This example demonstrates how to jump by position within a table. 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Set the current position to the fifth record. assume there

'are more than 5 records.

objData.CONTACT.Jump 5

 

'Can now retrieve record

objData.Close

set objData = Nothing

 

*VF This example demonstrates how to jump by position within a table. 

objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

*Set the current position to the fifth record. assume there

*are more than 5 records.

objData.CONTACT.Jump 5

 

*Can now retrieve record

objData.Close

objData = null

LastError Property

Description    Returns the last error code for the object. This status should be checked if Error is True to determine the cause of the last error. After checking this property, the last error status is reset to Status_Success. See the last chapter of this section for error code descriptions.

Objects          Activity, Contact, Database, Email, ExceptionInfo, Fields, Group, Members, NoteHistory, PopupInfo, Relations, Users
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.LastError

Value type      Short Integer, Read Only

See also         Error

LockLevel Property

Description    Returns record lock status 0 if the current record is not locked, 1 if locked by the current user, or 2 if locked by a network user. Call this property after calling Edit to make sure the current user has the record lock.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.LockLevel

Value type      Short Integer, Read Only

See also         Add, Edit, GoTo, IsLocked, Move…

Lookup Method

Description    Performs a lookup for the specified keyword. The lookup is restricted to searching on one field in a table at a time. An error is generated if the specified field does not exist in the table.

Note: This method has been modified for the NoteHistory object in ACT! 4.0 or later to add the capability of searching for text in the Regarding field of Notes/History table records.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Lookup iFieldID, szKeyword, iLookupType

Parameters    iFieldID                 A short integer that specifies the field ID of the field on which the lookup will be performed. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

szKeyword             A string that specifies the search criteria.

iLookupType          A short integer that specifies the type of lookup. Specify 1 to replace the lookup, 2 to add to the lookup, or 3 to narrow the lookup.

Return type   Void

Comments     Lookups are not exact searches. Instead, they treat the keyword like a Begins With style search. For example, if you specify the keyword “B” on the Contact field, the lookup will return all records whose Contact field begins with a B.

See also         Error, IsBOF, LastError, RecordCount

Example        

Visual Basic

'This example demonstrates how to perform a lookup on the contact table.

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Perform Lookup - will return all records whose name begins with Chris

objData.CONTACT.Lookup CF_Name, "Chris", 1

 

objData.Close

set objData = Nothing

 

 

 

LookupKeyword Method

Description    Looks up the specified keyword and returns the records containing the keyword.

Objects          Contact, Email, Group, NoteHistory

Syntax            object.LookupKeyword szKeyword

Parameters    szKeyword             A string specifying the keyword.

Return type   Void

Example         'The following code does a keyword search for "SDK " and then enumerates

'through all the Contact records that meet this criteria.

 

Dim objDatabase as object

Set objDatabase= CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

'Assign the correct table object

Set objContact = objDatabase.Contact

If objDatabase.IsOpen Then

   'Look up all Contact records in which there is "SDK" in the

   'Contact table.

   objContact.lookupKeyword "SDK"

   List1.AddItem objContact.recordCount & "  contacts Found!"

 

   'Enumerate all the duplicates in the Contact table

   objContact.MoveFirst

   While Not objContact.IsEOF

       List1.AddItem "CONTACT: " & objContact.Data(CF_Name)

       List1.AddItem "TITLE: " & objContact.Data(CF_Title)

       List1.AddItem "COMPANY: " & objContact.Data(CF_Company)

       List1.AddItem objContact.Data(CF_City) & ", " &

          objContact.Data(CF_State)

       objContact.MoveNext

   Wend

   Set objContact = Nothing

   objDatabase.close

End If

 

Set objDatabase = Nothing

MoveFirst Method

Description    Goes to the first record in a table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.MoveFirst

Return type   Void

See also         RecordCount

MoveLast Method

Description    Goes to the last record in a table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.MoveLast

Return type   Void

See also         RecordCount

MoveNext Method

Description    Goes to the next record in the table. An error is not generated for an EOF condition. Call IsEOF after calling this method.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.MoveNext

Return type   Void

See also         IsEOF, MovePrevious, RecordCount

Example         tableObject.MoveNext

If tableObject.IsEOF Then

   MsgBox "End of table"

End If

MovePrevious Method

Description    Goes to the previous record in the table. An error is not generated for a BOF condition. Call IsBOF after calling this method.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.MovePrevious

Return type   Void

See also         IsBOF, MoveNext, RecordCount

Name Property

Description    Returns the name of the current table object. Use this property to determine which table is the current object.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Name

Value type      String, Read Only

Example         objDatabase.name

Position Property

Description    Returns the current record position in a table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Position

Value type      Long Integer, Read Only

Query Property

Description    Gets and sets the string for an ACT! formatted query.

Objects          Activity, Contact, Email, Group, Members, and NoteHistory
 Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Query = "Contact Contains ""szString"""
or
object.Query = "Group Contains ""szString"""

Parameters    szString                  A string that specifies the query criteria.

Value type      String, Read/Write

Comments     Queries start by first resetting the scope to all records, then executing the query. After executing, a query returns a subset of records. To clear an existing query and reset the scope to all records, pass in an empty string, then call the Execute method. See the ACT! User’s Guide for information on the ACT! query language. You can also use the advanced Query Helper to create and test query strings. Unique ID type fields cannot be used in queries.

See also         Execute

Example         See the example for the Execute method in this section.

Rebuild Method

Description    Rebuilds a table, which reloads the table information. Rebuild a table after modifying the table definitions.

Objects          Activity, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Rebuild

Return type   Void

RecordCount Property

Description    Returns the number of records in a table.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.RecordCount

Value type      Long Integer, Read Only

Example         objContact.RecordCount

SetDataEx Method (requires ACT! 4.0.2 or later)

Description    Sets specified values for each field specified in an array of fields.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.SetDataEx iFieldArray, szValueArray

Parameters    iFieldArray            An array of short integers (or pointers to short integers in VISUAL C++) that represent the field IDs of fields for which to set the specified data. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

szValueArray         An array of strings (or BSTRs in VISUAL C++) for the data to set to the specified fields. The same number of elements must be specified for the iFieldArray and the szValueArray parameters.

Note: In Visual C++, use VARIANT.pparray instead of VARIANT.parray for pointers to elements in the array.

Return type   Void

See also         GetDataEx

Example         'This example demonstrates updating multiple fields in one operation.

Dim database As Object

Dim contact As Object

Dim fieldarray(2) As Integer  'Must be a short integer

Dim dataarray(2) As String    'Must be a string (BSTR)

 

'Open the currently open database.

Set database = CreateObject("actole.database") database.OpenEx ("")

Set contact = database.Contact contact.MoveFirst

 

'Each value in fieldarray must have a corresponding value in dataarray.

fieldarray(0) = 25

fieldarray(1) = 26

dataarray(0) = "Chris"

dataarray(1) = "13 East 54th Street"

 

'Start editing.

contact.Edit

'Set the data on the record.

contact.SetDataEx fieldarray, dataarray

'If there is not an error, update the record.

if contact.Error = FALSE then

contact.Update

End If

 

Set contact = Nothing

database.Close

Set database = Nothing

SetDuplicateCriteria Method (requires ACT! 2000 or later)

Description    Sets field IDs for the duplicate checking criteria for the Contact table or Group table.

Object            Contact, Group

Syntax            object.SetDuplicateCriteria (iFieldID1, iFieldID2, iFieldID3)

Parameters    iFieldID1               A short integer (or pointer to a short integer in VISUAL C++) specifying the field ID for the first field for duplicate checking (find a match for data in this field).

iFieldID2               A short integer (or pointer to a short integer in VISUAL C++) specifying the field ID for the second field for duplicate checking (then find a match for data in this field).

iFieldID3               A short integer (or pointer to a short integer in VISUAL C++) specifying the field ID for the third field for duplicate checking (then find a match for data in this field).

See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

Return type   Void

See also         FindDuplicates, GetDuplicateCriteria

Example         Set objDatabase = CreateObject("ACTOLE.DATABASE")

'Open the database

objDatabase.Open dbName

 'Assign the correct table object

Set objContact = objDatabase.Contact

 If objDatabase.IsOpen Then

   'Get the current duplicate criteria

   objContact.GetDuplicateCriteria DupCriteria1, DupCriteria2,

       DupCriteria3

   List1.AddItem "Duplicate criteria is :  Match on   " & DupCriteria1 &

       " and then on  " & DupCriteria2 & "  and then on " & DupCriteria3

    'Set the duplicate criteria as match on User1 then Department and then

       'on Title

       objContact.SetDuplicateCriteria CF_User1, CF_Department, CF_Title

        Set objContact = Nothing

       objDatabase.close

   End If

    Set objDatabase = Nothing

Sort Method

Description    Executes a sort on up to three fields in a table. Only one sort may be active at once. An error is generated if any of the specified fields do not exist in the table.

Note: Call fields.IsSortable to determine if a field can be sorted.

Objects          Activity, Contact, Email, Group, Members, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Sort iField1ID, iDirection1, iField2ID, iDirection2, iField3ID, iDirection3

Parameters    iField1ID               A short integer that specifies the field ID type for the field that specifies the first field in the sort order.

iDirection1            A short integer that specifies the sort direction for the first field. Specify a value of 0 for ascending order or 1 for descending order.

iField2ID               A short integer that specifies the field ID for the field that specifies the second field in the sort order. Specify 0 if you do not want to sort on this field.

iDirection2            A short integer that specifies the sort direction for the second field. Specify 0 for ascending order or 1 for descending order.

iField3ID               A short integer that specifies the field ID for the field that specifies the third field in the sort order. Specify 0 if you do not want to sort on this field.

iDirection3            A short integer that specifies the sort direction for the third field. Specify 0 for ascending order or 1 for descending order.

See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

Return type   Void

See also         Error, GetSort, IsBOF, LastError, RecordCount
IsSortable in Fields object

Example         'This example demonstrates how to perform a sort on the contact table.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Set sort order for all 3 fields

objData.CONTACT.Sort CF_Company, 1, CF_Title, 1, CF_Name, 1

 

'Set sort order for only the 1st field

objData.CONTACT.Sort CF_Company, 1, 0, 1, 0, 1

 

objData.Close

set objData = Nothing

Update Method

Description    Saves a new or edited record to the table. This method returns a string that contains the Unique ID of the record that has just been added or updated.

Objects          Activity, Contact, Email, Group, NoteHistory
Also applies to ListTable and Sales objects in ACT! 2000 or later

Syntax            object.Update

Return type   String

Comments     Make a call to Add or Edit before calling this method. This method commits a newly created or edited record to disk and removes the record lock. After updating, the current record position is determined by the alphabetical sort order of the field. After updating or adding a new record, call GoTo szUniqueID, where szUniqueID is the Unique ID returned from this method.

See also         Add, Data, Edit, GoTo, Move…

Activity object properties and methods

The Activity object contains scheduled activity information for the active database object. The following properties and methods apply only to the Activity object. See “Common properties and methods” in this section for additional properties and methods that apply to the Activity object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

ExceptionInfo

None

 

Object/
LPDISPATCH

Read/Write

FirstScheduledWith

[szUniqueID]

String

String

Read/Write

NextScheduledWith

[szUniqueID]

String

String

Read/Write

RecurringChangeMode

[True|False]

Boolean

Boolean

Read/Write

recurringType

None

 

Short Integer

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

Clear

None

 

Void

ClearClearedFilter

None

 

Void

ClearContactScope

None

 

Void

ClearDateScope

None

 

Void

ClearGroupScope

None

 

Void

ClearPriorityFilter

None

 

Void

ClearRecurring

None

 

Void

ClearTimedFilter

None

 

Void

ClearTimelessFilter

None

 

Void

ClearTypeFilter

None

 

Void

ClearUnclearedFilter

None

 

Void

GetDaysOfMonthBits

None