Difference between VBA, Access/VBA and VB6

M

MacDermott

VBA is a general term for the programming language used in Microsoft Office.
While many commands are the same across Word, Excel, Access, and even
Outlook, each application also has a bunch of commands which are only
relevant to that application's tasks.

Access/VBA is the "flavor" of VBA used with Access.
Please note that just as a Word document can be built without using
Word/VBA, an Access database can be built without using Access/VBA. But if
you do want to program events in Access, Access/VBA is the language you'd
use.

VB6 is the latest version of Visual Basic, a programming language which
exists independently of the Office environment. It is extremely flexible,
but is not optimized for word processor, spreadsheet, or database
applications the way the various flavors of VBA are.
Many of its commands, however, use syntax similar to VBA. You can also
use Visual Basic to build forms similar to those in Access. (Don't fool
yourself, though - they're not as similar as they look.)

For completeness, I'd add VB.NET. This is the newest addition to the VB
family; it uses a syntax reminiscent of VB6, but is adapted to run on the
new .NET Framework, so as to be compatible with applications written in
other .NET languages.

HTH
- Turtle
 
D

david epsom dot com dot au

VBA is a MS product available to commercial developers
who want to include a programming language in their
applications. This product is/was used by the MS Office
developers: they wanted to include a programming language
in Office. VBA includes the same programming language as
VB6, but includes a different development environment.

Access is an Office product that has the VBA product
bound in, so that you can use the VBA development
environment.

VBA and VB6 include different development environments,
but they use the same compiler, runtime library, and
virtual machine.

VBA does not include any way to make forms or reports.
It does not include any way to load or store projects.
When it is used, it must be bound to another product,
like Excel,Access,Word, etc.

When you use Access/VBA, you get Access forms, windows,
and reports, and the VBA project is stored in a database.

When you use Word/VBA, you get Windows forms, and Word
documents, and the VBA project is stored in a document

When you use VB6, you get VB6 forms, and the VB6 projects
are stored in ordinary files. VB6 has it's own forms
and project files, and does not need to be bound to
any other product.

(david)
 
J

Jamie Collins

MacDermott said:
Access/VBA is the "flavor" of VBA used with Access.

No, there is no 'flavor' of MS Access VBA that is distinct from VBA in
other apps in the same Office suite because they all use a shared
component e.g. on my machine, all versions of from Office2000 onwards
use:

$\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL

Jamie.

--
 
J

Jamie Collins

MacDermott said:
VB6 is the latest version of Visual Basic
Many of its commands, however, use syntax similar to VBA.

Any similarities are probably due to the fact VB6.0 actually *does* use VBA!

Jamie.

--
 
M

MacDermott

Dear Jamie,

Are you trying to be helpful here, or nitpicking about the phrasing I used?

I was trying to provide something to show the OP that the things he was
inquiring about, while similar, can't be expected to behave exactly the
same.
For example, in VB6, the default property of a textbox is Text.
In Access/VBA, it's called Value, although it behaves like the Text
property in VB6.
To make things even more confusing, Access also supports a Text
property, which behaves slightly differently!

Access/VBA supports the DoCmd object, which is not present in either Word or
Excel's "flavors" of VBA.

Hope this helps make my meaning clearer.
- Turtle
 
D

Douglas J. Steele

I'll do some nitpicking here, Turtle.

In my opinion, none of the examples you give really have anything to do with
VB vs. VBA. Rather, they have to do with the various object models.

Objects have properties, methods and events. You use code to read/set
properties, invoke methods and react to events. In general, you can
instantiate an object and interact with it using any language (certainly,
AFAIK, you can use VC++ or Java if you prefer)

The Textbox objects in both VB and Access each have a variety of properties.
Yes, the default property is different in the two object models, but that
has nothing to do with VB vs. VBA.

Similarly, DoCmd is an object in Access. The fact that there's not an
equivalent object in the other object models again has nothing to do with VB
vs. VBA. From Excel or Word, you can use VBA to instantiate an instance of
an Access Application object, and invoke the various DoCmd methods.
 
M

MacDermott

Quite true, Doug!
Your analysis is deeper and more professional than the one I presented.
I'm just thinking in terms of someone who might post the original question,
whose concerns probably run along the lines of whether something written in
one will run in another. On that level, the distinction between objects and
the actual language blurs.

- Turtle
 
Top