473,699 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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("A CTOLE.DATABASE" )
objDatabase.Ope n dbname

by changing the last line to : objDatabase.Ope n("path\databas e.dbf")
I've managed to open the database with no problem. I know this because
I used objDatabase.Las tError 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.CON TACT

tableObject.Mov eFirst

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

dim strOutput as String
strOutput = tableObject.Dat a(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
3 2111
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
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.Ope n(dbname)

Dim tableObject As ACTOLE.CONTACT = objDatabase.CON TACT

tableObject.Mov eFirst()

Dim strOutput as String = tableObject.Dat a(CF_Name)

etc. ....

<ga********@myw ay.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.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("A CTOLE.DATABASE" )
objDatabase.Ope n dbname

by changing the last line to : objDatabase.Ope n("path\databas e.dbf")
I've managed to open the database with no problem. I know this because
I used objDatabase.Las tError 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.CON TACT

tableObject.Mov eFirst

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

dim strOutput as String
strOutput = tableObject.Dat a(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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2582
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as I could not configure Apache myself. The REAL problem is that PHPmyAdmin works and sees my test database Wines.... But my PHP program does not!
1
1364
by: Mike | last post by:
Hello, I have a string that will contain a table like this: <tr><td>column1data</td><td>column2data</td></tr> I want to use javascript to extract the data for a given row and column. I'm guessing the easiest would be to find a tag-based parser. Anyone know of one? BTW I checked out the xml parsers in javascript and I am looking for something simpler or at least easier to use.
2
1872
by: lawrence | last post by:
We've developed a content management system that we donate to the public domain (via a Creative Commons declaration) at www.publicdomainsoftware.org. Our cms has an emphasis on weblogs, though we hope to add additional features eventualy. In the early days of the project, we had a graphic/web designer volunteering some time with us, but she has since gotten busy with other projects. We are desperate for someone to help us with the visual...
1
1066
by: JM | last post by:
Hi all, Further to my mail yesterday, haven't received much help and am getting slightly worried ! I am trying to add a block of cells but sadly can't get excel VBA to exactly read my intentions. I really wish cells H8 to H12 to be totalised but using the following statement the formula returns "Sum(H1:H12)
4
1317
by: melanieab | last post by:
Hi, Sorry this is a long message, but I'm getting desperate (and worried). I have a textbox (say, tb1) where the string is longer than the width of the box. If I'm coming from the previous textbox (tb0) (by tabbing or pressing enter or the down arrow), the text inside tb1 highlights and the cursor is at the end of the string (so that the beginning of the string isn't visible). If I type absolutely any key(s) other than Tab, Up, Down, or...
15
4606
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
169
9080
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide untaking to create a toolchain for it. Way back when, there used to be something called "Small C". I wonder if the creator(s) of that would want to embark on creating a nice little Small C++ compiler devoid of C++ language features that make...
19
1821
by: fx5900 | last post by:
Hi, i am trying to convert an .osm (openstreetmap) file into gml format and finally to shapefile given this wiki info http://wiki.openstreetmap.org/index.php/GML. I'm using windows and when i entered the following commands osm2gml.py < map_01_data.osm > map_01_data.gml on my dos prompt i get a number of errors, some of which are bellow: Traceback <most recent call last>:
0
8617
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8884
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.