By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Small bit of code from VB6 to VB.net - desperate need of help

P: n/a
I have been trying to interface with my act database using .net and act
api's. I was originally using c# but it wouldn't connect to the
database. I tried VB in desperation and it is connecting!

Now i have hit another problem and i'm sure its down to the fact that
the code was written years ago, and needs a bit of modification for
..net can you take a look at these 12 lines of code and let me know how
to get it to work in .net please...

dim objDatabase as object
Set objDatabase = CreateObject("ACTOLE.DATABASE")
objDatabase.Open dbname

by changing the last line to : objDatabase.Open("path\database.dbf")
I've managed to open the database with no problem. I know this because
I used objDatabase.LastError and it returned an error code of 0 which
means success. And before in C# I was getting error code 87 which means
can't connect.
---
Now these next eight lines seem to be the problem, please have a look
and see if you can help me. The exame code continues as follows...

Dim tavleObject As Object
Set tableObject = objDatabase.CONTACT

tableObject.MoveFirst

(the above line generates the first error, and complains about a Null
reference exception being unhandled)

dim strOutput as String
strOutput = tableObject.Data(CF_Name)

the above line doesn't work in .net either and this is what is giving
me the problem I think...

I look forward to your comments

Gary

Mar 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
dim table i mean sorry about the poor typing, but i'm late for a
meeting, ill check again in an hour and hopefully there will be some
good input from you experts!

Mar 23 '06 #2

P: n/a
What happened to the Interop library you generated and why aren't you using
it?

Add it as a reference and you should be in business.

Dim objDatabase As New ACTOLE.DATABASE

objDatabase.Open(dbname)

Dim tableObject As ACTOLE.CONTACT = objDatabase.CONTACT

tableObject.MoveFirst()

Dim strOutput as String = tableObject.Data(CF_Name)

etc. ....

<ga********@myway.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I have been trying to interface with my act database using .net and act
api's. I was originally using c# but it wouldn't connect to the
database. I tried VB in desperation and it is connecting!

Now i have hit another problem and i'm sure its down to the fact that
the code was written years ago, and needs a bit of modification for
.net can you take a look at these 12 lines of code and let me know how
to get it to work in .net please...

dim objDatabase as object
Set objDatabase = CreateObject("ACTOLE.DATABASE")
objDatabase.Open dbname

by changing the last line to : objDatabase.Open("path\database.dbf")
I've managed to open the database with no problem. I know this because
I used objDatabase.LastError and it returned an error code of 0 which
means success. And before in C# I was getting error code 87 which means
can't connect.
---
Now these next eight lines seem to be the problem, please have a look
and see if you can help me. The exame code continues as follows...

Dim tavleObject As Object
Set tableObject = objDatabase.CONTACT

tableObject.MoveFirst

(the above line generates the first error, and complains about a Null
reference exception being unhandled)

dim strOutput as String
strOutput = tableObject.Data(CF_Name)

the above line doesn't work in .net either and this is what is giving
me the problem I think...

I look forward to your comments

Gary

Mar 23 '06 #3

P: n/a
Hi Stephany i'm a bit confused to tell you the truth.
So far i've added act.dll which is the file tlbimp created from act.tlb
(act.tlb is the original tlb provided with act) - and i've also added
actevent.ocx. I've done this by right clicking on reference in solution
explorer and choosing 'add reference'

The source code isn't working. any ideas?

Mar 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.