Act! connection

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

I am only able to connect to an Act6.0 db with ODBC Connection (Foxpro DSN).
Is there a better way?
 
Hi,

According to msdn there is still no better way. So ODBC it has to be!

Good Luck
Arjen
 
I am only able to connect to an Act6.0 db with ODBC Connection (Foxpro DSN).
Is there a better way?

Yes - use the ACT! API. Well, in some ways that's better, anyway...
you're less likely to corrupt the database when you write to it, for
example.

You can use tlbimp to import from actole.tlb. It's not pretty, as it's
not very strongly typed, but it's just about usable. Of course, you
then can't use ADO.NET at all, but there we go...

I've done quite a bit of this (unfortunately) - let me know if you have
any further questions about it.
 
On Tue, 2 Mar 2004 21:52:32 -0500, "Earl" <brikshoe<at>comcast<.>net> wrote:

¤ I am only able to connect to an Act6.0 db with ODBC Connection (Foxpro DSN).
¤ Is there a better way?
¤

I believe you can connect using Jet OLEDB and the dBase ISAM driver as well. This would not require
a DSN.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Jon, I'm not writing to it, just populating a DataReader with customer
contact information which will be written back to SQLServer. For now at
least, I'll stick with the ODBC connection.

One curious thing I've noticed though is that if I try to read from the
Contact field, I get an unhandled Exception (I even tried renaming the field
ContactName, but no joy). Reading fields such as Company, City, etc. I have
no problems. I'm speculating this is a null issue with the Contact field?

Thanks for your help.
 
Jon, I'm not writing to it, just populating a DataReader with customer
contact information which will be written back to SQLServer. For now at
least, I'll stick with the ODBC connection.

One curious thing I've noticed though is that if I try to read from the
Contact field, I get an unhandled Exception (I even tried renaming the field
ContactName, but no joy). Reading fields such as Company, City, etc. I have
no problems. I'm speculating this is a null issue with the Contact field?

I'm afraid I really don't know - I haven't tried using an ODBC
connection. I believe you may also have difficulty reading email
addresses, as they're stored elsewhere in the database.

What exception are you getting though, when you try to read it, and how
are you trying to read it?
 
Well, I found the problem. Seems that Act doesn't store *some* of your field
names as you define them in Act. Specifically, even if you rename the
Contact field, it will always be stored as "Name" in the .dbf file. Looks
like they just map over your database names to the main .dbf table.
Otherwise, their schema is pretty simplistic, they basically name dBase
tables with funky extensions (.hdx, .mdx, and so forth), and you can find
the e-mail addresses in the .edb table. The relational structure isn't much
either, just a handful of tables, most foreign-keyed to the same field.
 
For .NET programming with ACT I
create two COM referrences. First referrence to the ACT.tlb and then
to the actevent.ocx. Next download the SDK. While the SDK is limited
you can usually get at the data that you need. An important decision
to make is whether your project is going to need to create the
Application Object or the Database Object. Here is the difference
when connecting.

The Application Object:


Shared ActElement As Object

Public Sub SetActElement()
Dim objApp As New Object
objApp = CreateObject("actole.appobject")

If objApp.IsDBOpen = False Then
MessageBox.Show("Failed to connect to ACT!. Open
ACT! and log on a database, then run the program again")
Application.Exit()
End If
ActElement = objApp
End Sub


The Database Object:

[code:1:42ead93459]

Shared ActElement As Object
Shared ActFields As DataSet

Public Sub SetActElement()
Dim objApp As New Object

Try

objApp =
CreateObject("actole.database")
objApp.OpenEx("")
If objApp.IsOpen = False Then
MessageBox.Show("Failed to connect to ACT!.
Open ACT! and log on a database, then run the program
again")
Application.Exit()
End If
ActElement = objApp

Catch ex As Exception

End Try
End Sub
[/code:1:42ead93459]

Good Luck,

bnye
 
Back
Top