Link to ACT! customer database system

  • Thread starter Thread starter andrew blakeley
  • Start date Start date
A

andrew blakeley

Dear Integencia

I am trying to read an ACT! v6.0 database into excel but have not been able to open the database using the programme DLL provided. I must be missing something obvious - has anyone tried this or can see if something is missing ?

All help greatly appreciated, as usual.

Andrew


I am using the sample code supplied as follows:

Sub MacOpenSingleUser()
'This sample demonstrates how to properly log on a multiuser ACT! database
Dim objDatabase As Object
'Create the object
Set objDatabase = CreateObject("ACTOLE.DATABASE")
'Open the database
objDatabase.Open dbName
'Perform login validation
If objDatabase.IsMultiUser Then
'at this point you can display a dialog which asks for
'username and password. The dialog is something you create.
UserName = "****"
Password = "****"
objDatabase.ValidateUser UserName, Password
If objDatabase.Error Then
Login = False
Else
Login = True
End If
Else
Login = True
'Single-user database - validation not required
End If
If objDatabase.IsOpen = False Then
MsgBox "Failed opening the database"
Else
MsgBox "Currently open database is: " & objDatabase.GetDatabasePath
End If
Set objDatabase = Nothing
End Sub
 
Hi Andrew,

This is probably not the correct newsgroup to be posting questions for
using the ACT! API. But you are probably doing something with ACT!
and Excel...

Here is some VB6 code that I use to open and login to an ACT database.
Its basically two functions. Just call the "OpenDatabase" function
and this calls the login function. Make sure that you set a Project
Reference to the ACT type library and also have the File Location or
the database to open and the act username and password for the
database....

I hope this helps.

Steve

'************************************************

Public objDatabase As ActOle.Database
Public strDBName As String
Public strUserName As String
Public strPassWord As String
Dim bAlreadyLoggedIn As Boolean

Function OpenDatabase(ByVal strDBName As String) As Boolean

Dim RetVal As Boolean

'Create the ACT database object
Set objDatabase = CreateObject("ACTOLE.Database")
If Not objDatabase Is Nothing Then
'Open the database
objDatabase.Open strDBName
'Login
RetVal = Login(objDatabase)
If RetVal = False Then
MsgBox "Could not login to database " & strDBName & "!",
vbCritical
OpenDatabase = False
Set objDatabase = Nothing
Exit Function
End If
OpenDatabase = True
End If



End Function

Function Login(objDatabase As ActOle.Database) As Boolean

'perform proper login validation
If objDatabase.IsMultiUser Then

' we do this so we dont have to keep logging in
' every time
'If Not bAlreadyLoggedIn Then
'MsgBox "Not logged in"
'End If

objDatabase.ValidateUser strUserName, strPassWord

If objDatabase.Error Then
Login = False
Else
Login = True
bAlreadyLoggedIn = True
End If
Else
Login = True ' single-user database validation not required
End If

End Function
 
Still a few things that are a bit of a grey area here but I'll pursue it
further.

Many thanks

Andrew
 
I assume you're not doing this, but just in case...

Are you giving the database the username/password combo of
"*****"/"*****"? If so, that might be a problem. If not, what type of
error message does it give?
 
Back
Top