07-29-2008 08:58 AM
07-29-2008 12:06 PM
I have been attempting to integrate the ACT! database with a VB.NET application. I have discovered a simple way to iterate through table fields in ACT! and write the field names to the output window. Hopefully, the following will help you.
Private Sub WriteFields()
Dim cFields As ContactFieldDescriptor() = framework.Contacts.GetContactFieldDescriptors()Dim cField As ContactFieldDescriptor
Dim cList As ContactList
TrycList = framework.Contacts.GetContacts(Nothing)
Dim i As Integer
For i = 0 To cFields.Length - 1
cField = cFields.GetValue(i)
Console.WriteLine("TBL_CONTACT: ", cField.ColumnName)
Catch ex As Exception
The same code will work to get the field names from Company if you change Contact to Company. You will have to log in to the database through code as according to the ACT! SDK before you will be allowed to extract information.
Private framework As New ActFramework()
Private ActServer As String = "ACTServer" ' Name of the ACT! server
Private ActDatabase As String = "Act9Demo" ' Name of the instance of ACT! on the server without file extension
framework.LogOn(UserName, UserPassword, ActServer, ActDatabase)
The names of the tables are TBL_CONTACT, TBL_COMPANY, TBL_???
Hope this helps some.