|
-
July 3rd, 2001, 09:00 AM
#1
Error running access report from VB6
I have been calling an Access 97 report from within VB 6 as a reporting tool. This works fine on my pc and most others.
However, a pc on which it worked fine has just upgraded to Office Pro 2000, and now when I click the report button to launch the Access report, I get the error Can't launch Access module, and is caused by the line in code:
Set mobjAccess = New Access.Application
where mobjAccess is dimensioned as an Object and the reference to MS Access 8.0 Object Library is included in the project.
I've checked the pc and it still has the MSACC8.OLB file installed, but also has an MSACC9.OLB file as well. I've tried re-registering the V8 object to no avail.
Any ideas?
Many thanks in advance.
dave Seddon
-
July 5th, 2001, 10:12 PM
#2
Re: Error running access report from VB6
Don't use Reference to MS Access Object Library
Use CreateObject function:
Dim mobjAccess as Object
Set mobjAccess = CreateObject("Access.Application")
Verefy this code.
Andy Tower
-
July 6th, 2001, 05:41 AM
#3
Re: Error running access report from VB6
You can specify a version using CreateObject, this way, you can force him to use the 97 version
set mocjAccess = CreateObject("Access.Application.8")
The .8 at the end specifies you want to use version 8 of Access, which is Access 97
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|