JON SKEET! i need your help!

G

garyusenet

you have mentioned importing actole.tlb into .net in a previous post -
i'm trying to interface with an act 6 database - so thought i'd try to
import act.tlb using tlbimp - but i'm getting self registration failed.

Do you have any sample source on how to open a database in c#?

when i used actole in the .net app and tried to connect i'm getting
error -87 can't open database...

so i thought i should try act.tlb instead, but now im getting this
self-registration error.

Can you assist at all? i'm desperate to move on with this.

Thanks,

Gary.
 
W

Willy Denoyette [MVP]

| you have mentioned importing actole.tlb into .net in a previous post -
| i'm trying to interface with an act 6 database - so thought i'd try to
| import act.tlb using tlbimp - but i'm getting self registration failed.
|
| Do you have any sample source on how to open a database in c#?
|
| when i used actole in the .net app and tried to connect i'm getting
| error -87 can't open database...
|
| so i thought i should try act.tlb instead, but now im getting this
| self-registration error.
|
| Can you assist at all? i'm desperate to move on with this.
|
| Thanks,
|
| Gary.
|


What if you try to start from the beginning?
Just try to open the DB using a simple script, like this:

'File : Test.vbs
Dim o
Set o= CreateObject("actole.database")
o.Open "your full dbf path"

copy this to a file named test.vbs

...
and run it from the command line using cscript test.vbs.
If this works (if it doesn't throw an error) , it means that the whole ACT
stuff is correctly installed, only then you can move on by creating the
interop library from actole.tlb, or setting a reference to the actole.tlb in
your project.

Willy.
 
G

garyusenet

Willy thank you for your reply - I tried what you said but it doesn't
seem to be doing much.
It didn't throw an error just returned me to a flashing command prompt.

Then i moved the database completely so the path was wrong in the
script and it still didn't give me an error just returned me to the
command prompt again.

So i'm not sure how this moves me any closer to a solution =(
 
W

Willy Denoyette [MVP]

Well this means that the Open command isn't doing anything at all, else it
would throw when the path was wrong.
Try this instead:

'File : Test.vbs
Dim o
Set o= CreateObject("actole.database")
Cscript.Echo o.ActVersion

Willy.


| Willy thank you for your reply - I tried what you said but it doesn't
| seem to be doing much.
| It didn't throw an error just returned me to a flashing command prompt.
|
| Then i moved the database completely so the path was wrong in the
| script and it still didn't give me an error just returned me to the
| command prompt again.
|
| So i'm not sure how this moves me any closer to a solution =(
|
 
W

Willy Denoyette [MVP]

Or try this:

dim object o
dim object c
set o = CreateObject(...)
o.Open("....")
set c= o.CONTACT
o.lock
if o.IsLocked = false then
Cscript.Echo "Unable to lock DB"
end if
o.Close

Willy.


| Willy thank you for your reply - I tried what you said but it doesn't
| seem to be doing much.
| It didn't throw an error just returned me to a flashing command prompt.
|
| Then i moved the database completely so the path was wrong in the
| script and it still didn't give me an error just returned me to the
| command prompt again.
|
| So i'm not sure how this moves me any closer to a solution =(
|
 
J

Jon Skeet [C# MVP]

you have mentioned importing actole.tlb into .net in a previous post -
i'm trying to interface with an act 6 database - so thought i'd try to
import act.tlb using tlbimp - but i'm getting self registration failed.

Do you have any sample source on how to open a database in c#?

when i used actole in the .net app and tried to connect i'm getting
error -87 can't open database...

so i thought i should try act.tlb instead, but now im getting this
self-registration error.

Can you assist at all? i'm desperate to move on with this.

I'm afraid I haven't done anything on this for ages, and don't have any
sample code any more. Sorry about that...
 
G

garyusenet

Hi i tried your example Willy but the first one did do something this
time but it was a cscript error i think, it said:
c:\test.vbs(4,1) Microsoft VBscript runtime error: Object required:
'cscript'
 
G

garyusenet

Steve This is the code from the link you posted but it's in basic -
can somebody convert this to c# please?

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
 
W

Willy Denoyette [MVP]

| Hi i tried your example Willy but the first one did do something this
| time but it was a cscript error i think, it said:
| c:\test.vbs(4,1) Microsoft VBscript runtime error: Object required:
| 'cscript'
|

Sorry for the typo, use Wscript.Echo instead of CScript.Echo


Willy.
 
G

garyusenet

Hi willy when i ran that it reported back to me
6.0.3.979

what would you reccomend as a next step? Basically i just want to start
by writing a program in .net (c# pref) that will connect to my database
and tell me the first contacts name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top