×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

a4wvba.exe not ending after macro closes

a4wvba.exe not ending after macro closes

a4wvba.exe not ending after macro closes

(OP)
Hi, I'm looking for some help with a problem I'm having with a custom macro.  I'm running ACCPAC Corp. Edtn v 5.0 with Pervasive 2000i sp4, and I've written a custom macro that accesses the database tables using ADO.  The macro works fine, but the problem I am having is on the workstations and is that once I close the macro, the A4WVBA.exe process persists in the background, and when users go to log off the client, they get errors about programs not responding (the A4WVBA.exe program), and they have to manually end it.  This is a problem related to the ADO access, since if I remove this code it does not cause the problem.  Unfortunately, I need to use ADO as I am accessing custom tables also.  Has anyone ever run into this issue, and if so, do they have a fix.

Thanks

RE: a4wvba.exe not ending after macro closes

You could switch to the COMAPI, it is designed for use within Accpac. Otherwise, you may a left an ADO connection or recordset open. Or not properlt disposed of the objects.

If you know which code is causing the problems, then post it and we'll have a look.

Thanks and Good Luck!

zemp

RE: a4wvba.exe not ending after macro closes

(OP)
Hi Zemp,  thanks for the quick response....I think I have closed all the recordsets (recordset.close) and destroyed them (Set recordset = nothing), as well as closed an destroyed the ADO connection object, but I will go through the code to be sure.  As far as the code, the following is the code that declares and sets the connection object.  I am using a global variable called adoConn to represent the connection as I want to be able to use the connection throughout the macro.

As for using the COMAPI, unfortunately I don't believe that I can use this as I am accessing custom tables that I myself have created to store information ACCPAC does not track, so I think I am stuck with using ADO.

Anyway, here is the code snippet:

------------------------------------------------------
In the general declarations:
Global adoconn As ADODB.Connection

In the MainSub() sub:

Set adoconn = New ADODB.Connection
adoconn.Open "driver={Pervasive ODBC Client Interface};ServerName=myserver;DBQ=mydatabase", "ADMIN", ""

If adoconn.State <> adStateOpen Then
    MsgBox "Error connecting to SerumDepot Database."
Else
    MaintainContracts.Show
End If

adoconn.Close
Set adoconn = Nothing

---------------------------------------------------------

The really strange part is it works fine on the standalone installation on my laptop, but when I move it to the development environment, which is a Metaframe client connecting to an "ACCPAC" server, that is where it doesn't work.

Thanks for the help

RE: a4wvba.exe not ending after macro closes

(OP)
As another piece of information, if I open the macro using the VBA editor from ACCPAC and run the macro from there, the problem does not occur even on the dev. environment.  It seems as though it is limited to running the macro from the ACCPAC interface.

RE: a4wvba.exe not ending after macro closes

So you are not actually connection with Accpac but rather your own tables/database. However, from the sound of it your problem is macro or environment related and not Accpac related. I would check to see that the mdac (ADO) version is that same on all machines involved. Also check your code to see if your macro is actually ending or if is it just hidden and still sitting there (running in the background)?

Thanks and Good Luck!

zemp

RE: a4wvba.exe not ending after macro closes

(OP)
Thanks Zemp, I'll check on the mdac.  I am using the ACCPAC desktop to launch the macro I created using the ACCPAC macro/VBA utility, so it still may be ACCPAC related since it works fine when I run it from within the VBA.  As for the tables, I just created new ones in the same database as the ACCPAC tables.

A quick question....how do I write in code to actually end the macro?

Thanks

RE: a4wvba.exe not ending after macro closes

I hesitated, with that because I do all my Accpac codeing externally and don't use macros. I use a code line as follows,

   End

Yes, it's that simple. This is a VB key word that basically kills the App. It should be the last line of code executed. The same thing is used in Access VBA so I would think that it will work in an Accpac macro. Any way if it doesn't you will get an error.

Thanks and Good Luck!

zemp

RE: a4wvba.exe not ending after macro closes

(OP)
Well, thanks for all the help Zemp.  Looks like I might have found a solution that seems to work.  I had tried using the "End" keyword before and it didn't make any difference.  

What I have tried that seems to work is a different connection string.  I did some digging on the Pervasive site and found another way to declare the connection string, so I used the following syntax instead of my original:

adoconn.Open "Provider=PervasiveOLEDB;Data Source=path to DB"

When I execute the macro using this connection string, everything is working properly, so I guess that fixed it.  Not quite sure how to explain it though.

Thanks again for the help.

RE: a4wvba.exe not ending after macro closes

Yes, there is an issue with the pervasive OLEDB provider, forgot about it. I don't quite remeber what it was however, I would have to search the pervasive SQL forum for an answer.

Glad to hear you got it working.

Thanks and Good Luck!

zemp

RE: a4wvba.exe not ending after macro closes

(OP)
Hmmm...well for me, using the OLEDB Provider in the connect string worked whereas using the Pervasive ODBC Client Interface for the driver was causing all the problems.

Thanks

RE: a4wvba.exe not ending after macro closes

It's a different bug. The OLEDB provider has a bug that prevents @@IDENTITY from returning correctly. I should have looked it up before I opened my big mouth. See Thread318-513703.

Always good to hear about a new bug though.

Thanks and Good Luck!

zemp

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close