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

 

Long Integer

GetDaysOfWeekBits

None

 

Long Integer

GetRecurringFrequency

None

 

Short Integer

GetRecurringUntilDate

None

 

Date/Variant

GetWeeksOfMonthBits

None

 

Long Integer

HasAlarm

None

 

Boolean

HasDetails

None

 

Boolean

IsClear

None

 

Boolean

IsOutlookActivity

None

 

Boolean

IsRecurring

None

 

Boolean

IsTimeless

None

 

Boolean

SetClearedFilter

None

 

Void

SetContactScope

szUniqueID

String

Void

SetDateScope

startDate, endDate

Date, Date

Void

SetGroupScope

szGroupUniqueID

String

Void

SetPriorityFilter

iPriority

Short Integer

Void

SetRecurringDays

lFrequency, untilDate

Long Integer,
Date

Void

SetRecurringDaysAndWeeksofMonth

lFrequency, lDayBits, lWeekBits, untilDate

Long Integer,
Long Integer,
Long Integer,
Date

Void

SetRecurringWeekDays

lFrequency, lDayBits, untilDate

Long Integer,
Long Integer, Date

Void

SetTimedFilter

None

 

Void

SetTimeless

True|False

Boolean

Void

SetTimelessFilter

None

 

Void

SetTypeFilter

iType

Short Integer

Void

SetUnclearedFilter

None

 

Void

Unclear

None

 

Void

Clear Method

Description    Sets the status of the current activity to cleared.

Object            Activity

Syntax            object.Clear

Return type   Void

See also         IsClear

ClearClearedFilter Method

Description    Clears an existing cleared filter. Resets the current record position to the first record and rebuilds the list of activities, without applying the cleared filter.

Object            Activity

Syntax            object.ClearClearedFilter

Return type   Void

See also         SetClearedFilter

ClearContactScope Method

Description    Clears any existing contact scoping. Resets the current record position to the first record and rebuilds the list of activities, without applying contact scoping.

Object            Activity

Syntax            object.ClearContactScope

Return type   Void

See also         SetContactScope

ClearDateScope Method

Description    Clears any existing date scoping. Resets the current record position to the first record and rebuilds the list of activities, without applying date scoping.

Object            Activity

Syntax            object.ClearDateScope

Return type   Void

See also         SetDateScope

ClearGroupScope Method

Description    Clears any existing group scoping. Resets the current record position to the first record and rebuilds the list of activities, without applying group scoping.

Object            Activity

Syntax            object.ClearGroupScope

Return type   Void

See also         SetGroupScope

ClearPriorityFilter Method

Description    Clears all existing priority filters. Resets the current record position to the first record and rebuilds the list of activities, without applying any priority filter.

Object            Activity

Syntax            object.ClearPriorityFilter

Return type   Void

See also         SetPriorityFilter

ClearRecurring Method

Description    Changes the recurring status of an activity status to non-recurring, making a recurring activity non-recurring.

Object            Activity

Syntax            object.ClearRecurring

Return type   Void

See also         recurringType, SetRecurringDays, SetRecurringDaysAndWeeksofMonth, SetRecurringWeekDays

ClearTimedFilter Method

Description    Clears an existing timed filter and rebuilds a list of records that includes any timed activities.

Object            Activity

Syntax            object.ClearTimedFilter

Return type   Void

See also         SetTimedFilter

ClearTimelessFilter Method

Description    Clears an existing timeless filter and rebuilds a list of records that includes all timeless activities.

Object            Activity

Syntax            object.ClearTimelessFilter

Return type   Void

See also         SetTimelessFilter

ClearTypeFilter Method

Description    Clears all existing activity type filters and rebuilds a list of records that includes all activities, including activities with types that were previously filtered out.

Object            Activity

Syntax            object.ClearTypeFilter

Return type   Void

See also         SetTypeFilter

ClearUnclearedFilter Method

Description    Clears an existing uncleared filter and rebuilds a list of records that includes all activities including the uncleared activities that were previously filtered out.

Object            Activity

Syntax            object.ClearUnclearedFilter

Return type   Void

See also         SetUnclearedFilter

ExceptionInfo Property

Description    Returns an ExceptionInfo object for a recurring activity.

Object            Activity

Syntax            object.ExceptionInfo

Value type      Object/LPDISPATCH, Read/Write

FirstScheduledWith Property

Description    Returns or sets the Unique ID of a contact for a single activity that is scheduled with multiple contacts. You can use this property to add a contact to the list of contacts with whom an activity is scheduled. This is an important property as it makes ACT! display the activity in the Activities tab of the contact record.

Note: Do not call this property between the Add/Update or Edit/Update pairs.

Object            Activity

Syntax            object.FirstScheduledWith [szUniqueID]

Parameters    szUniqueID            A string that specifies the Unique ID of a contact to add for a scheduled activity. Omit this optional parameter to get the contact record’s Unique ID.

Value type      String, Read/Write

Comments     Use the FirstScheduledWith property to return or set the first contact for an activity, then use the NextScheduledWith property as many times as necessary to return or set each additional contact for the activity. When all contacts for the activity have been returned, a null string is returned.

See also         NextScheduledWith

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

dim contactUniqueID as string

objData.CONTACT.MoveFirst

contactUniqueID = objData.CONTACT.Data(CF_UniqueID)

 

'Example demonstrating how to determine the type of recurring activity

objData.ACTIVITY.MoveFirst

 

objData.ACTIVITY.Add

'Fill out Activity fields

dim uniqueID as string

uniqueID = objData.ACTIVITY.Update

 

'Go to the newly added record and specify the contact the activity is

'scheduled with

objData.ACTIVITY.GoTo(uniqueID)

objData.ACTIVITY.FirstScheduledWith(contactUniqueID)

 

objData.Close

set objData = Nothing

GetDaysOfMonthBits Method

Description    Returns a long integer that specifies the days of a month that are set for a recurring activity. To get valid results, call the recurringType property before calling this method. The returned value represents a value equivalent to 2^ (Day of the month –1).

Object            Activity

Syntax            object.GetDaysOfMonthBits

Return type   Long Integer

Comments     The following values for days of a month are returned by this method:

Value

Day of month

 

Value

Day of month

 

Value

Day of month

1

1

 

2048

12

 

2097152

22

2

2

 

4096

13

 

4194304

23

4

3

 

8192

14

 

8388608

24

8

4

 

16384

15

 

16777216

25

16

5

 

32768

16

 

33554432

26

32

6

 

65536

17

 

67108864

27

64

7

 

131072

18

 

134217728

28

128

8

 

262144

19

 

268435456

29

256

9

 

524288

20

 

536870912

30

512

10

 

1048576

21

 

1073741824

31

1024

11

 

 

 

 

 

 

See also         Recurring

Example         Dim objData As Object

Set objData = CreateObject("ACTOLE.DATABASE")

 

objData.Open dbName

List1.Clear

objdata.ACTIVITY.MoveFirst

 

If objdata.ACTIVITY.IsRecurring Then

   recurtype = objdata.ACTIVITY.recurringType

 

   If recurtype = recurring_daysofmonth Then

   Dim daysOfMonth as long

   daysOfMonth = objdata.ACTIVITY.GetDaysOfMonthBits()

 

   'Get the day of the month

       Dim i As Integer

       Dim dayvalue as long

       Dim outString as String

       For i = 0 To 30

          dayvalue = 2 ^ i

 

          If daysOfMonth And dayvalue Then

              outString = outString & (i + 1) & " "

          End If

       Next i

       'OutString now has the value of the day of the month

       '(number between 1 and 31)

       List1.AddItem "Days of the Month: " & outString

   End If

End If

GetDaysOfWeekBits Method

Description    Returns a long integer that specifies the days of the week that are set for a recurring activity. To get valid results, first call the recurringType property and check that the activity is a recurring_weekdays or a recurring_daysandweeksofmonth type.

Object            Activity

Syntax            object.GetDaysOfWeekBits

Return type   Long Integer

Comments     The returned long integer value must be ANDed with specific defines representing the week bit set.

The following values for days of a week are returned by this method:

Value

Day of week

 

Value

Day of week

1

Sunday

 

16

Thursday

2

Monday

 

32

Friday

4

Tuesday

 

64

Saturday

8

Wednesday

 

 

 

See also         GetDaysOfMonthBits, GetWeeksOfMonthBits

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Example demonstrating how to parse values returned from

'GetDaysOfWeekBits method

objData.ACTIVITY.MoveFirst

if objData.ACTIVITY.IsRecurring then

   recurtype = objdata.ACTIVITY.recurringType

 

   if recurtype = recurring_weekdays or recurtype =
recurring_daysandweeksofmonth then

       dim dayBits as long

       dayBits = objData.ACTIVITY.GetDaysOfWeekBits

 

       'Parse the day bits

       If dayBits And day_sunday Then

          'Sunday is set

       End If

 

       If dayBits And day_monday Then

          'Monday is set

       End If

   End if

End if

 

objData.Close

set objData = Nothing

GetRecurringFrequency Method

Description    Returns a short integer that specifies the frequency of a recurring activity.

Object            Activity

Syntax            object.GetRecurringFrequency

Return type   Short Integer

Comments     Verify that the current activity is recurring by calling IsRecurring. Also determine the type of recurring activity by calling recurringType. This indicates how to treat the value. For example, if recurringType is 2 and GetRecurringFrequency returns a value of 1, the activity is recurring every 1 week.

See also         IsRecurring, recurringType

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Example demonstrating how to determine the type of recurring activity

objData.ACTIVITY.MoveFirst

 

if objData.ACTIVITY.IsRecurring then

   dim outString as string

   outString = "Recurring every: "

   recurtype = objdata.ACTIVITY.recurringType

 

   select case recurtype

       case recurring_none

       case recurring_days

          'Daily recurring activity

          outString = outString & activity.GetRecurringFrequency()

              & " Days"

       case recurring_weekdays

          'Weekly recurring activity

          outString = outString & activity.GetRecurringFrequency()

              & " Weeks"

       case recurring_daysofmonth

          'Custom recurring activity

          outString = outString & activity.GetRecurringFrequency()

              & " Months"

       case recurring_daysandweeksofmonth

          'Monthly recurring activity

       outString = outString & activity.GetRecurringFrequency() & " Months"

   end select

end if

 

objData.Close

set objData = Nothing

GetRecurringUntilDate Method

Description    Returns the date on which the recurring activity will stop recurring. In Visual Basic you can Typecast it as a string.

Object            Activity

Syntax            object.GetRecurringUntilDate

Return type   Date/Variant

GetWeeksOfMonthBits Method

Description    Returns a long integer that specifies which weeks of the month are set for a recurring activity. To get valid results, call recurringType and check that this activity is a recurring_daysandweeksofmonth type.

Object            Activity

Syntax            object.GetWeeksOfMonthBits

Return type   Long Integer

Comments     The long integer value returned must be ANDed with specific defines representing which week bit is set.

The following values for weeks of a month are returned by this method:

Value

Week of month

 

Value

Week of month

1

one

 

8

four

2

two

 

16

last

4

three

 

 

 

See also         GetDaysOfWeekBits

Example        

'This example demonstrates how to parse values returned from

'GetWeeksOfMonthBits method

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.ACTIVITY.MoveFirst

if objData.ACTIVITY.IsRecurring then

   recurtype = objdata.ACTIVITY.recurringType

 

   if recurtype = recurring_daysandweeksofmonth then

       dim weekBits as long

       weekBits = objData.ACTIVITY.GetWeeksOfMonthBits

 

       'Parse the weekbits

       If weeksBits And week_one Then

          'Week one is set

       End If

 

       If weekBits And week_two Then

          'Week two is set

       End If

   End if

End if

 

objData.Close

set objData = Nothing

HasAlarm Method

Description    Returns True if an alarm has been set for the current activity or False if an alarm has not been set. Call this method to determine if an activity currently has an alarm set.

Object            Activity

Syntax            object.HasAlarm

Return type   Boolean

Comments     This method cannot be used to set an alarm for an activity.

HasDetails Method (requires ACT! 2000 or later)

Description    Determines if the current activity has details associated with it. Returns True if the current activity includes details or False if the activity does not include details.

Object            Activity

Syntax            object.HasDetails

Return type   Boolean

Example        

'VB The following code lists all the activities with details in the current database.

   Set objDatabase = CreateObject("ACTOLE.DATABASE")

   objDatabase.Open dbName

   Set objActivity = objDatabase.Activity

 

   If objDatabase.IsOpen Then

       'Enumerate all of the records in the Activity table.

       objActivity.MoveFirst

       While Not objActivity.IsEOF

          List1.AddItem "Regarding: " & objActivity.Data(AF_Regarding)

          List1.AddItem "Start Time: " & objActivity.Data(AF_StartTime)

          List1.AddItem "Duration: " & objActivity.Data(AF_Duration)

          If objActivity.HasDetails = True Then

              List1.AddItem "ACTIVITY Details: " &

                 objActivity.Data(AF_Details)

          End If

          objActivity.MoveNext

       Wend

       Set objActivity = Nothing

       objDatabase.close

   End If

 

Set objDatabase = Nothing

 

*VFox The following code lists all the activities with details in the current database.

   objDatabase = CreateObject("ACTOLE.DATABASE")

   objDatabase.Open dbName

   Set objActivity = objDatabase.Activity

 

   If objDatabase.IsOpen Then

       'Enumerate all of the records in the Activity table.

       objActivity.MoveFirst

       While Not objActivity.IsEOF

          List1.AddItem "Regarding: " & objActivity.Data(AF_Regarding)

          List1.AddItem "Start Time: " & objActivity.Data(AF_StartTime)

          List1.AddItem "Duration: " & objActivity.Data(AF_Duration)

          If objActivity.HasDetails = True Then

              List1.AddItem "ACTIVITY Details: " &

                 objActivity.Data(AF_Details)

          End If

          objActivity.MoveNext

       Wend

       Set objActivity = Nothing

       objDatabase.close

   End If

 

Set objDatabase = Nothing

 

IsClear Method

Description    Returns True if the current activity has a status of cleared or False if the status is not cleared.

Object            Activity

Syntax            object.IsClear

Return type   Boolean

See also         Clear, Unclear

IsOutlookActivity Method (requires ACT! 2000 or later)

Description    Returns True if the current activity is an Outlook activity and False if it is not an Outlook activity.

Object            Activity

Syntax            object.IsOutlookActivity

Return type   Boolean

Example         'The following code lists all the activities in the current database

'that are Outlook Activities.

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

Set objActivity = objDatabase.ACTIVITY

 

If objDatabase.IsOpen Then

   'Enumerate all of the records in the Activity table.

   objActivity.MoveFirst

   While Not objActivity.IsEOF

       'If the current activity record is an Outlook activity list it.

       If objActivity.IsOutlookActivity = True then

          List1.AddItem "Regarding: " & objActivity.Data(AF_Regarding)

          List1.AddItem "Start Time: " & objActivity.Data(AF_StartTime)

          List1.AddItem "Duration: " & objActivity.Data(AF_Duration)

       End if

       objActivity.MoveNext

   Wend

   Set objActivity = Nothing

   objDatabase.close

End If

 

Set objDatabase = Nothing

IsRecurring Method

Description    Returns True if the current activity is recurring or False if it occurs only once. Call this method before obtaining any type of recurring information.

Object            Activity

Syntax            object.IsRecurring

Return type   Boolean

See also         recurringType

Example         See recurringType

IsTimeless Method

Description    Returns True if the status of the current activity is timeless or False if the activity has a starting time of day.

Object            Activity

Syntax            object.IsTimeless

Return type   Boolean

See also         SetTimeless

NextScheduledWith Property (requires ACT! 4.0 or later)

Description    Returns or sets the Unique ID of a contact for a single activity that is scheduled with multiple contacts. You can use this property to add a contact to the list of contacts with whom an activity is scheduled.

Note: Do not call this property between the Add/Update or Edit/Update pairs.

Object            Activity

Syntax            object.NextScheduledWith [szUniqueID]

Parameters    szUniqueID            A string that specifies the Unique ID of a contact to add for a scheduled activity. Omit this optional parameter to get the contact record’s Unique ID.

Value type      String, Read/Write

Comments     Use the FirstScheduledWith property to return or set the first contact for an activity, then use the NextScheduledWith property as many times as necessary to return or set each additional contact for the activity. When all contacts for the activity have been returned, a null string is returned.

See also         FirstScheduledWith

Example        

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")
objData.Open dbName

dim contactUniqueID as string

objData.CONTACT.MoveFirst

contactUniqueID = objData.CONTACT.Data(CF_UniqueID)


'Example demonstrating how to determine the type of recurring activity.

objData.ACTIVITY.MoveFirst

 

objData.ACTIVITY.Add

'Fill out activity fields

dim uniqueID as string

uniqueID = objData.ACTIVITY.Update

 

'Go to the newly added record and set the contact/activity relationship

objData.ACTIVITY.GoTo(uniqueID)

objData.ACTIVITY.FirstScheduledWith(contactUniqueID)

objData.ACTIVITY.NextScheduledWith(contactUniqueID1)

objData.ACTIVITY.NextScheduledWith(contactUniqueID2)

objData.Close

set objData = Nothing

RecurringChangeMode Property

Description    Gets and sets the change mode for a recurring activity. If True is set or returned, the change is to be applied for only the current instance of the recurring activity. If False is set or returned, the change is to be applied for all instances of the recurring activity.

Object            Activity

Syntax            object.RecurringChangeMode [True|False]

Parameters    [True|False]           Specify True to set the change mode to the current instance of the recurring activity or False to set the change mode to all instances of the recurring activity. Omit this optional parameter to get the change mode for the recurring activity.

Value type      Boolean, Read/Write

recurringType Property

Description    Returns the type of recurring activity. To get valid results, first verify that the activity is recurring by calling IsRecurring.

Object            Activity

Syntax            object.recurringType

Value type      Short Integer, Read Only

Comments     The following recurring type values are returned by this property:

Type

Description

0

Not recurring type

1

Daily recurring type

2

Weekly recurring type

3

Custom (days of the month) recurring type

4

Monthly recurring type

See also         IsRecurring

Example         'This example demonstrates how to determine the type of recurring activity.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

objData.ACTIVITY.MoveFirst

 

if objData.ACTIVITY.IsRecurring then

   recurtype = objdata.ACTIVITY.recurringType

   select case recurtype

       case recurring_none

       case recurring_days

          'Daily recurring activity

       case recurring_weekdays

          'Weekly recurring activity

       case recurring_daysofmonth

          'Custom recurring activity

      case recurring_daysandweeksofmonth

          'Monthly recurring activity

   end select

end if

 

objData.Close

set objData = Nothing

SetClearedFilter Method

Description    Narrows the current set of activity records by filtering out all cleared activities from the current set of records. The list of records is rebuilt and the current record position returns to the first record.

Object            Activity

Syntax            object.SetClearedFilter

Return type   Void

See also         ClearClearedFilter

SetContactScope Method

Description    Narrows the current set of activity records to those for the contact with the specified Unique ID. You can apply this scoping method along with other scoping methods and filters.

Object            Activity

Syntax            object.SetContactScope szUniqueID

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

Return type   Void

See also         ClearContactScope

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Get a contact record Unique ID

dim uniqueID as string

objData.CONTACT.MoveFirst

uniqueID = objData.CONTACT.DATA(CF_UniqueID)

 

'Apply contact scoping to the current list of activities

objData.ACTIVITY.MoveFirst

objData.ACTIVITY.SetContactScope(uniqueID)

 

objData.Close

set objData = Nothing

SetDateScope Method

Description    Narrows the current set of activity records to those within the specified start date and end date range. You can apply this scoping method along with other scoping methods and filters.

Object            Activity

Syntax            object.SetDateScope startDate, endDate

Parameters    startDate                A date value that specifies the beginning date of the activity date range, formatted in Windows Regional Settings Short Date style.

endDate                 A date value that specifies the ending date of the activity date range, formatted in Windows Regional Settings Short Date style.

Return type   Void

See also         ClearDateScope

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Locate all activity records that fall between these dates

objData.ACTIVITY.MoveFirst

objData.ACTIVITY.SetDateScope DateValue("01/15/97"), DateValue("03/01/97")

 

objData.Close

set objData = Nothing

SetGroupScope Method

Description    Narrows the current set of activity records to those for the group with the specified Unique ID. You can apply this scoping method along with other scoping methods and filters.

Object            Activity

Syntax            object.SetGroupScope szGroupUniqueID

Parameters    szGroupUniqueID A string that specifies the Unique ID of a group record.

Return type   Void

See also         ClearGroupScope

SetPriorityFilter Method

Description    Narrows the current set of activity records by filtering out all activity records with one or more specified priorities from the current set of records. The list of records is rebuilt, and the record position returns to the first record.

Object            Activity

Syntax            object.SetPriorityFilter iPriority

Parameters    iPriority                 A short integer that specifies the activity record priority type to filter out. Specify 0 to filter out high priority activities, 1 for medium priority activities, or 2 for low priority activities.

Return type   Void

Comments     To filter out activities with a second priority type, call this method again with another parameter value. You may want to filter out both low and medium priority activities, for example, which means you will be left with a list of only high priority activities.

See also         ClearPriorityFilter

SetRecurringDays Method

Description    Sets the current activity record to recurring with a recurring type of daily and specifies the date when the activity will end.

Note: Do not call this method between Add/Update and Edit/Update pairs.

Object            Activity

Syntax            object.SetRecurringDays lFrequency, untilDate

Parameters    lFrequency            A long integer that specifies every x days of the month, in the range of 1 to 31, depending on the number of days in the month.

untilDate                A date value that specifies the date when the recurring activity will end, formatted in Windows Regional Settings Short Date style. This value must be greater than the start date of the current activity.

Return type   Void

See also         recurringType, SetRecurringDaysAndWeeksofMonth, SetRecurringWeekDays

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

objData.ACTIVITY.MoveFirst

 

'Alter the activity so that it happens every 2 days until 3/26/99

objData.ACTIVITY.SetRecurringDays 2, DateValue("03/26/99")

 

objData.Close

set objData = Nothing

SetRecurringDaysAndWeeksofMonth Method

Description    Sets the current activity record to recurring with a recurring type of monthly (days and weeks of a month) and specifies the date when the activity will end. Values for both days of the week bits and weeks of the month bits must be passed to this method.

Note: Do not call this method between Add/Update and Edit/Update pairs.

Object            Activity

Syntax            object.SetRecurringDaysAndWeeksofMonth lFrequency, lDayBits, lWeekBits, untilDate

Parameters    lFrequency            A long integer that species every x months, in a range of 1 to 60.

lDayBits                 A long integer that specifies the days of the week. This value is created by ORing together values that represent the days of the week.

                              The following table lists the values for each day of a week:

Value

Day of week

 

Value

Day of week

1

Sunday

 

16

Thursday

2

Monday

 

32

Friday

4

Tuesday

 

64

Saturday

8

Wednesday

 

 

 

                        lWeekBits               A long integer that specifies the weeks of the month. This value is created by ORing together values that represent the weeks of the month.

The following table lists the values for each week of a month:

Value

Week of month

 

Value

Week of month

1

one

 

8

four

2

two

 

16

last

4

three

 

 

 

                        untilDate                A date value that specifies the date when the recurring activity will end, formatted in Windows Regional Settings Short Date style. This value must be greater than the start date of the current activity.

Return type   Void

See also         recurringType, SetRecurringDays, SetRecurringWeekDays

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.ACTIVITY.MoveFirst

 

'Alter the activity so that it happens every one month on Sunday

'and on Thursday of the second and fourth weeks of the month up until

'the date 3/26/99

dim dayBits as long

dim weekBits as long

dayBits = day_sunday Or day_Thursday

weekBits = week_two Or week_four

objData.ACTIVITY.SetRecurringDaysAndWeeksofMonth 1 dayBits, weekbits,

   DateValue("03/26/99")

 

objData.Close

set objData = Nothing

SetRecurringWeekDays Method

Description    Sets the current activity record to recurring with a recurring type of weekly and specifies when the activity will end.

Note: Do not call this method between Add/Update and Edit/Update pairs.

Object            Activity

Syntax            object.SetRecurringWeekDays lFrequency, lDayBits, untilDate

Parameters    lFrequency            A long integer representing every x weeks, in the range of 1 to 52.

lDayBits                 A long integer representing the days of the week. This value is created by ORing together values which represent the days of the week.

                              The following table lists the values for each day of a week:

Value

Day of week

 

Value

Day of week

1

Sunday

 

16

Thursday

2

Monday

 

32

Friday

4

Tuesday

 

64

Saturday

8

Wednesday

 

 

 

                        untilDate                A date value that specifies the date when the recurring activity will end, formatted in Windows Regional Settings Short Date style. This value should be greater than the start date of the current activity.

Return type   Void

See also         recurringType, SetRecurringDays, SetRecurringDaysAndWeeksofMonth

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.ACTIVITY.MoveFirst

 

'Alter an activity that happens every 2 weeks on Sunday and Thursday and

'continues until 3/26/99

dim dayBits as long

dayBits = day_sunday Or day_thursday

objData.ACTIVITY.SetRecurringWeekDays 2, dayBits, DateValue("03/26/99")

 

objData.Close

set objData = Nothing

SetTimedFilter Method

Description    Narrows the current set of activity records by filtering out all timed activity records from the current set of records. The list of records is rebuilt, and the record position returns to the first record.

Object            Activity

Syntax            object.SetTimedFilter

Return type   Void

See also         ClearTimedFilter

SetTimeless Method

Description    Sets the current activity record’s activity status.

Object            Activity

Syntax            object.SetTimeless True|False

Parameters    True|False             Specify True to set the activity to timeless or False to set the activity to not timeless.

Return type   Void

See also         ClearTimelessFilter

SetTimelessFilter Method

Description    Narrows the current set of activity records by filtering out all timeless activities from the current set of records. The list of records is rebuilt, and the record position returns to the first record.

Object            Activity

Syntax            object.SetTimelessFilter

Return type   Void

See also         ClearTimelessFilter

SetTypeFilter Method

Description    Narrows the current set of activity records by filtering out all activity records with the specified type from the current set of records. The list of records is rebuilt, and the record position returns to the first record.

Object            Activity

Syntax            object.SetTypeFilter iType

Parameters    iType                      A short integer that specifies the type of activity records to filter out. Specify 0 to filter out Call type activities, 1 for Meeting type activities, or 2 for To-do type activities.

Return type   Void

Comments     To filter out activities with a second activity type, call this method again with another parameter value. You may want to filter out both Call and Meeting type activities, for example, which means you will be left with a list of only To-do type activities.

See also         ClearTypeFilter

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

objData.ACTIVITY.MoveFirst

 

'Filter out all calls from the Activity list

objData.ACTIVITY.SetTypeFilter(activitytype_call) 'defined in ACTFIELD.BAS

 

objData.Close

set objData = Nothing

SetUnclearedFilter Method

Description    Narrows the current set of activity records by filtering out all uncleared activity records from the current set of records. The list of records is rebuilt, and the record position returns to the first record.

Object            Activity

Syntax            object.SetUnclearedFilter

Return type   Void

See also         ClearUnclearedFilter

Unclear Method

Description    Resets the cleared status of the current activity record to uncleared.

Object            Activity

Syntax            object.Unclear

Return type   Void

See also         Clear

Contact object methods

The Contact object contains information about the ACT! contacts. The following methods apply only to the Contact object. See “Common properties and methods” in this section for additional properties and methods that apply to the Contact object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

LoadLookUpQuery

szFileName

String

Void

LookupMyRecord

None

 

Void

SetAsMyRecord

szUserName

String

Void

LoadLookUpQuery Method (requires ACT! 3.0.6 or later)

Description    Loads and runs a file that was created using the SaveCurrentLookup method of the ACT! OLE Application Object.

Note: This method cannot use queries created in the ACT! application.

Object            Contact

Syntax            object.LoadLookUpQuery szFileName

Parameters    szFileName            A string that specifies the name and path of the Query file.

Return type   Void

LookupMyRecord Method (requires ACT! 2000 or later)

Description    Looks up the My Record in the open database. After executing this command, the Current lookup contains one contact, the My Record.

Object            Contact

Syntax            object.LookupMyRecord

Return type   Void

Example         'The following code looks up the My Record and Lists the Name, Title, and

'Company information.

 

Set objData = CreateObject("ACTOLE.DATABASE")

'Opens the currently open database in ACT!

objData.OpenEx ""

 

Set objContact = objData.CONTACT

If objData.IsOpen Then

   'Lookup My Record and list the My Record information.

   objContact.LookupMyRecord

   List1.AddItem " My Record"

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

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

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

   Set objContact = Nothing

   objData.close

   List1.AddItem "Database Closed"

End If

 

Set objData = Nothing

SetAsMyRecord Method (requires ACT! 4.0 or later)

Description    Makes the current contact record the My Record of the specified user. To use this method, the current user of the open database and the specified user must have an Administrator security level. The specified user must not have an existing My Record in the open database. A contact record that was previously assigned to a user cannot be assigned to other users.

Object            Contact

Syntax            object.SetAsMyRecord szUserName

Parameters    szUserName           A string that specifies the user name.

Return type   Void

Example         'This example sets a contact record as the My Record for a user.

 

dim objDatabase as object

dim objContact as Object

dim objUsers as Object

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open(C:\My Documents\ACT\Database\ACT5demo.dbf)

Set objUsers = objDatabase.Users

 

'Add a user.

if objUsers.AddUser("Simon Lazarus", "password", 0) = True then

   'Get the Contact object.

   Set objContact = objDatabase.CONTACT

   objContact.Add

   objContact.Data (CF_Name, "Simon Lazarus")

   objContact.Data (CF_Company, "Aussie Meats")

   'Save the contact and get the Unique ID.

   objContact.Update

   'Mark the record as the My Record for user Simon Lazarus.

   objContact.SetAsMyRecord("Simon Lazarus")

Endif

 

objDatabase.Close

set objData = Nothing

Database object properties and methods

The Database object contains the ACT! database information and objects. The following properties and methods apply only to the Database object. See “Common properties and methods” in this section for additional properties that apply to the Database object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

ActiveUserCount

None

 

Short Integer

Read Only

Activity

None

 

Object/
LPDISPATCH

Read Only

Contact

None

 

Object/
LPDISPATCH

Read Only

CurrentUser

None

 

String

Read Only

Email

None

 

Object/
LPDISPATCH

Read Only

Group

None

 

Object/
LPDISPATCH

Read Only

IsInBatchMode

None

 

Boolean

Read Only

IsLocked

None

 

Boolean

Read Only

IsMultiUser

None

 

Boolean

Read Only

IsOpen

None

 

Boolean

Read Only

IsOpening

None

 

Boolean

Read Only

LogTransactions

[True|False]

Boolean

Boolean

Read/Write

MajorVersion

None

 

Short Integer

Read Only

MinorVersion

None

 

Short Integer

Read Only

Name

None

 

String

Read Only

NoteHistory

None

 

Object/
LPDISPATCH

Read Only

PhoneFormatting

[iValue]

Short Integer

Short Integer

Read/Write

Relations

None

 

Object/
LPDISPATCH

Read Only

Users

None

 

Object/
LPDISPATCH

Read Only

Version

None

 

String

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

ActVersion

None

 

String

BeginBatchInsert

None

 

Boolean

BeginBatchUpdate

iBatchFlag

Short Integer

Boolean

Close

None

 

Void

DatabaseVersion

None

 

String

EndBatchInsert

None

 

Boolean

EndBatchUpdate

None

 

Boolean

GetDatabasePath

None

 

String

GetTableId

iIndex

Short Integer

Short Integer

GetTableNameFromId

iTableID

Short Integer

String

GetTableNameFromIndex

iIndex

Short Integer

String

GetUniqueId

None

 

String

Lock

None

 

Boolean

Open

szDatabaseName

String

Void

OpenEx

szDatabaseName

String

Void

TableCount

None

 

Short Integer

Unlock

None

 

Boolean

ValidateUser

szUser [, szPassword]

String, String

Void

ActiveUserCount Property

Description    Returns the total number of local and remote users logged on to the current database, including the OLE automation client. This number changes as users log on and log off the database.

Object            Database

Syntax            object.ActiveUserCount

Value type      Short Integer, Read Only

See also         IsMultiUser, IsOpen,
Count in Users object

Activity Property

Description    Returns an Activity object. The Database object returns the same instance of the Activity object on each subsequent call.

Object            Database

Syntax            object.Activity

Value type      Object/LPDISPATCH, Read Only

See also         Activity Object

Example         'This example demonstrates how to retrieve an Activity object.

 

dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Obtain the Activity object

dim activity as object

set activity = objData.ACTIVITY

set activity = Nothing

 

objData.Close

set objData = Nothing

ActVersion Method (requires ACT! 3.0.6 or later)

Description    Returns a string that contains the version of ACT! used by the ACT! OLE Database Object. An example of a returned string is 3.0.6.123, where 3.0.6.123 is the version of ACT!

Object            Database

Syntax            object.ActVersion

Return type   String

See also         Version

BeginBatchInsert Method (requires ACT! 4.0.2 or later)

Description    Puts the current database in batch mode for insertion of new records. Call Lock to lock the current database before using this method. Returns True if batch mode was successfully started or False if batch mode was not started. Use the LastError property to get information on an error.

Object            Database

Syntax            object.BeginBatchInsert

Return type   Boolean

See also         BeginBatchUpdate, EndBatchInsert, EndBatchUpdate, IsInBatchMode, IsLocked, Lock, Unlock
LastError in common properties and methods

Example         'This example demonstrates batch mode record insertion on an ACT! database.

 

Dim objContact As Object

Dim dbAct as Object

Dim LoopCount as Integer

 

Set dbAct.CreateObject("actole.database")

dbAct.Open dbName

 

Set objContact = dbAct.CONTACT

 

If dbAct.lock = False Then

   MsgBox "Could not lock database. Aborting"

   Exit Sub

End If

 

If dbAct.IsLocked = False Then

   MsgBox "Could not lock database. Aborting"

   Exit Sub

End If

 

If dbAct.BeginBatchInsert = False then

   MsgBox "Could not turn on batch mode. Error was: " & dbAct.LastError

   Exit sub

End If

 

If dbAct.IsInBatchMode = False then

   MsgBox "Could not turn on batch mode. Error was: " & dbAct.LastError

   Exit sub

End If

 

'Update 100 records here.

for LoopCount = 1 to 100

   objContact.Add

   objContact.Data 26, "Contact "

   objContact.Data 25, "Contact Company "

   objContact.Update

Next LoopCount

 

If dbAct.Unlock = False Then

   MsgBox "Could not unlock database. Aborting"

   Exit Sub

End If

 

if dbAct.EndBatchInsert = FALSE then

   MsgBox "Could not unlock database. Error was: "& dbAct.LastError

   Exit Sub

End If

 

dbAct.Close

BeginBatchUpdate Method (requires ACT! 4.0.2 or later)

Description    Puts the current database in batch mode for updating existing records. Returns True if batch mode was successfully started or False if batch mode was not started. Use the LastError property to get information on an error.

Object            Database

Syntax            object.BeginBatchUpdate iBatchFlag

Parameters    iBatchFlag             A short integer that specifies the batch update mode. Specify 0 for batch updates to a locked database or 1 for batch updates to an unlocked database. Better performance is provided by performing batch updates to a locked database.

Caution: To perform batch updates to a locked database, use Lock to lock the database and IsLocked to verify that the database was locked before using this method.

Return type   Boolean

See also         BeginBatchInsert, EndBatchInsert, EndBatchUpdate, IsInBatchMode, IsLocked, Lock, Unlock
LastError in common properties and methods

Example         'This example demonstrates batch mode record update operations on an
'ACT! database.

 

Dim objContact As Object

Dim dbAct as Object

Dim LoopCount as Integer

Set dbAct.CreateObject("actole.database")

dbAct.Open dbName

 

Set objContact = dbAct.CONTACT

 

If dbAct.Lock = False Then

   MsgBox "Could not lock database. Aborting"

   Exit Sub

End If

 

If dbAct.IsLocked = False Then

   MsgBox "Could not lock database. Aborting"

   Exit Sub

End If

 

If dbAct.BeginBatchUpdate = False then

   MsgBox "Could not turn on batch mode. Error was: " & dbAct.LastError

   Exit Sub

End If

 

If dbAct.IsInBatch = False then

   MsgBox "Could not turn on batch mode. Error was: " & dbAct.LastError

   Exit Sub

End If

 

'Update 100 records here.

for LoopCount = 1 to 100

   objContact.Edit

   objContact.Data 26, "Contact "

   objContact.Data 25, "Contact Company "

   objContact.Update

Next LoopCount

 

If dbAct.Unlock = False Then

   MsgBox "Could not unlock database. Aborting"

   Exit Sub

End If

 

If dbAct.EndBatchInsert = FALSE then

   MsgBox "Could not unlock database. Error was: "& dbAct.LastError

   Exit Sub

End If

 

dbAct.Close

Close Method

Description    Closes the current database. Call this method to close an open database or after unsuccessfully validating a user to a multiuser database.

Object            Database

Syntax            object.Close

Return type   Void

See also         IsOpen, IsOpening

Contact Property

Description    Returns a Contact object. The Database object returns the same instance of the Contact object on each subsequent call.

Object            Database

Syntax            object.Contact

Value type      Object/LPDISPATCH, Read Only

See also         Contact Object

CurrentUser Property

Description    Returns the name of the current user of the database. This property returns the logon name of the current user, not the contact name for that user.

Object            Database

Syntax            object.CurrentUser

Value type      String, Read Only

See also         IsMultiUser, IsOpen, Count in Users object

*VF

cCurrentUser =objContact.CurrentUser
 

DatabaseVersion Method (requires ACT! 4.0 or later)

Description    Returns a string that contains the version of the current database, which is 3.0 or 4.0 for the ACT! 4.0 application or 5.0 for the ACT! 2000 application.

Note: In ACT! 2000, ACT! 3.0 and ACT! 4.0 format databases must be converted to ACT! 2000 format.

Object            Database

Syntax            object.DatabaseVersion

Return type   String

Example         'This example checks for the OLE Database Object version, then checks

'if the database is an ACT! 3.0 or ACT! 4.0 format database.

 

If (Val(objDatabase.Version) > 3) Then

   If (Val(objDatabase.DatabaseVersion) > 3) Then

   'Ticker Symbol field is available only in ACT! 4.0 format database.

   objDatabase.CONTACT.Data CF_TickerSymbol, "TS"

   End If

End If

Email Property

Description    Returns an Email object. The Database object returns the same instance of the Email object on each subsequent call.

Object            Database

Syntax            object.Email

Value type      Object/LPDISPATCH, Read Only

See also         Email Object

EndBatchInsert Method (requires ACT! 4.0.2 or later)

Description    Turns off batch mode to end batch insertion of new records for the current database. Returns True if batch mode was successfully turned off or False if batch mode was not turned off. Use the LastError property to get information on an error.

Object            Database

Syntax            object.EndBatchInsert

Return type   Boolean

See also         BeginBatchInsert

Example         See BeginBatchInsert, BeginBatchUpdate, EndBatchUpdate, IsInBatchMode, IsLocked, Lock, Unlock
LastError in common properties and methods

EndBatchUpdate Method (requires ACT! 4.0.2 or later)

Description    Turns off batch mode to end batch update of existing records for the current database. Returns True if batch mode was successfully turned off or False if batch mode was not turned off. Use the LastError property to get information on an error.

Object            Database

Syntax            object.EndBatchUpdate

Return type   Boolean

See also         BeginBatchUpdate, IsInBatchMode

Example         See BeginBatchInsert, BeginBatchUpdate, EndBatchInsert, IsInBatchMode, IsLocked, Lock, Unlock
LastError in common properties and methods

GetDatabasePath Method (requires ACT! 4.0 or later)

Description    Returns a string that contains the full path to the currently open database. If no database is open, a null value or empty string is returned.

Object            Database

Syntax            object.GetDatabasePath

Return type   String

Example         'This example gets the path of the currently open database from

'the Database object.

 

dim objDatabase as Object

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open(C:\My Documents\ACT\Database\ACT5demo.dbf)

if objDatabase.IsOpen = FALSE then

   MsgBox "Failed opening the database"

else

   MsgBox "Currently open database is: " & objDatabase.GetDatabasePath

endif

 

objDatabase.Close

Set objDatabase = Nothing

GetTableId Method (requires ACT! 3.0.6 or later)

Description    Returns a short integer that contains the Table ID of the ACT! table with the specified index, as stored in the ACT! codebase schema.

Object            Database

Syntax            object.GetTableId iIndex

Parameters    iIndex                    A short integer that specifies the table index number, in a range between 0 and one less than the value of TableCount.

Return type   Short Integer

Comments     This method returns the following Table ID values:

Table ID

Table name

 

Table ID

Table name

1

Contact table

 

16

Group table

2

Activity table

 

32

Sales table

4

Notes/History table

 

64

List table

8

E-mail table

 

 

 

See also         GetTableNameFromId, GetTableNameFromIndex, TableCount

GetTableNameFromId Method (requires ACT! 3.0.6 or later)

Description    Returns a string that contains the table name for the specified Table ID.

Object            Database

Syntax            object.GetTableNameFromId iTableID

Parameters    iTableID                A short integer that specifies the Table ID.

This method returns the following table names:

Table ID

Table name

 

Table ID

Table name

1

Contact table

 

16

Group table

2

Activity table

 

32

Sales table

4

Notes/History table

 

64

List table

8

E-mail table

 

 

 

Return type   String

See also         GetTableId, GetTableNameFromIndex

GetTableNameFromIndex Method (requires ACT! 3.0.6 or later)

Description    Returns a string that contains the table name for the specified table index number.

Object            Database

Syntax            object.GetTableNameFromIndex iIndex

Parameters    iIndex                    A short integer that specifies the table index number, in a range between 0 and one less than the value of TableCount.

Return type   String

See also         GetTableId, GetTableNameFromId, TableCount

GetUniqueId Method

Description    Returns a string that contains a new Unique ID.

Object            Database

Syntax            object.GetUniqueId

Return type   String

See also         IsOpen

Group Property

Description    Returns a Group object. The Database object returns the same instance of the Group object on each subsequent call.

Object            Database

Syntax            object.Group

Value type      Object/LPDISPATCH, Read Only

See also         Group object

IsInBatchMode Property (requires ACT! 4.0.2 or later)

Description    Returns True if the current database is in batch mode for insertion of records or False if it is not in batch mode. Call this property immediately before inserting records into a database in batch mode.

Object            Database

Syntax            object.IsInBatchMode

Value type      Boolean, Read Only

See also         BeginBatchInsert, BeginBatchUpdate, EndBatchInsert, EndBatchUpdate, IsLocked, Lock, Unlock

Example         See BeginBatchInsert

IsLocked Property (requires ACT! 4.0.2 or later)

Description    Returns True if the current database is locked or False if it is not locked. Call this property immediately before turning on batch mode for insertion of records into a database.

Object            Database

Syntax            object.IsLocked

Value type      Boolean, Read Only

See also         BeginBatchInsert, BeginBatchUpdate, EndBatchInsert, EndBatchUpdate, IsInBatchMode, Lock, Unlock

Example         See BeginBatchInsert

IsMultiUser Property

Description    Returns True if the open database is a multiuser database (or a password-protected single-user database) or False if it is a single-user database.

Object            Database

Syntax            object.IsMultiUser

Value type      Boolean, Read Only

Comments     Multiuser databases must have two or more users who have logged on to the database and have generated a My Record contact record. Adding an ACT! user who hasn’t logged in as that user at least once does not increase the user count.

See also         IsOpen, IsOpening, ValidateUser
Count in Users object

Example         See ValidateUser

IsOpen Property

Description    Returns the open status of the database. Returns True after Open has been successfully called for a single-user database or after ValidateUser has been successfully called for a multiuser database. False is returned if Open has been called successfully for a multiuser database.

Object            Database

Syntax            object.IsOpen

Value type      Boolean, Read Only

See also         IsMultiUser, IsOpen, ValidateUser

IsOpening Property

Description    Returns the current open status of a multiuser database. Returns True after Open has been successfully called for a multiuser database and prior to calling ValidateUser. Returns False after ValidateUser has been successfully completed.

Object            Database

Syntax            object.IsOpening

Value type      Boolean, Read Only

See also         IsMultiUser, IsOpen, ValidateUser
Count in Users object

Lock Method (requires ACT! 4.0.2 or later)

Description    Locks the current database. If the database is currently in use, either on a network drive or the local computer, the database lock is delayed by five minutes. True is returned if the database is successfully locked or False is returned if the database could not be locked. Use the LastError property to get information on an error.

Object            Database

Syntax            object.Lock

Return type   Boolean

Comments     To use this method, the logged on user must have an Administrator security level.

See also         BeginBatchInsert, Unlock
LastError in common properties and methods

LogTransactions Property

Description    Gets and sets the status of automatic transaction logging. This property returns or sets True if transaction log records will be generated when contact data is added, modified, or deleted or returns False if the transaction log records are not generated by changes to contact data. The default value is False.

Object            Database

Syntax            object.LogTransactions [True|False]

Parameters    [True|False]           Specify True to turn on automatic transaction logging, or False to turn off automatic transaction logging. Omit this optional parameter to get the status of automatic transaction logging.

Value type      Boolean, Read/Write

MajorVersion Property

Description    Returns the major version number of the ACT! OLE Database Object.

Object            Database

Syntax            object.MajorVersion

Value type      Short Integer, Read Only

Comments     Use Version instead of this property for ACT! 3.0.6 or later to determine if new properties and methods in the OLE Database Object can be used.

                        This property returns one of the following values:

Value

Version of ACT!

 

Value

Version of ACT!

1

3.0 through 3.0.5

 

40

4.0.x

30

3.0.6 through 3.0.8

 

50

2000

4

4.0

 

 

 

See also         MinorVersion, Version

MinorVersion Property

Description    Returns the minor version number of the ACT! OLE Database Object. In ACT! 3.0.7, for example, a value of “7” is returned.

Object            Database

Syntax            object.MinorVersion

Value type      Short Integer, Read Only

Comments     Use Version instead of this property for ACT! 3.0.6 or later to determine if new properties and methods in the OLE Database Object can be used.

See also         MajorVersion, Version

Name Property

Description    Returns a string containing the name of the currently open database, for example “act5demo.dbf”.

Object            Database

Syntax            object.Name

Value type      String, Read Only

See also         IsOpen, Open

NoteHistory Property

Description    Returns a NoteHistory object. The Database object returns the same instance of the NoteHistory object on each subsequent call.

Object            Database

Syntax            object.NoteHistory

Value type      Object/LPDISPATCH, Read Only

Open Method

Description    Opens the specified database. This method opens a single user or multiuser database, and must be successful to access properties and methods that are database-dependent.

Object            Database

Syntax            object.Open szDatabaseName

Parameters    szDatabaseName   A string that specifies the name and path of an ACT! database.

Return type   Void

See also         IsMultiUser, IsOpen, IsOpening, OpenEx, ValidateUser

OpenEx Method (requires ACT! 4.0 or later)

Description    Opens the specified database, bypassing the validation process provided by the ValidateUser method. To use this method, the specified database must be open in the ACT! application. This method opens a single user or multiuser database, and must be successful to access properties and methods that are database-dependent.

Object            Database

Syntax            object.OpenEx szDatabaseName

Parameters    szDatabaseName   A string that specifies the name and path of an ACT! database. Specify szDatabaseName as "" to open the currently open database.

Return type   Void

See also         IsMultiUser, IsOpen, IsOpening, Open, ValidateUser

Example         'This example opens a database without validating the user.

 

dim objDatabase as Object

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.OpenEx ""

if objDatabase.IsOpen = FALSE then

   MsgBox "Failed opening the database"

else

   MsgBox "Currently open database is: " & objDatabase.GetDatabasePath

endif

 

dim objDatabase as Object

Set objDatabase = Nothing

PhoneFormatting Property

Description    Gets and sets the format for phone numbers that are returned by the Data method.

Note: When setting data into a phone field, you can only pass a TAPI canonical-formatted phone number.

Object            Database

Syntax            object.PhoneFormatting [iValue]

Parameters    iValue                    A short integer that specifies the phone number format, in a range from 1 to 3. Omit this optional parameter to get the phone number format.

Value type      Short Integer, Read/Write

Comments     This property returns or sets one of the following values:

Value

Description

1

All phone numbers are returned in TAPI canonical format. This string may be passed to any TAPI components. This is the default setting.

2

All phone numbers are returned in ACT! 2000 displayable format, which may not work with an automatic dialer.

3

All phone numbers are returned in ACT! 2000 displayable format, starting with a country code enclosed in brackets [ ]. The default country code is the My Record phone number country code, which is [1] for the United States and Canada. This format may not work with an automatic dialer.

See also         IsOpen, Open

Relations Property (requires ACT! 3.0.6 or later)

Description    Returns the Relations object. The Database object returns the same instance of the Relations object on each subsequent call.

Object            Database

Syntax            object.Relations

Value type      Object/LPDISPATCH, Read Only

TableCount Method (requires ACT! 3.0.6 or later)

Description    Returns a short integer that contains the total number of ACT! database tables. The value “5” is returned in ACT! 3.0.6 and 4.0. The value “7” is returned in ACT! 2000.

Object            Database

Syntax            object.TableCount

Return type   Short Integer

Unlock Method (requires ACT! 4.0.2 or later)

Description    Unlocks the current database. True is returned if the database is successfully unlocked or False is returned if the database could not be unlocked. Use the LastError property to get information on an error.

Object            Database

Syntax            object.Unlock

Return type   Boolean

Comments     To use this method, the logged on user must have an Administrator security level.

See also         BeginBatchInsert, Lock
LastError in common properties and methods

Users Property

Description    Returns a Users object. The Database object returns the same instance of the Users object on each subsequent call.

Object            Database

Syntax            object.Users

Value type      Object/LPDISPATCH, Read Only

ValidateUser Method

Description    Authenticates a user to a multiuser database.

Object            Database

Syntax            object.ValidateUser szUser [, szPassword]

Parameters    szUser                    A string that specifies the user’s name.

[szPassword]         A string that specifies the user’s password. This parameter is required if the user has a password.

Return type   Void

Comments     Call this method after the following conditions have been met:

1        After calling Open, and

2       False is returned for IsOpen, and

3       True is returned for IsOpening or IsMultiUser.

Note: To use this method, the specified user must have previously logged on to the database and generated a My Record contact record. When more than one user is enabled for logon to the database, call this method after calling Open.

See also         IsMultiUser, IsOpen, IsOpening, Open

Example        

'VB This sample demonstrates how to properly log on to a multiuser
'ACT! database

Dim objData as Object

'Create the object

Set objData = CreateObject("ACTOLE.DATABASE")

'Open the database

objData.Open dbName

'Perform login validation - nothing really happens

If objData.IsMultiUser Then

   'at this point you can display a dialog which asks for

   'username and password. The dialog is something you create.

   objData.ValidateUser username, password

   If objData.Error Then

       Login = False

   Else

       Login = True

   End If

Else

   Login = True

   'Single-user database - validation not required

End If

If objData.IsOpen Then

   'At this point it is now safe to start reading/writing ACT! data.

   objData.Close

End If

Set objData = Nothing

Version Property (requires ACT! 3.0.6 or later)

Description    Returns a string that contains the version of the ACT! OLE Database Object. An example of a returned string is 5.0.0.175, where 5.0.0 is the version of ACT! (ACT! 2000) and 175 is the number of the build. Use this property to verify the version to determine if new properties and methods in the OLE Database Object can be used.

Object            Database

Syntax            object.Version

Value type      String, Read Only

See also         ActVersion

Email object methods

The Email object contains e-mail information for the active Database object. The following methods apply only to the Email object. See “Common properties and methods” in this section for additional properties and methods that apply to the Email object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

ClearContactScope

None

 

Void

SetContactScope

szUniqueID

String

Void

ClearContactScope Method (requires ACT! 3.0.7 or later)

Description    Clears any existing contact scoping. Resets the current record position to the first record and rebuilds the list of E-mail records without applying contact scoping.

Object            Email

Syntax            object.ClearContactScope

Return type   Void

See also         SetContactScope

SetContactScope Method (requires ACT! 3.0.7 or later)

Description    Narrows the current set of E-mail records to the E-mail records for the contact record with the specified Unique ID. You can apply this scoping method along with other scoping methods and filters.

Object            Email

Syntax            object.SetContactScope szUniqueID

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

Return type   Void

See also         ClearContactScope

Example         'List the e-mail address and other e-mail properties for a contact.

 

Dim objDatabase As Object

Dim objEmail As Object

Dim strContactID As String

 

'Clear the listbox

lstDisplay.Clear

 

'Create the object

lstDisplay.AddItem "Creating Database Object"

Set objDatabase = CreateObject("ACTOLE.DATABASE")

 

'Open the database

lstDisplay.AddItem "Opening Database"

objDatabase.Open dbName

 

'Assign the correct table object

Set objEmail = objDatabase.EMAIL

 

If objDatabase.IsOpen Then

   objEmail.SetContactScope strContactID

   lstDisplay.AddItem objEmail.RecordCount & " found for the Contact"

   Set objEmail = Nothing

   objDatabase.Close

   lstDisplay.AddItem "Database Closed"

End If

 

Set objDatabase = Nothing

ExceptionInfo object properties and methods

The ExceptionInfo object contains the recurring exception information for a particular activity. The following properties and methods apply only to the ExceptionInfo object. See “Common properties and methods” in this section for additional properties that apply to the ExceptionInfo object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

Count

None

Short Integer

Short Integer

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

Add

exceptionDate

Date

Void

Clear

None

 

Void

Remove

exceptionDate

Date

Void

Seek

exceptionDate

Date

Void

Value

iIndex

Short Integer

Date/Variant

Add Method

Description    Adds a date to the exception list for the current activity.

Object            ExceptionInfo

Syntax            object.Add exceptionDate

Parameters    exceptionDate        A Date value that specifies the date to add to the exception list, formatted in Windows Regional Settings Short Date style.

Return type   Void

Clear Method

Description    Clears and commits the exception list for the current activity. Call this method to erase the list of exceptions for a primary recurring activity.

Object            ExceptionInfo

Syntax            object.Clear

Return type   Void

Comments     This method does not erase any activity records; it just makes ACT! erase the exception and reset the previous date. For example, if an occurrence of a recurring activity is moved from the 3rd to the 4th, a new activity record is generated for the 4th. If the exception list for the primary recurring activity is erased, the activity for the 3rd reappears.

                        A recurring activity has only one record, which is the primary activity. All other instances of a recurring activity are mathematically calculated and are not represented in the physical database.

Count Property

Description    Returns the number of exceptions for the current activity.

Object            ExceptionInfo

Syntax            object.Count

Value type      Short Integer, Read Only

Comments     An exception item is a Date value stored with the primary recurring activity. The Date value represents a recurring instance of the activity that has been altered.

                        For example, an activity is set to recur every other day, for example the 1st, 3rd, and the 5th, and the user moves the recurring instance for the 3rd to the 4th. ACT! generates a new activity record with a date of the 4th and adds the 4th to the exception list of the primary recurring activity, which is the 1st in this example, thus increasing the count or number of exceptions.

Remove Method

Description    Removes a date from the exception list. Removing a date causes the recurring instance for the deleted date to reappear in the calendar as an activity.

Object            ExceptionInfo

Syntax            object.Remove exceptionDate

Parameters    exceptionDate        A Date value that specifies the date to remove from the exception list, formatted in Windows Regional Settings Short Date style.

Return type   Void

Seek Method

Description    Locates the specified exception date. Call this method to determine if a specified date exists in the exception list.

Object            ExceptionInfo

Syntax            object.Seek exceptionDate

Parameters    exceptionDate        A Date value that specifies the exception date to locate, formatted in Windows Regional Settings Short Date style.

Return type   Void

Value Method

Description    Returns a date value for a position in the exception list.

Object            ExceptionInfo

Syntax            object.Value iIndex

Parameters    iIndex                    A short integer that specifies the position within the exception list, in the range between 1 and Count.

Return type   Date/Variant

See also         Count

Fields object properties and methods

The Fields object contains the data properties for a specified ACT! field. The following properties and methods apply only to the Fields object. See “Common properties and methods” in this section for additional properties that apply to the Fields object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

AutoPopulate

iFieldID
[,=True|False]

Short Integer,
Boolean

Boolean

Read/Write

Count

None

 

Short Integer

Read Only

DecimalPlaces

iFieldID [= iDecPlace]

Short Integer, Short Integer

Short Integer

Read/Write

EntryRule

iFieldID

Short Integer

Short Integer

Read/Write

EntryTrigger

iFieldID
[, szExecutableName]

Short Integer,
String

String

Read/Write

Exists

szField

String

Boolean

Read Only

ExitTrigger

iFieldID
[, szExecutableName]

Short Integer,
String

String

Read/Write

FieldId

szField

String

Short Integer

Read Only

FieldIdAt

iFieldID

Short Integer

Short Integer

Read Only

Flags

iFieldID [= lFlag]

Short Integer,
Long Integer

Long Integer

Read/Write

HasPopupList

iFieldID

Short Integer

Boolean

Read Only

Id

iFieldID

Short Integer

Short Integer

Read Only

InitialValue

iFieldID

Short Integer

String

Read/Write

IsBlockSync

iFieldID [=True|False]

Short Integer, Boolean

Boolean

Read/Write

IsCutHistory

iFieldID
[True|False]

Short Integer, Boolean

Boolean

Read/Write

IsIndexed

iFieldID

Short Integer

Boolean

Read Only

IsPrimary

iFieldID

Short Integer

Boolean

Read/Write

IsSortable

iFieldID

Short Integer

Boolean

Read Only

Label

iFieldID [= szLabel]

Short Integer, String

String

Read/Write

Length

iFieldID

Short Integer

Short Integer

Read Only

Modifiable

iFieldID

Short Integer

Long Integer

Read Only

POPUPINFO

iFieldID, iPopupIndex

Short Integer,
Short Integer

Object/
LPDISPATCH

Read Only

Type

iFieldID

Short Integer

Short Integer

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

BeginBatch

None

 

Boolean

EndBatch

None

 

Boolean

GetLinkToList

iFieldID,
iLinkToField,
iLinkToTable

Short Integer,
Short Integer,
Short Integer

Short Integer

SetLinkToList

iFieldID,
iLinkToField,
iLinkToTable

Short Integer,
Short Integer,
Short Integer

Boolean

UnLinkLists

iFieldID,
True|False

Short Integer,
Boolean

Boolean

AutoPopulate Property (requires ACT! 2000 or later)

Description    Gets or sets the Automatically Add New Items To Drop-Down option in Define Fields for the specified field. Returns True if the option is selected or False if the option is not selected. If set, AutoPopulate enables auto-population of a field with a drop-down list.

Object            Fields

Syntax            object.AutoPopulate iFieldID [, = True|False]

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

[= True|False]       Specify True to select the Automatically Add New Items To Drop-Down option for the specified field or False to deselect it. Omit this optional parameter to determine the setting of the option.

ValueType      Boolean, Read/Write

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

 'Open the database

List1.AddItem "Opening Database"

objDatabase.Open dbName

 If objDatabase.IsOpen Then

   Set objContact = objDatabase.CONTACT

   'Let the User1 fields auto-populate property be set to true

   objContact.fields.AutoPopulate CF_User1, True

   objDatabase.close

End If

 Set objData = Nothing

BeginBatch Method (requires ACT! 4.0.2 or later)

Description    Prepares the database for schema editing. Returns True if the database is prepared for schema editing and False if it is not prepared. Use the LastError property to get information on an error.

Note: Batch functions must be called in the correct sequence. Any functions called that attempt to place another lock on a schema can cause problems. Therefore, you should call only those functions that are needed during batch mode.

Object            Fields

Syntax            object.BeginBatch

Return type   Boolean

See also         EndBatch
LastError in common properties and methods

Example         'The following sample changes various properties of different fields in the

'Contact object in Batch mode.

 Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase .Open dbName

Dim ret As Boolean

 If objDatabase .IsOpen Then

   'Create the Contact and Fields objects

   Set objContact = objDatabase .Contact

   Set objCF = objContact.fields

    'Begin the batch processing, catch errors, and exit the process

   'if unsuccessful.

   ret = objCF.BeginBatch

    If ret <> True Then   'If there was an error

       MsgBox "Problem entering batch , Error# " & objCF.LastError

       End Sub

   End If

    'Set some properties for various Contact fields

   objCF.IsCutHistory CF_Name, False

   objCF.IsCutHistory CF_Company, True

   objCF.IsCutHistory CF_City, True

   objCF.SetLinkToList CF_User1, CF_Company, 1

   objCF.EntryRule CF_User2, 2

   objCF.UnLinkLists CF_AltCity, True

 

   'Complete the batch mode

   ret = objCF.EndBatch

   'If an error occurs, flag the error

   If ret <> True Then

       MsgBox "Problem ending batch , Error# " & objCF.LastError

       End Sub

   End If

End If

 Set objCF = Nothing

Set objContact = Nothing

objDatabase.Close

Set objdatabase = Nothing

Count Property

Description    Returns the number of fields in the parent table object.

Object            Fields

Syntax            object.Count

Value type      Short Integer, Read Only

DecimalPlaces Property

Description    Gets and sets the number of decimal places in the specified field.

Object            Fields

Syntax            object.DecimalPlaces iFieldID [= iDecPlace]

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

[= iDecPlace]         A short integer that specifies the number of decimal places to set for the specified field. Omit this optional parameter to get the number of decimal places in the specified field.

Value type      Short Integer, Read/Write

See also         Count, Modifiable

EndBatch Method (requires ACT! 4.0.2 or later)

Description    Ends the current batch operation. Returns True if the batch operation has ended and False if it has not ended. Use the LastError property to get information on an error.

Note: Batch functions must be called in the correct sequence. Any functions called that attempt to place another lock on a schema can cause problems. Therefore, you should call only those functions that are needed during batch mode.

Object            Fields

Syntax            object.EndBatch

Return type   Boolean

See also         BeginBatch
LastError in common properties and methods

EntryRule Property (requires ACT! 4.0.2 or later)

Description    Gets and sets the entry rule attribute for the field specified by the iFieldID parameter.

Object            Fields

Syntax            object.EntryRule iFieldID [=iEntryRule]

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

[=iEntryRule]         A short integer that specifies the entry rule for the specified field. Omit this optional parameter to get the entry rule.

Value type      Short Integer, Read/Write

Comments     This property can get or set one of the following values:

Value

Description

0

No rules

1

Field cannot be blank (data is required)

2

Only from drop-down (information must be selected from a drop-down list)

3

Protected (protects the field from modification)

See also         IsCutHistory, EntryTrigger

EntryTrigger Property

Description    Gets and sets the Entry Trigger executable file for the specified field.

Object            Fields

Syntax            object.EntryTrigger iFieldID [, szExecutableName]

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

[, szExecutableName]   A string that specifies the executable application (.EXE) or macro (.MPR) entry trigger file to launch when the specified field is entered. Omit this optional parameter to get the name of the executable file that is the entry trigger for the specified field.

Value type      String, Read/Write

See also         Count, ExitTrigger

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

Dim tableObject As Object

Set tableObject = objData.CONTACT

 

'*** Set an entry trigger to NOTEPAD.EXE

tableObject.FIELDS.EntryTrigger CF_Company, "notepad.EXE"

 

'*** Get the entry trigger

dim strOut as String

strOut = tableObject.FIELDS.EntryTrigger (CF_Company)

objData.Close

 

set objData = Nothing

Exists Property

Description    Returns True if the specified field exists or False if it does not exist.

Object            Fields

Syntax            object.Exists szField

Parameters    szField                   A string that specifies the label of the field.

Value type      Boolean, Read Only

See also         Count, Label

ExitTrigger Property

Description    Gets and sets the Exit Trigger executable file for the specified field.

Object            Fields

Syntax            object.ExitTrigger iFieldID [, szExecutableName]

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

[, szExecutableName]   A string that specifies the executable application (.EXE) or macro (.MPR) exit trigger file to launch when the specified field is exited. Omit this optional parameter to get the name of the executable file that is the exit trigger for the specified field.

Value type      String, Read/Write

See also         Count, EntryTrigger

Example         'This example demonstrates how to set and get exit triggers.

 dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 Dim tableObject As Object

Set tableObject = objData.CONTACT

 '*** Set an exit trigger to NOTEPAD.EXE

tableObject.FIELDS.ExitTrigger CF_Company, "notepad.EXE"

 '*** Get the exit trigger

dim strOut as String

strOut = tableObject.FIELDS.ExitTrigger (CF_Company)

objData.Close

 set objData = Nothing

FieldId Property (requires ACT! 3.0.7 or later)

Description    Returns a short integer containing the field ID for the field with the specified name. Field names are shown in Define Fields within the ACT! application.

Object            Fields

Syntax            object.FieldId szField

Parameters    szField                   A string that specifies the field name. See the ACT! Database File Formats Reference appendix for the default field names for fields in ACT! database tables (Field constants).

Value type      Short Integer, Read Only

Example         'Get the field ID for the Company field in the Contact table

 Dim nFieldId as integer

'nFieldId should have the value 25

nFieldId = ObjContact.FIELDS.FieldId ("Company")

FieldIdAt Property (requires ACT! 3.0.6 or later)

Description    Returns a short integer containing the field ID for the field with the specified index.

Object            Fields

Syntax            object.FieldIdAt iFieldID

Parameters    iFieldID                 A short integer that specifies the index number for the field, in the range between 1 and Count.

Value type      Short Integer, Read Only

Flags Property

Description    Gets and sets the drop-down list flag for the specified field. This property is used to get and set the field definitions for fields with drop-down lists.

Object            Fields

Syntax            object.Flags iFieldID [= lFlag]

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

[= lFlag]                A long integer that specifies a value between 0 and 3, to set or clear the flag(s) for a specified field. Omit this optional parameter to get the value of the flag.

Value type      Long Integer, Read/Write

Comments     This property can get or set one of the following values:

Value

Description

0

Clears the flags for Allow Editing and Show Descriptions to disable editing of drop-down list items and disable the display of drop-down list item descriptions for the specified field.

1

Sets the flag for Allow Editing to allow the editing of drop-down list items for the specified field.

2

Sets the flag for Show Descriptions to display drop-down list item descriptions for the specified field.

3

Sets the flags for Allow Editing and Show Descriptions of drop-down list items for the specified field.

GetLinkToList Method (requires ACT! 2000 or later)

Description    Gets the field ID and table (Contact or Group) with the drop-down list that is linked to by specified field.

Object            Fields

Syntax            object.LinkToList iFieldID, iLinkToField, iLinkToTable

Parameters    iFieldID                 A short integer that specifies the field ID of the field for which to find a field with the linked drop-down list the field.

iLinkToField          A short integer variable to contain the field ID of the field with the drop-down list linked to the field specified in the iFieldID parameter.

iLinkToTable         A short integer variable to contain a value for the table containing the fields with the linked drop-down list. A value of 1 is returned for the Contact table and 16 is returned for the Group table.

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

Return type   Short Integer

See also         SetLinkToList, UnLinkLists

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

objDatabase.Open dbName

 If objDatabase.IsOpen Then

   Set objContact = objData.CONTACT

   'FieldID: stores the field ID of the field with the drop-down list

   'linked to the CF_User1 field.

   'TableID : Stores the ID of the table (Contact or Group)

   'containing the field with the linked drop-down list.

   objContact.fields.GetLinkToList(CF_User1, FieldID, TableID)

   MsgBox " User1 is using dropdown list from " & FieldID & "  of table " &

       TableID

   Set objContact = Nothing

   objData.close

End If

 Set objData = Nothing

HasPopupList Property

Description    Returns True if the specified field has a drop-down list or False if the field does not have a drop-down list.

Object            Fields

Syntax            object.HasPopupList iFieldID

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

Value type      Boolean, Read Only

Id Property

Description    Gets the field ID of the specified field. You can use this property to verify that the specified field exists. If the field does not exist, this property returns the value –1. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

Object            Fields

Syntax            object.Id iFieldID

Parameters    iFieldID                 A short integer that specifies the index number for the field, in the range between 1 and Count.

Value type      Short Integer, Read Only

See also         Count

InitialValue Property

Description    Gets and sets the default value in new records for the specified field.

Object            Fields

Syntax            object.InitialValue iFieldID

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

Value type      String, Read/Write

See also         Count, Modifiable

IsBlockSync Property

Description    Gets and sets synchronization blocking for the specified field. If True is set or returned, the field is not available (blocked) for data synchronization. If False is set or returned, the field is available for data synchronization.

Object            Fields

Syntax            object.IsBlockSync iFieldID [= True|False]

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

[=True|False]        Specify True if the field is not available (blocked) for data synchronization or False if the field is available for data synchronization. Omit this parameter to get the synchronization setting for the specified field.

Value type      Boolean, Read/Write

See also         Count, Modifiable

IsCutHistory Property

Description    Gets and sets the generate history attribute for the specified field. Returns True if a history record is generated when the specified field is modified or False if a history record is not generated. (Requires ACT! 4.0.2 or later for the set function.)

Object            Fields

Syntax            object.IsCutHistory iFieldID [True|False]

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

True|False             Specify True to generate a history record when the specified field is modified or False to not generate a history record (requires ACT! 4.0.2 or later). Omit this optional parameter to get the generate history attribute for the specified field.

Value type      Boolean, Read/Write

See also         Count, Modifiable

IsIndexed Property

Description    Returns True if the specified field has an index applied or False if the field is not indexed.

Object            Fields

Syntax            object.IsIndexed iFieldID

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

Value type      Boolean, Read Only

See also         Count

IsPrimary Property

Description    Returns True if the specified field is a Primary Field or False if the field is not a Primary Field. The contents of primary fields are copied when a contact or group is duplicated.

Object            Fields

Syntax            object.IsPrimary iFieldID

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

Value type      Boolean, Read/Write

See also         Count, Modifiable

IsSortable Property

Description    Returns True if the specified field can be indexed or False if it cannot be indexed. Check this property for a field before passing the field to the Sort method.

Object            Fields

Syntax            object.IsSortable iFieldID

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

Value type      Boolean, Read Only

See also         Count

Label Property

Description    Gets and sets the field label that is displayed in the ACT! application. This property refers to the field label that is displayed in the ACT! application and not the database structure field name. Use the Rebuild method to rebuild the table after making changes to field label names.

Caution: This property is modifiable by all users, so be careful when using this as a reference.

Object            Fields

Syntax            object.Label iFieldID [= szLabel]

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

[= szLabel]            A string that specifies the new label name for the specified field. Omit this optional parameter to get the existing field label for the specified field.

Value type      String, Read/Write

See also         Count, Modifiable
Rebuild in common properties and methods

 

*VFox - renaming the fields from outside of ACT!

* Rename the first User Defined Field of Groups to be the same as the same as the Contact's User1 field.
=objGroup.FieldsLabel(1001) =objContact.Fields.Label(50)

 

Length Property

Description    Returns the length of the specified field.

Object            Fields

Syntax            object.Length iFieldID

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

Value type      Short Integer, Read Only

Comments     ACT! fields with a length that can be modified return a value of 1 or higher for the length. The ACT! fixed-length system fields of Blob, Date, DateTime, Phone, Time, TimeStamp, and UniqueID return a value of -1 for the length.

See also         Count, Modifiable

Modifiable Property

Description    Returns a long integer for the flag that specifies the allowable attribute changes for the field.

Object            Fields

Syntax            object.Modifiable iFieldID

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

Value type      Long Integer, Read Only

See also         Count

Comments     This property can return any combination of the following hexadecimal flag values:

Hexadecimal value

Description

&H0

Field cannot be modified

&H1

Field can be deleted, only by ACT!

&H2

Type can be modified

&H4

Label can be modified

&H8

Length can be modified, only by ACT!

&H10

Decimal places can be modified

&HFFFF

All field attributes are modifiable

To determine if a particular attribute flag is set, AND the hex value of the long integer returned with the desired flag. If the result is equal to the desired flag, the flag is set. If the result is not equal to the desired flag, the flag is not set.

PopUpInfo Property

Description    Returns a PopupInfo object.

Object            Fields

Syntax            object.POPUPINFO iFieldID, iPopupIndex

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

iPopupIndex          A short integer that specifies a drop-down list that has been associated with a field. The value of zero is usually returned for this field.

Value type      Object/LPDISPATCH, Read Only

Comments     This method will initialize a PopupInfo object with the field ID and popup index values, and return its object/dispatch pointer. It is possible to have more than one drop-down list associated with a particular field. Currently, the only field that has more than one drop-down list is the Regarding field in the Activity object.

SetLinkToList Method (requires ACT! 2000 or later)

Description    Sets the field with the drop-down list to link to the specified field in the Contact or Group table. This method locks the current database. If the database is currently in use, either on a network drive or the local computer, the database lock is delayed by five minutes. Returns True if successful or False if unsuccessful.

Object            Fields

Syntax            object.SetLinkToList iFieldID, iLinkToField, iLinkToTable

Parameters    iFieldID                 A short integer that specifies the field ID of the field for which to link to the drop-down list in the field specified by the iLinkToField parameter.

iLinkToField          A short integer that specifies the field ID of the field with the drop-down list to link to the field specified by the iFieldID parameter.

iLinkToTable         A short integer that specifies the table containing the field with the drop-down list to link to the field specified by the iFieldID parameter. Specify 1 for the Contact table or 16 for the Group table.

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

            Return type   Boolean

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objContact = objData.CONTACT

   'CF_User1 field to link to the drop-down list in the User1 field

   'of the Group table.

   objContact.fields.SetLinkToList(CF_User1, GF_User1, 16)

   MsgBox " User1 is using drop-down list from " & fieldID & "  of table " &

       TableId

   Set objContact = Nothing

   objData.close

End If

 

Set objData = Nothing

Type Property

Description    Returns a value that represents the data type for a specified field.

Object            Fields

Syntax            object.Type iFieldID

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

Value type      Short Integer, Read Only

Comments     This property returns the following data type values:

Value

Description

Format

Example

0

None

 

 

1

String

 

fieldName

2

String -Uppercase

 

FIELDNAME

3

String -Lowercase

 

fieldname

4

String -Initial Capital

 

Fieldname

5

Numeric

 

5

6

Numeric -Currency

($$¢¢)

5000

7

TimeStamp

yyyyMMddhhmmss

19940501202701

8

Date

Short Date style in Windows Regional Settings

11/13/97

9

Time

Time style in Windows Regional Settings

20:27

10

DateTime

Short Date style and Time style in Windows Regional Settings

11/13/97 8:27pm

11

Blob

 

 

12

Binary

 

 

13

Unique ID

 

7O)E& HP"7R

14

Phone

canonical

+1 (905) 5554993

15

String -URL Address

 

www.actsoftware.com

Note: The field type refers to the data formatting information required by ACT! to display visible fields in the ACT! application. The data may be stored differently in its native format.

Date and time fields must be the required length and be formatted correctly as specified by the Short Date Style and Time Style in Windows Regional Settings when passed as a parameter to the Data property, or an error will be generated. TimeStamp field values are generated by the ACT! application. See Chapter 1 in this section for more information on date and time formats.

See also         Count, Modifiable
Data, Error, LastError in common properties and methods

UnLinkLists Method (requires ACT! 2000 or later)

Description    Removes the association of a field drop-down list with another list, so the two lists are independent. This means that a change to the list in a field is not changed in the list in another field. Returns True if successful or False if unsuccessful.

Object            Fields

Syntax            object. UnLinkLists (iFieldID, True|False)

Parameters    iFieldID                 A short integer that specifies the field ID of the field with which to remove the association with the list in another field. See the ACT! Database File Formats Reference appendix for lists of field IDs and names (Field constants).

                        True|False             Specify True to link the lists and False to unlink the lists.

Return type   Boolean

See also         GetLinkToList, SetLinkToList in common properties and methods

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objContact = objData.CONTACT

   'The User1 fields drop down list should not be linked to another

   'list and copy the current list.

   objContact.fields.UnLinkLists(CF_User1, True)

   Set objContact = Nothing

   objData.close

End If

 

Set objData = Nothing

Group object properties and methods

The Group object contains group and member information for the active Database object. The following properties and methods apply only to the Group object. See “Common properties and methods” in this section for additional properties and methods that apply to the Group object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

ContactCount

None

 

Long Integer

Read Only

Members

None

 

Object/LPDISPATCH

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

AddContact

szUniqueID

String

Void

AddSubGroup

None

 

Void

AssignParent

szUniqueID

String

Boolean

ChangeToParentGroup

None

 

Boolean

ChangeToSubGroup

szUniqueID

String

Boolean

ClearContactScope

None

 

Void

GetParent

None

 

String

GetSubGroup

iIndex

Short Integer

String

GetSubGroupCount

None

 

Long Integer

GetSubGroupList

None

 

Object/LPDISPATCH

GroupType

None

 

Short Integer

RemoveContact

szUniqueID

String

Void

SetContactScope

szUniqueID

String

Void

AddContact Method

Description    Adds a member to the current group. This method adds the specified contact to the current group if the current record is valid.

Object            Group

Syntax            object.AddContact szUniqueID

Parameters    szUniqueID            A string that specifies the Unique ID of the contact record to add to the current group.

Return type   Void

See also         ContactCount, RemoveContact

AddSubGroup Method (requires ACT! 2000 or later)

Description    Creates a subgroup for the current group and leaves the group in add mode. This method works like the Add method, but can be used only for adding subgroups.

Object            Group

Syntax            object.AddSubGroup

Return type   Void

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         AssignParent, ChangeToParentGroup, ChangeToSubGroup, GetParent, GetSubGroup, GetSubGroupCount, GetSubGroupList, GroupType
Data, Update in common properties in methods

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

'VB Open the database

objData.Open dbName

 If objData.IsOpen Then

   'Create the Group object

   Set objGroup = objData.GROUP

   'Move to the first group in the table

   objGroup.MoveFirst

   'Create a new subgroup for the first group

   guid = objGroup.AddSubGroup
 

   'Set field data

   objGroup.Data GF_Name, "My Subgroup"
 

   'Update the contents of the record

   objGroup.Update
 

   objData.close

End If

'Clear the object

Set objData = Nothing

* VF Open the database

objData.Open('dbName')

 If objData.IsOpen Then

   'Create the Group object

   Set objGroup = objData.GROUP

   'Move to the first group in the table

   objGroup.MoveFirst

   'Create a new subgroup for the first group

   guid = objGroup.AddSubGroup
 

   'Set field data

   objGroup.Data GF_Name, "My Subgroup"
 

   'Update the contents of the record

   objGroup.Update
 

   objData.close

End If

'Clear the object

Set objData = Nothing

 

 

AssignParent Method (requires ACT! 2000 or later)

Description    Sets the parent group of the current subgroup or sets the parent of a parent group that has no subgroups. The group must be in edit or add mode. Returns True if the parent is successfully set or False if unsuccessful.

Object            Group

Syntax            object.AssignParent szUniqueID

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

Return type   Boolean

See also         AddSubGroup, ChangeToParentGroup, ChangeToSubGroup, GetParent, GetSubGroup, GetSubGroupCount, GetSubGroupList, GroupType

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

'Open the database

objDatabase .Open dbName

 

If objDatabase .IsOpen Then

   'Create the Group object

   Set objGroup = objDatabase.GROUP

   'Go to the subgroup to which to assign a parent

   objGroup.GoTo subGroupId

   'Edit the record

   objGroup.Edit

   'Assign the parent for that subgroup

   objGroup.AssignParent groupUniqueID

   objGroup.Update

   Set objGroup = Nothing

   objDatabase.close

End If

 

'Clear the object

Set objDatabase = Nothing

ChangeToParentGroup Method (requires ACT! 2000 or later)

Description    Changes the current subgroup to a parent group. The group must be in edit or add mode. Returns True if the subgroup is successfully changed to a parent group or False if unsuccessful.

Object            Group

Syntax            object.ChangeToParentGroup

Return type   Boolean

See also         AddSubGroup, AssignParent, ChangeToSubGroup, GetParent, GetSubGroup, GetSubGroupCount, GetSubGroupList, GroupType

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

'Open the database

objDatabase .Open dbName

 

If objDatabase .IsOpen Then

   'Create the group object

   Set objGroup = objDatabase.GROUP

   'Go to the subgroup to change to a parent group

   objGroup.GoTo subGroupId

   objGroup.Edit

   'Change the subgroup to a parent group

   objGroup.ChangeToParentGroup

   objGroup.Update

   Set objGroup = Nothing

   objDatabase.close

End If

 

'Clear the object

Set objDatabase = Nothing

ChangeToSubGroup Method (requires ACT! 2000 or later)

Description    Changes the current group to a subgroup of the parent group specified by the szUniqueID parameter. The group must be in edit or add mode. Returns True if the group is successfully changed to a subgroup or False if unsuccessful.

Object            Group

Syntax            object.ChangeToSubGroup szUniqueID

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

Return type   Boolean

See also         AddSubGroup, AssignParent, ChangeToParentGroup, GetParent, GetSubGroup, GetSubGroupCount, GetSubGroupList, GroupType

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

'Open the database

objDatabase .Open dbName

 

If objDatabase .IsOpen Then

   'Create the group object

   Set objGroup = objDatabase.GROUP

   'Go to the subgroup to change to a subgroup

   objGroup.GoTo subGroupId

   'Get the Unique ID parent for that subgroup

   objGroup.Edit

   objGroup.ChangeToSubGroup sParentId

   objGroup.Update

   Set objGroup = Nothing

   objDatabase.close

End If

 

'Clear the object

Set objDatabase = Nothing

ClearContactScope Method (requires ACT! 3.0.7 or later)

Description    Clears any existing contact scoping. Resets the current record position to the first record and rebuilds the list of Group records without applying contact scoping.

Object            Group

Syntax            object.ClearContactScope

Return type   Void

See also         SetContactScope

ContactCount Property

Description    Returns the number of contact members for the current group. This property returns the same count as members.RecordCount.

Object            Group

Syntax            object.ContactCount

Value type      Long Integer, Read Only

See also         RecordCount in Members object

GetParent Method (requires ACT! 2000 or later)

Description    Returns a string that specifies the Unique ID of the parent group of the current subgroup.

Object            Group

Syntax            object.GetParent

Return type   String

See also         AddSubGroup, AssignParent, ChangeToParentGroup, ChangeToSubGroup, GetSubGroup, GetSubGroupCount, GetSubGroupList, GroupType

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

'Open the database

objDatabase .Open dbName

 

If objDatabase .IsOpen Then

   'Create the group object

   Set objGroup = objDatabase.GROUP

   'Go to the subgroup to assign to a parent group

   objGroup.GoTo subGroupId

   'Get the Unique ID of the parent for that subgroup

   ParentId = objGroup.GetParent

   'Get the name of the parent group

   objGroup.GoTo ParentId

   List1.AddItem "Parent is " & objGroup.Data(GF_Name)

   Set objGroup = Nothing

   objDatabase.close

End If

 

'Clear the object

Set objDatabase = Nothing

GetSubGroup Method (requires ACT! 2000 or later)

Description    Returns the Unique ID of the specified subgroup of the current group record.

Object            Group

Syntax            object.GetSubGroup iIndex

Parameters    iIndex                    A short integer that specifies the index number of the subgroup. Specify a value between 1 and the value returned by GetSubGroupCount.

Return type   String

See also         AddSubGroup, AssignParent, ChangeToParentGroup, ChangeToSubGroup, GetParent, GetSubGroupCount, GetSubGroupList, GroupType

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

 

'Open the database

objData.Open dbName

 

If objData.group.GetSubGroupCount > 0 Then

   'Create the group object

   Set objGroup = objData.GROUP

   'Get the Unique IDs of all subgroups for the group

   For i = 1 To objGroup.GetSubGroupCount

       suid = objGroup.GetSubGroup(i)

       List1.AddItem suid

   Next i

End If

 

List1.AddItem "Closing Database"

objData.close

 

Set objData = Nothing

GetSubGroupCount Method (requires ACT! 2000 or later)

Description    Returns the number of subgroups for the current parent group.

Object            Group

Syntax            object.GetSubGroupCount

Return type   Long Integer

See also         AddSubGroup, AssignParent, ChangeToParentGroup, ChangeToSubGroup, GetParent, GetSubGroup, GetSubGroupList, GroupType

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   'Create the group object

   Set objGroup = objDatabase.GROUP

   objGroup.MoveFirst

 

   'Go through all the groups

   For i = 1 To objGroup.recordCount

       If objGroup.GroupType = 0 Then        'If Parent

          List1.AddItem objGroup.Data(GF_Name) & " is a group"

          'Get the Secondary Group count

          sgrpcount = objGroup.GetSubGroupCount

          List1.AddItem objGroup.Data(GF_Name) & " has " &

              sgroupCount & " subgroups ."

       Else      'SubGroup

          List1.AddItem objGroup.Data(GF_Name) & " is a sub-group"

       End If

       objGroup.MoveNext

   Next i

   objData.close

End If

 

Set objData = Nothing

GetSubGroupList Method (requires ACT! 2000 or later)

Description    Returns a dispatch pointer to an object containing the subgroup records for the current group. Returns NULL on error.

Object            Group

Syntax            object.GetSubGroupList

Return type   Object/LPDISPATCH

See also         AddSubGroup, AssignParent, ChangeToParentGroup, ChangeToSubGroup, GetParent, GetSubGroup, GetSubGroupCount, GroupType

Example         'The following code goes through all the groups. If a group is a parent and

'the number of subgroups > 0, then create the subgroup list and enumerate

'the subgroups.

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

If objDatabase.IsOpen Then

   'Create the Group object

   Set objGroup = base.group

   objGroup.MoveFirst

   For i = 1 To objGroup.recordCount

       'If the group is a parent

       If objGroup.GroupType = 0 Then

          'If the number of subgroups is > 0

          If objGroup.GetSubGroupCount > 0 Then

              'Create another object that contains the subgroups for that

              'particular group.

              Set objSGroup = objGroup.GetSubGroupList

              'Enumerate the subgroups

              objSGroup.MoveFirst

          For j = 1 To objSGroup.recordCount

             List1.AddItem objSGroup.Data(GF_Name)

              objSGroup.MoveNext

          Next j

              Set objSGroup = nothing

          End If

       End If

End If

GroupType Method (requires ACT! 2000 or later)

Description    Determines the group type of the current group. Returns 0 if the current group is a parent group or 1 if it is a subgroup.

Object            Group

Syntax            object.GroupType

Return type   Short Integer

See also         AddSubGroup, AssignParent, ChangeToParentGroup, ChangeToSubGroup, GetParent, GetSubGroup, GetSubGroupCount, GetSubGroupList

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   'Create the group object

   Set objGroup = objDatabase.GROUP

   objGroup.MoveFirst

   'Go through all the groups

   For i = 1 To objGroup.recordCount

       If objGroup.GroupType = 0 Then        'If a parent

          List1.AddItem objGroup.Data(GF_Name) & " is a group"

          'Get the secondary group count

          sgrpcount = objGroup.GetSubGroupCount

          List1.AddItem objGroup.Data(GF_Name) & " has " &

              sgroupCount & " subgroups ."

       Else        'Subgroup

          List1.AddItem objGroup.Data(GF_Name) & " is a sub-group"

       End If

       objGroup.MoveNext

   Next i

   objData.close

End If

 

Set objData = Nothing

Members Property

Description    Returns a Members object for the specified group.

Object            Group

Syntax            object.Members

Value type      Object/LPDISPATCH, Read Only

RemoveContact Method

Description    Removes the specified contact from being a member of the current group. This method does not delete the contact record from the database; it only removes the relationship between the contact and the group.

Object            Group

Syntax            object.RemoveContact szUniqueID

Parameters    szUniqueID            A string that specifies the Unique ID of the contact record to remove from the current group.

Return type   Void

See also         AddContact,
Error, LastError in common properties and methods

SetContactScope Method (requires ACT! 3.0.7 or later)

Description    Narrows the current set of Group records to the Group records for the contact record with the specified Unique ID. You can apply this scoping method along with other scoping methods and filters.

Object            Group

Syntax            object.SetContactScope szUniqueID

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

Return type   Void

See also         ClearContactScope

Example         'List all the groups a contact belongs to.

Dim objDatabase As Object

Dim objGroup As Object

Dim strContactID As String
 

'Clear the listbox

lstDisplay.Clear
 

'Create the object

lstDisplay.AddItem "Creating Database Object"

Set objDatabase = CreateObject("ACTOLE.DATABASE")
 

'Open the database

lstDisplay.AddItem "Opening Database"

objDatabase.Open dbName
 

'Assign the correct table object

Set objGroup = objDatabase.GROUP
 

If objDatabase.IsOpen Then

   objGroup.SetContactScope strContactID

   lstDisplay.AddItem objGroup.recordCount & " found for the Contact"

   Set objGroup = Nothing

   objDatabase.Close

   lstDisplay.AddItem "Database Closed"

End If
 

Set objDatabase = Nothing

ListTable object methods

The ListTable object, which requires ACT! 2000 or later, contains product, product type, and main competitor data for use by the Sales object. The following methods apply only to the ListTable object. See “Common properties and methods” in this section for additional properties and methods that apply to the ListTable object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

ClearScope

None

 

Void

GetScope

None

 

Short Integer

SetScope

iScopeType

Short Integer

Void

ClearScope Method (requires ACT! 2000 or later)

Description    Clears the current scope set on the table, resets the current record position to the first record, and rebuilds the list of ListTable records without any scoping.

Object            ListTable

Syntax            object.GetScope

Return type   Void

See also         GetScope, SetScope

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objList = objDatabase.ListTable

   'Get the current scoping on the List table.

   'If it is not 0 (no scoping), then clear the current scope.

   If objList.GetScope <> 0 then

       objList.ClearScope

   End if

Set objList = Nothing

End if

 

Set objDatabase = Nothing

GetScope Method (requires ACT! 2000 or later)

Description    Returns a short integer specifying the current scope type set on the table, such as Product, Product Type, or Competitor.

Object            ListTable

Syntax            object.GetScope

Return type   Short Integer

Comments     The following values are returned by this method:

Value

Scope type

 

Value

Scope type

0

No Type

 

2

Product Type

1

Product

 

3

Competitor

See also         ClearScope, SetScope

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

 

objDatabase.Open dbName

If objDatabase.IsOpen Then

   Set objList = objDatabase.ListTable

   'Get the current scoping on the List table.

   'If it is not 0 (no scoping), then clear the current scope.

   If objList.GetScope <> 0 then

       objList.ClearScope

   End if

Set objList = Nothing

End if

 

Set objDatabase = Nothing

SetScope Method (requires ACT! 2000 or later)

Description    Sets the scope to only read a specific type of sales data, such as Product, Type, or Competitor.

Object            ListTable

Syntax            object.SetScope (iScopeType)

Parameters    iScopeType      A short integer specifying the type of sales data to read.

Following is a list of values for this parameter:

Value

Scope type

 

Value

Scope type

0

No Type

 

2

Product Type

1

Product

 

3

Competitor

Return type   Void

See also         ClearScope, GetScope

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objList = objDatabase.ListTable

   'Set the scope to product.

   objList.SetScope 1

   List1.AddItem  "Products in ListTable are"

   For lcounter = 1 To objList.recordCount

       List1.AddItem objList.Data (LTF_Name)

       objList.MoveNext

   Next lcounter

End if

 

Set objList = Nothing

Set objDatabase = Nothing

Members object properties

The Members object is automatically generated each time you access a group record. This object is a list of all contacts that belong to the current group. The Members object is only valid if the number of contacts for that group exceeds 0. The members object is no longer valid after a call to any group method that affects the record position in a group list. For example, you should call Group.MoveNext then call Group.Members.

The following properties apply only to the Members object. See “Common properties and methods” in this section for additional properties and methods that apply to the Members object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

Name

None

 

String

Read Only

UniqueId

None

 

String

Read Only

The following sample code demonstrates how to use the Members object:

'Create the object

Set objData = CreateObject("ACTOLE.DATABASE")

 

'Open the database

objData.Open dbName

 

'Assign the correct table object

Dim tableObject As Object

Set tableObject = objData.CONTACT

 

If objData.IsOpen Then

   objData.Group.MoveFirst() 'move to the first group record.

 

   'The contact count

   If objData.Group.ContactCount > 0 Then

 

       'Define an object variable to access the members object

       dim members As Object

       Set members = objData.Group.Members

 

       'Enumerate all contacts

       For Index = 1 To objData.Group.ContactCount

          Dim uniqueID As String

          uniqueID = members.uniqueID

 

          'Seek to actual members Contact record and display information

          objData.CONTACT.GoTo (uniqueID)

 

          For lCounter = 1 To (tableObject.FieldCount)

              length = Len(tableObject.Data

                 ( tableObject.FIELDS.fieldIDAt(1Counter)))

              If (length > 0) Then

                 MsgBox tableObject.Data

                     (tableObject.FIELDS.fieldIDAt(lCounter))

              End If

          Next

       Next Index

   End If

End If

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

Name Property

Description    Returns the contact name of the group member.

Object            Members

Syntax            object.Name

Value type      String, Read Only

UniqueId Property

Description    Returns the contact Unique ID of the group member.

Object            Members

Syntax            object.UniqueId

Value type      String, Read Only

NoteHistory object methods

The NoteHistory object contains notes and historical information for the active Database object. The following methods apply only to the NoteHistory object. See “Common properties and methods” in this section for additional properties and methods that apply to the NoteHistory object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

ClearAttachmentFilter

None

 

Void

ClearContactScope

None

 

Void

ClearGroupScope

None

 

Void

ClearHistoryFilter

None

 

Void

ClearNoteFilter

None

 

Void

SetAttachmentFilter

None

 

Void

SetContactScope

szUniqueID

String

Void

SetGroupScope

szUniqueID

String

Void

SetHistoryFilter

None

 

Void

SetNoteFilter

None

 

Void

History types

When writing to the type field of the NoteHistory object, you can use one of the following ID types to generate a history item.

ID type

Field name

Regarding text

0

HT_CallAttempt

Call Attempted

1

HT_CallComplete

Call Completed

2

HT_CallReceived

Call Received

3

HT_FieldChanged

Field Changed

5

HT_LetterSent

Letter Sent

6

HT_MeetingDone

Meeting Held

7

HT_MeetingNotDone

Meeting Not Held

8

HT_ToDoDone

To-do Done

9

HT_ToDoNotDone

To-do Not Done

10

HT_Timer

Timer

11

HT_CallErased

Call Erased

12

HT_DeletedContact

Contact Deleted

13

HT_UpdateContact

Update Contact

14

HT_UpdateConAct

Update Activity

15

HT_UpdateDelAct

Delete Activity

16

HT_MsgMailSent

E-mail Sent

17

HT_CallLeftMessage

Call Left Message

50

HT_FaxSent

Fax Sent

51

HT_SyncSent

Sent Sync

52

HT_SyncReceived

Received Sync

53

HT_ReplaceFieldsLog

Replace Fields Log

54

HT_TODOErased

To-do Erased

55

HT_MeetingErased

Meeting Erased

56

HT_Error

Error

57

HT_SaleWon

Closed/Won Sale

58

HT_SaleLost

Lost Sale

100

HT_Note

Note

101

HT_Attachment

Attachment

102

HT_Email

E-mail

ClearAttachmentFilter Method

Description    Clears an existing attachment filter and rebuilds a list of Notes/History records that include any Attachment type records.

Object            NoteHistory

Syntax            object.ClearAttachmentFilter

Return type   Void

See also         SetAttachmentFilter

ClearContactScope Method

Description    Clears any existing contact scoping. Resets the current record position to the first record and rebuilds the list of Notes/History records without applying contact scoping.

Object            NoteHistory

Syntax            object.ClearContactScope

Return type   Void

See also         SetContactScope

ClearGroupScope Method

Description    Clears any existing group scoping. Resets the current record position to the first record and rebuilds a list of Notes/History records without applying group scoping.

Object            NoteHistory

Syntax            object.ClearGroupScope

Return type   Void

See also         SetGroupScope

ClearHistoryFilter Method

Description    Clears an existing history filter. Clears an existing history filter and rebuilds a list of Notes/History records that include History type records.

Object            NoteHistory

Syntax            object.ClearHistoryFilter

Return type   Void

See also         SetHistoryFilter

ClearNoteFilter Method

Description    Clears an existing note filter and rebuilds a list of Notes/History records that include Note type records.

Object            NoteHistory

Syntax            object.ClearNoteFilter

Return type   Void

See also         SetNoteFilter

SetAttachmentFilter Method

Description    Narrows the current set of Notes/History records by filtering out Attachment type Notes/History records. You can apply this scoping method along with other scoping methods and filters.

Object            NoteHistory

Syntax            object.SetAttachmentFilter

Return type   Void

See also         ClearAttachmentFilter

SetContactScope Method

Description    Narrows the current set of Notes/History records to the Notes/History records for the contact record with the specified Unique ID. You can apply this scoping method along with other scoping methods and filters.

Object            NoteHistory

Syntax            object.SetContactScope szUniqueID

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

Return type   Void

See also         ClearContactScope

Example         dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 

'Get a contact record Unique ID

dim uniqueID as string

objData.CONTACT.MoveFirst

uniqueID = objData.CONTACT.DATA(CF_UniqueID)

 

'Apply contact scoping to current list of Notes and Histories

objData.NOTEHISTORY.MoveFirst

objData.NOTEHISTORY.SetContactScope(uniqueID)

 

objData.Close

set objData = Nothing

SetGroupScope Method

Description    Narrows the current set of Notes/History records to the Notes/History records for the group with the specified Group record Unique ID. You can apply this scoping method along with other scoping methods and filters.

Object            NoteHistory

Syntax            object.SetGroupScope szUniqueID

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

Return type   Void

See also         ClearGroupScope

SetHistoryFilter Method

Description    Narrows the current set of Notes/History records by filtering out History type Notes/History records. You can apply this scoping method along with other scoping methods and filters.

Object            NoteHistory

Syntax            object.SetHistoryFilter

Return type   Void

See also         ClearHistoryFilter

SetNoteFilter Method

Description    Narrows the current set of Notes/History records by filtering out Note type Notes/History records. You can apply this scoping method along with other scoping methods and filters.

Object            NoteHistory

Syntax            object.SetNoteFilter

Return type   Void

See also         ClearNoteFilter

PopupInfo object properties and methods

The PopupInfo object contains the popup information for a field. The following properties and methods apply only to the PopupInfo object. See “Common properties and methods” in this section for additional properties that apply to the PopupInfo object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type(s)

Access

PopupCount

None

 

Short Integer

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

Add

szValue [, szRemark]

String, String

Void

Clear

None

 

Void

Remark

iIndex

Short Integer

String

Remove

iIndex

Short Integer

Void

Value

iIndex

Short Integer

String

Add Method

Description    Adds a popup item to a field that has the popup type turned on. If a field does not have the Allow Editing option for the drop-down list selected, it is not possible to add a drop-down list item.

Caution: The database should be locked before using this method; otherwise, an error is returned.

Object            PopupInfo

Syntax            object.Add szValue [, szRemark]

Parameters    szValue                  A string that specifies the value of the popup item.

[, szRemark]           A string that specifies the popup item’s remark, which is the text listed to provide information about the value. For example, the value of CA has the remark text of California. Omit optional parameter to get the remark for the popup item.

Return type   Void

Clear Method

Description    Clears all the items in a drop-down list, resulting in an empty list.

Caution: The database should be locked before using this method; otherwise, an error is returned.

Object            PopupInfo

Syntax            object.Clear

Return type   Void

PopupCount Property

Description    Returns the number of popup items in a PopupInfo object.

Object            PopupInfo

Syntax            object.PopupCount

Value type      Short Integer, Read Only

Example         'This example demonstrates how to retrieve popup information.

 dim objData as object

Set objData = CreateObject("ACTOLE.DATABASE")

objData.Open dbName

 Dim tableObject As Object

Set tableObject = objData.ACTIVITY

 

dim PopupInfo as object

set PopupInfo = tableObject.Fields.POPUPINFO(AF_REGARDING,0)

   'Must be a valid field value

 Dim I as Integer

nCount = PopupInfo.PopupCount

for I = 0 to (nCount - 1)

   list1.additem "Remark: " & PopupInfo.Remark(I)

   list1.additem "Value: " & PopupInfo.Value(I)

next I

 set PopupInfo = Nothing

objData.Close

set objData = Nothing

Remark Method

Description    Returns a string of text containing the remark for the drop-down list item with the specified index. The remark provides information about the popup item. For example, the value of CA has the remark text of California.

Object            PopupInfo

Syntax            object.Remark iIndex

Parameters    iIndex                    A short integer that specifies the index number for the drop-down list item, in the range from 0 to one less than the value of PopupCount.

Return type   String

Example         See PopupCount

Remove Method

Description    Removes the popup item with the specified index from a drop-down list.

Caution: The database should be locked before using this method; otherwise, an error is returned.

Object            PopupInfo

Syntax            object.Remove iIndex

Parameters    iIndex                    A short integer that specifies the index number for the popup item, in the range from 0 to one less than the value of PopupCount.

Return type   Void

Example         See PopupCount

Value Method

Description    Returns a string containing the drop-down list item value for the popup item with the specified index number. The value in a drop-down list item is the data that is placed into a field in ACT! when an item is chosen from the drop-down list. For example, the value of CA, which is place into a field, has the remark text of California.

Object            PopupInfo

Syntax            object.Value iIndex

Parameters    iIndex                    A short integer that specifies the index number for the popup item, in the range from 0 to PopupCount.

Return type   String

Relations object properties and methods

The Relations object contains relational information between table objects of the active Database object. The following properties and methods apply only to the Relations object. See “Common properties and methods” in this section for additional properties that apply to the Relations object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

Count

None

 

Short Integer

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

GetColumn1ID

iIndex

Short Integer

Short Integer

GetColumn2ID

iIndex

Short Integer

Short Integer

GetRelationTable

iIndex

Short Integer

Short Integer

GetRelationType

iIndex

Short Integer

Short Integer

GetTable1ID

iIndex

Short Integer

Short Integer

GetTable2ID

iIndex

Short Integer

Short Integer

UsesRelationTable

iIndex

Short Integer

Boolean

The following sample code demonstrates how to use the Relations object:

'The following code lists the different methods in the Relations object.

Dim objDatabase As Object

Dim lcounter As Long

 

'Clear the listbox

List1.Clear

 

'Create the object

List1.AddItem "Creating Database Object"

Set objDatabase = CreateObject("ACTOLE.DATABASE")

 

'Open the database

List1.AddItem "Opening Database"

objDatabase.Open dbName

List1.AddItem "Is Open: " & objDatabase.IsOpen

 

'Assign the correct table object

Dim objRelation As Object

Dim iRelCount As Integer

Dim i As Integer

 

'Check the version. If not 1 only then proceed

If objDatabase.MajorVersion <> 1 Then

   Set objRelation = objDatabase.Relations

   'Get the number of relations in the object

   iRelCount = objRelation.Count

   List1.AddItem "No Of relations: " & iRelCount

 

       If objDatabase.IsOpen Then

          For i = 0 To iRelCount - 1

              List1.AddItem objRelation.GetTable1ID(i) & ":" &

                 objRelation.GetColumn1ID(i) & ":" &

                 objRelation.GetTable2ID(i)   & ":" &

                 objRelation.GetColumn2ID(i)  & ":" &

                 objRelation.GetRelationType(i)  & ":" &

                 objRelation.UsesRelationTable(i)

          Next i

          List1.AddItem "Closing Database"

          Set objRelation = Nothing

          objDatabase.Close

          List1.AddItem "Database Closed"

       End If

 

Else

   MsgBox "Relations Object is not available in this version of ACTOLE."

       + Chr(10) + "Please update to version 3.0.6 or greater."

   objDatabase.Close

End If

 

'Clear the object

Set objDatabase = Nothing

List1.SetFocus

Count Property (requires ACT! 3.0.6 or later)

Description    Returns the number of relations in the Relations object.

Object            Relations

Syntax            object.Count

Value type      Short Integer, Read Only

GetColumn1ID Method (requires ACT! 3.0.6 or later)

Description    Returns a short integer that contains the value in Column1ID of the first table, for the item with the specified index number.

Object            Relations

Syntax            object.GetColumn1ID iIndex

Parameters    iIndex                    A short integer that specifies the index number of the item, in the range from 0 to 1 less than the value of Count.

Return type   Short Integer

GetColumn2ID Method (requires ACT! 3.0.6 or later)

Description    Returns a short integer for the value in Column1ID of the second table, for the item with the specified index number.

Object            Relations

Syntax            object.GetColumn2ID iIndex

Parameters    iIndex                    A short integer that specifies the index of the item, in the range from 0 to 1 less than the value of Count.

Return type   Short Integer

GetRelationType Method

Description    Returns a short integer that contains the relation type for the object table, for the item with the specified index number.

Object            Relations

Syntax            object.GetRelationType iIndex

Parameters    iIndex                    A short integer that specifies the index number of the item, in the range from 0 to 1 less than the value of Count.

Return type   Short Integer

Comments     The value returned by this property represents the following table relationships:

Value

Relationship

 

Value

Relationship

1

One_To_One

 

3

Many_To_One

2

One_To_Many

 

4

Many_To_Many

GetTable1ID Method (requires ACT! 3.0.6 or later)

Description    Returns a short integer that contains the value in Table1ID for the first table.

Object            Relations

Syntax            object.GetTable1ID iIndex

Parameters    iIndex                    A short integer that specifies the index number of the item, in the range from 0 to 1 less than the value of Count.

Return type   Short Integer

GetTable2ID Method (requires ACT! 3.0.6 or later)

Description    Returns a short integer for the value in Table1ID for the second table, for the item with the specified index number.

Object            Relations

Syntax            object.GetTable2ID iIndex

Parameters    iIndex                    A short integer that specifies the index number of the item, in the range from 0 to 1 less than the value of Count.

Return type   Short Integer

UsesRelationTable Method (requires ACT! 3.0.6 or later)

Description    Returns True if the relation uses the Relational table or False if it does not use the Relational table.

Object            Relations

Syntax            object.UsesRelationTable iIndex

Parameters    iIndex                    A short integer that specifies the index number of the item, in the range from 0 to 1 less than the value of Count.

Return type   Boolean

Comments     The Relational table has three fields: Reltype, ColumnID1, ColumnID2. Most of the many-to-many relations are stored as records in the Relational table. Relationships between Group table items and Activity table items, for example, are not stored in the Relation table. There are methods in the table objects to set the scope with respect to another table. These methods use the information in the Relation table to set the scope.

Sales object methods

The Sales object, which requires ACT! 2000 or later, contains data for sales process management for the active Database object. The following methods apply only to the Sales object,. See “Common properties and methods” in this section for additional properties and methods that apply to the Sales object.

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

AssociateWithContact

szUniqueID

String

Void

AssociateWithGroup

szUniqueID

String

Void

CompleteSale

iStatus,closeDate, szReason

Short Integer, Date, String

Void

ReopenSale

None

 

Void

AssociateWithContact Method (requires ACT! 2000 or later)

Description    Associates the current sales record with the specified contact.

Object            Sales

Syntax            object.AssociateWithContact (szUniqueID)

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

Return type   Void

See also         AssociateWithGroup, CompleteSale, ReopenSale

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objSales = objDatabase.SALES

   'New Sales record

   objSales.Add

   objSales.Data SLF_SaleStartDate, startDate

   objSales.Data SLF_SaleDate, closedate

   'These need to be IDs from the List table

   objSales.Data SLF_ProductId, sProductId

   'These need to be IDs from the List table

   objSales.Data SLF_TypeId, sTypeId

   objSales.Data SLF_Units, 100

   objSales.Data SLF_UnitPrice,2.25

   objSales.Data SLF_Amount, 225.00

   objSales.Data SLF_Probability, 65

   'These need to be IDs from the List table

   objSales.Data SLF_CompetitorId, CompetitorId

   objSales.Data SLF_SalesStage, " Confirmed order on phone,

       waiting for written order"

 

   'Update the contents of the record

   uniqueID = objSales.Update

   objSales.GoTo (uniqueID)

 

   If objSales.Error Then

       MsgBox objSales.LastError

   End If

 

'Make the association between a contact and an activity

objSales.AssociateWithContact sContactId

objSales.AssociateWithGroup sGroupId

Set objSales = Nothing

 

End If

Set objDatabase = Nothing

AssociateWithGroup Method (requires ACT! 2000 or later)

Description    Associates the current sales record with the specified group.

Object            Sales

Syntax            object.AssociateWithGroup (szUniqueID)

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

Return type   Void

See also         AssociateWithContact, CompleteSale, ReopenSale

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

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objSales = objDatabase.SALES

   'New Sales record

   objSales.Add

   objSales.Data SLF_SaleStartDate, startDate

   objSales.Data SLF_SaleDate, closedate

   'These need to be IDs from the List table

   objSales.Data SLF_ProductId, sProductId

   'These need to be IDs from the List table

   objSales.Data SLF_TypeId, sTypeId

   objSales.Data SLF_Units, 100

   objSales.Data SLF_UnitPrice,2.25

   objSales.Data SLF_Amount, 225.00

   objSales.Data SLF_Probability, 65

   'These need to be IDs from the List table

   objSales.Data SLF_CompetitorId, CompetitorId

   objSales.Data SLF_SalesStage, " Confirmed order on phone,

       waiting for written order"

 

   'Update the contents of the record

   uniqueID = objSales.Update

   objSales.GoTo (uniqueID)

 

   If objSales.Error Then

       MsgBox objSales.LastError

   End If

 

'Make the association between a contact and an activity

objSales.AssociateWithContact sContactId

objSales.AssociateWithGroup sGroupId

Set objSales = Nothing

 

End If

Set objDatabase = Nothing

CompleteSale Method (requires ACT! 2000 or later)

Description    Completes the current sale.

Object            Sales

Syntax            object.CompleteSale (iStatus, closeDate, szReason)

Parameters    iStatus                    A short integer that specifies the status of the sale.

Following is a list of values for this parameter:

Value

Status

 

Value

Status

0

Open

 

2

Lost

1

Won

 

 

 

 

closeDate               A Date value that specifies the date that the sale closed, formatted in Windows Regional Settings Short Date style.

szReason                A string with a maximum length of 65 characters that specifies why the sale was won or lost.

Return type   Void

See also         AssociateWithContact, AssociateWithGroup, ReopenSale

Example         'The following code goes to the required sales record, checks to
'make sure it is a Sales Opportunity, then completes it as a Won
'sale with today's date as the close date and "Liked the sample and
'price" as the reason.

 

Dim objDatabase As Object

Dim objSales As Object

Dim suid as string

 

'Create the Database object and open a database

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objSales = objDatabase.SALES

 

   objSales.goto suid   'Go to the Sales record you want to complete

   'If the status of the sale is a Sales Opportunity, then complete it

   If objSales.Data(SLF_Status) = "Sales Opportunity" Then

       'Complete it as a Closed/Won sale, with today's date as the

       'close date and the reason is "Liked the sample and price

       objSales.CompleteSale 1, Now, "Liked the Sample and price "

       'Check for errors

       If objSales.Error Then

          MsgBox objSales.LastError

       End If

   End If

 

'Close the objects

Set objSales = Nothing

objDatabase.close

 

End If

 

'Clear the object

Set objDatabase = Nothing

ReopenSale Method (requires ACT! 2000 or later)

Description    Reopens the current sale, setting the status to open.

Object            Sales

Syntax            object.ReopenSale

Return type   Void

See also         AssociateWithContact, AssociateWithGroup, CompleteSale

Example         'The following code goes to the required sales record, checks to
'make sure it is not a Sales Opportunity, then reopens it.

Dim objDatabase As Object

Dim objSales As Object

Dim suid as string

 

'Create the Database object and open a database

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

   Set objSales = objDatabase.SALES

   objSales.goto suid   'Go to the Sales record you want to reopen

   'If the status of the sale is not a Sales Opportunity, then reopen it

   If objSales.Data(SLF_Status) <> "Sales Opportunity" Then

       objSales.ReopenSale

       'Check for errors

       If objSales.Error Then

          MsgBox objSales.LastError

       End If

   End If

 

'Close the objects

Set objSales = Nothing

objDatabase.close

 

End If

 

'Clear the object

Set objDatabase = Nothing

Users object properties and methods

The Users object contains the user information for the active Database object. The following properties and methods apply only to the Users object. See “Common properties and methods” in this section for additional properties that apply to the Users object.

Properties

Property name

Parameter(s)

Parameter type(s)

Value type

Access

Access

iUser [= lType]

Short Integer, Long Integer

Long Integer

Read/Write

Count

None

 

Short Integer

Read Only

Exists

szName

String

Boolean

Read Only

Name

iUser

Short Integer

String

Read Only

Security

iUser [= lValue]

Short Integer, Long Integer

Long Integer

Read/Write

UniqueId

iUser

Short Integer

String

Read Only

Methods

Method name

Parameter(s)

Parameter type(s)

Return type

AddUser

szName, szPassword, iPrivilege

String, String,
Short Integer

Boolean

CheckIsPhonebook

None

 

Boolean

CurrentUserAccess

None

 

Long Integer

CurrentUserId

None

 

String

CurrentUserName

None

 

String

CurrentUserSecurity

None

 

Long Integer

GetPassword

iUser

Short Integer

String/BSTR

IsValidPassword

iUser, szPassword

Short Integer, String

Boolean

SetAsPhonebook

None

 

Boolean

SetPassword

iUser, szOldPassword, szNewPassword

Short Integer, String,
String

Void

Access Property

Description    Gets and sets the access type of the specified user for the open database.

Object            Users

Syntax            object.Access iUser [= lType]

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

[= lType]                A long integer that specifies the access type, in the range of 1 to 5. Omit this optional parameter to get the access type for the specified user.

Value type      Long Integer, Read/Write

Comments     This property returns or sets one of the following values for the access type of the specified user of the open database.

Value

Description

1

Logon access to the database is enabled for the selected user. Synchronization access is not enabled for the selected user.

2

Synchronization access to the database is enabled for the specified user. Logon access is not enabled for the selected user.

3

No access to the database is enabled for the selected user.

4

Direct synchronization access to the database has been set up for the selected user.

5

Logon access and synchronization access to the database is enabled for the selected user.

See also         Count

AddUser Method (requires ACT! 4.0 or later)

Description    Adds a new user with a specified security level to an ACT! database. The current user must have Administrator security level to add new users. Returns True if the operation is successful or False if unsuccessful.

Note: Before using this method, make sure the database is not open in the ACT! application or by another instance of OLE.

Object            Users

Syntax            object.AddUser szName, szPassword, iPrivilege

Parameters    szName                  A string that specifies the new user’s logon name.

szPassword            A string that specifies the initial password for the new user.

iPrivilege               A long integer that specifies the security level for the new user.

                              Following is a list of values for the iPrivilege parameter:

Value

Description

1

Browse (read-only permission). Can read the records in the database. Cannot add, modify, or delete records.

3

Standard (update, read/write permission on standard functions). Can read the records in the database and can add, delete, and modify records. Cannot add new users to the database, synchronize with another database or user, perform maintenance on the database, or modify the database fields.

5

Administrator (full update and read/write permission). Can perform any database function, including adding new users, synchronizing data, performing database maintenance, and modifying the database fields.

Return type   Boolean

See also         SetAsMyRecord in Contact object

Example         'Example of adding a user to an ACT! database.

 

Dim objDatabase As Object

Dim objContact As Object

Dim objUsers As Object

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open(C:\My Documents\ACT\Database\ACT5demo.dbf)

Set objUsers = objDatabase.Users

 

'Add user "Simon Lazarus" with password "password" and

'security level "1" for browse

if objUsers.AddUser("Simon Lazarus", "password", 1) = True

   then

   MsgBox("Simon Lazarus added successfully");

ElseIf

   MsgBox("Failed adding Simon Lazarus as a database user.");

EndIf

 

objDatabase.Close

Set objDatabase = Nothing

CheckIsPhonebook Method (requires ACT! 4.0 or later)

Description    Returns True if the ACT! database is specified in WinFax as an external phonebook or False if it is not specified as a WinFax phonebook.

Note: This method requires WinFax 8.02 or later. False is returned if WinFax 8.02 or later is not installed.

Object            Users

Syntax            object.CheckIsPhonebook

Return type   Boolean

See also         SetAsPhonebook

Example         'Check if the open database is being used as the WinFax phonebook

'If not, set it as the phonebook for WinFax

 

Dim objDatabase As Object

Dim i As Integer

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open dbName

 

If objDatabase.IsOpen Then

'If the database is not being used as a WinFax Phonebook,

'Set it to be used as one.

   If objDatabase.USERS.CheckIsPhonebook <> True Then

       i = objDatabase.USERS.SetAsPhonebook

          If i = True Then

              lstDisplay.AddItem "Setting successful"

          Else

              lstDisplay.AddItem "Setting unsuccessful"

          End If

       End If

   objDatabase.Close

End If

 

'Clear the object

Set objDatabase = Nothing

Count Property

Description    Returns the number of registered users for the database. This number includes only the users who have created a My Record contact record by previously logging on to the ACT! database. Any users who do not have logon access to the database are not included.

Object            Users

Syntax            object.Count

Value type      Short Integer, Read Only

CurrentUserAccess Method (requires ACT! 3.0.6 or later)

Description    Returns a long integer containing the access type of the current user of the open database.

Object            Users

Syntax            object.CurrentUserAccess

Return type   Long Integer

Comments     This method returns one of the following values:

Value

Description

1

Logon access to the database is enabled for the selected user. Synchronization access is not enabled for the selected user.

2

Synchronization access to the database is enabled for the specified user. Logon access is not enabled for the selected user.

4

Direct synchronization access to the database has been set up for the selected user.

5

Logon access and synchronization access to the database is enabled for the selected user.

See also         CurrentUserId, CurrentUserName, CurrentUserSecurity

CurrentUserId Method (requires ACT! 3.0.6 or later)

Description    Returns a string containing the Unique ID of the current user of the open database.

Object            Users

Syntax            object.CurrentUserId

Return type   String

See also         CurrentUserAccess, CurrentUserName, CurrentUserSecurity

CurrentUserName Method (requires ACT! 3.0.6 or later)

Description    Returns a string containing the user name of the current user of the open database.

Object            Users

Syntax            object.CurrentUserName

Return type   String

See also         CurrentUserAccess, CurrentUserId, CurrentUserSecurity

CurrentUserSecurity Method (requires ACT! 3.0.6 or later)

Description    Returns a long integer containing the security level of the current user of the open database.

Object            Users

Syntax            object.CurrentUserSecurity

Return type   Long Integer

Comments     This method returns one of the following values:

Value

Description

1

Browse (read-only permission). Can read the records in the database. Cannot add, modify, or delete records.

3

Standard (update, read/write permission on standard functions). Can read the records in the database and can add, delete, and modify records. Cannot add new users to the database, synchronize with another database or user, perform maintenance on the database, or modify the database fields.

5

Administrator (full update and read/write permission). Can perform any database function, including adding new users, synchronizing data, performing database maintenance, and modifying the database fields.

See also         CurrentUserAccess, CurrentUserId, CurrentUserName

Exists Property

Description    Returns True if the specified user exists in the database or False if the user is not in the database. This property verifies whether or not a contact record exists for the user. The user’s name is the logon name, not the Contact field value from the corresponding ACT! database record.

Object            Users

Syntax            object.Exists szName

Parameters    szName                  A string that specifies the user’s logon name.

Value type      Boolean, Read Only

GetPassword Method (requires ACT! 4.0 or later)

Description    Gets the password of specified user(s). The current user must have an Administrator security level to get user passwords. A password is returned as a string.

Object            Users

Syntax            object.GetPassword iUser

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

Return type   String/BSTR

See also         Count

Example         'Example of getting the passwords of users of an ACT! database.

 

Dim objDatabase As Object

Dim objContact As Object

Dim objUsers As Object

Dim uCount As Integer

 

Set objDatabase = CreateObject("ACTOLE.DATABASE")

objDatabase.Open(C:\My Documents\ACT\Database\ACT5demo.dbf)

Set objUsers = objDatabase.Users

 

'Get the count of users.

uCount = objUsers.Count

 

'Now display the name and password of all users for the database.

for iLoop = 1 to uCount

List1 .Additem "Password for user: " & objUsers.Name(iLoop) & " is: " &

   objUsers.GetPassword(iLoop)

next iLoop

 

objDatabase.Close

Set objDatabase = Nothing

IsValidPassword Method

Description    Returns True if the specified password is valid for the specified user or False if the password is invalid or the specified user does not have a password.

Object            Users

Syntax            object.IsValidPassword iUser, szPassword

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

szPassword            A string that specifies the user’s current password.

Return type   Boolean

See also         Count

Name Property

Description    Returns the user name of the specified user. The user’s name is the logon name, not the Contact field value from the corresponding ACT! database record.

Object            Users

Syntax            object.Name iUser

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

Value type      String, Read Only

See also         Count

Security Property

Description    Gets and sets the security level of the specified user.

Object            Users

Syntax            object.Security iUser [= lValue]

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

[= lValue]              A long integer that specifies the security level for the specified user. Omit this optional parameter to get the security level for the specified user.

Value type      Long Integer, Read/Write

Comments     This property gets or sets one of the following values:

Value

Description

1

Browse (read-only permission). Can read the records in the database. Cannot add, modify, or delete records.

3

Standard (update, read/write permission on standard functions). Can read the records in the database and can add, delete, and modify records. Cannot add new users to the database, synchronize with another database or user, perform maintenance on the database, or modify the database fields.

5

Administrator (full update and read/write permission). Can perform any database function, including adding new users, synchronizing data, performing database maintenance, and modifying the database fields.

See also         Count

SetAsPhonebook Method (requires ACT! 4.0 or later)

Description    Sets an ACT! database as an external phonebook for WinFax. Returns True if the operation is successful or False if unsuccessful.

Note: This method requires WinFax 8.02 or later. False is returned if WinFax 8.02 or later is not installed.

Object            Users

Syntax            object.SetAsPhonebook

Return type   Boolean

See also         CheckIsPhonebook

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

SetPassword Method

Description    Sets the password for the specified user. To change the user’s password, you must know the user’s current password.

Object            Users

Syntax            object.SetPassword iUser, szOldPassword, szNewPassword

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

szOldPassword      A string that specifies the user’s current password.

szNewPassword     A string that specifies the user’s new password.

Return type   Void

See also         Count, IsValidPassword

UniqueId Property

Description    Returns the Unique ID of the specified user’s contact record in the ACT! database.

Object            Users

Syntax            object.UniqueId iUser

Parameters    iUser                      A short integer that specifies the ordinal user number, in the range between 1 and Count.

Value type      String, Read Only

See also         Count



CHAPTER  3

OLE Database Object Error Codes

The following error codes apply only to the ACT! application. If an error occurs that is not caused by the OLE automation client’s code, please record the return value and the situation that caused it for use by technical support.

Value

Error code

Description

-2000

Status_Obsolete

for obsolete calls

-1999

Status_InvalidParam

invalid parameter

-1500

Status_SecurityLocked

the security is currently locked

-1499

Status_SecurityEditFailed

general error trying to edit security

-1000

Status_CantDeleteUser

cannot delete a user record

-750

Status_CantEdit

cannot edit

-500

Status_DataLocked

the record is locked

-499

Status_DataNotLocked

the record is not locked

-498

Status_DataEditNow

the record is being edited

-497

Status_DataUninitialized

the record has not been initialized

-496

Status_ListUninitialized

the table has not been initialized

-495

Status_DataDeleted

the record has been deleted

-494

Status_DataChanged

the record has changed

-493

Status_CantLockData

the record cannot be locked

-109

Status_ExceedLimit

limit has been exceeded

-108

Status_DBAccessDenied

database access is denied

-107

Status_CantEditData

the record cannot be edited

-106

Status_InvalidFieldType

invalid field type

-105

Status_InvalidSortField

invalid sort field

-104

Status_OutOfRange

the record/field is out of range

-103

Status_InvalidBufIndex

invalid buffer index

-102

Status_DataBeingEdited

the record is currently being edited

-101

Status_CantDeleteField

the field cannot be deleted

-100

Status_InvalidSchemaInfo

invalid schema information

-99

Status_InvalidFieldName

invalid field name

-98

Status_InvalidField

invalid field

-97

Status_CantEditAttr

the attribute cannot be edited

-96

Status_ExceedsMaxLength

maximum length exceeded

-95

Status_CantEditSchema

the schema information cannot be edited

-94

Status_DupeFieldName

duplicate field name

-93

Status_CantEditSecurity

the security information cannot be edited

-92

Status_InvalidId

invalid ID specified

-91

Status_DBSchemaCorrupt

the schema information is corrupted

-90

Status_DBDataCorrupt

the data file is corrupted

-89

Status_DBIndexCorrupt

the index file is corrupted

-88

Status_DBCreateFailed

create failed

-87

Status_DBOpenFailed

open failed

-86

Status_DBLockFailed

lock failed

-82

Status_IOFailed

read/write failed

-80

Status_CreateFailed

create failed

-79

Status_OpenFailed

open failed

-78

Status_DBInvalidVersion

invalid version to open database

-77

Status_Duplicate

duplication occurred

-76

Status_InvalidPrivilege

invalid permission

-75

Status_SharingViolation

sharing violation

-50

Status_InvalidFilename

filename invalid or not found

-10

Status_DBLocked

the database is locked

-9

Status_DBOpen

the database is already open

-8

Status_DBAlreadyOpen

the database is already open

-7

Status_DBNotOpen

the database is not open

-6

Status_FatalError

a fatal error occurred

-5

Status_OutofDiskSpace

insufficient disk space

-4

Status_Unimplemented

not implemented

-3

Status_OutofMemory

insufficient memory

-2

Status_Unsupported

feature not supported

-1

Status_GeneralError

a general error occurred

0

Status_Success

success

1

Status_Supported

supported

2

Status_NoMoreData

no more data available

3

Status_NoData

no data available

4

Status_NoCount

no count available

5

Status_PartialCount

partial count only available

6

Status_NoPosition

no position (BOF/EOF)

7

Status_PartialPosition

partial position

8

Status_Cancel

canceled

 

 

 


Trademark Notice