Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA vs. VB6

Status
Not open for further replies.

m1kee

Programmer
Mar 2, 2003
45
0
0
GB
Are there any advantages using Visual Basic 6 to program against the Access Jet engine as apposed to using the VBA which comes with Access. Just trying to weigh up some pros and cons of which system to use, I have a developer edition of Access so I can create runtime versions using that, so that side of things is not a problem, it’s more to do with whether the functionality in VB6 is any better and if so in which main areas?

Many thanks,
Mikee.


Do or do not, there is no try. - Yoda
 
mikee,

They are essentially the same except for a few commands, and since you already have a book on one then the cost is minimal

zgtrman

To effectively improve in the efficiency of your performance, one must be proficient in the implementation of a positive mental attitude.
 
It depends on what you mean.

Access and VB are alternative ways of developing a front-end using a JET database. Access and VB are substantially different in functionality; practically every database function is easier in Access than in VB - you would expect it to be, wouldn't you. VBA is just one element in Access which makes database apps easy to build.

VBA is the programming language used in VB. There are hardly any difference between VBA in Access and VBA in VB (but there are some).

VB has a completely different set of controls to Access and so all UI design is different. The combo box in Access is different to the combo box in VB; this is true for every 'matching' control. VB has a much bigger set of controls than Access and is capable of doing all sorts of stuff that Access can't (or at least can't do easily). A VB application is generally much easier to distribute to a varied machine population than Access, unless you buy third-party installation tools to create the distribution package.







 
thanks, I've got books on both and the software for creating runtime versions of Access, I've read that VBA is not a true OOP language and also there are things like being able to change the colour of command buttons, which you can't do in Access.

There is also the bit that I will most likely be using other database engines in the future, so with the capabilities of VB then would be in my interest to look into this more?

Mikee.

Do or do not, there is no try. - Yoda
 
How are ya m1kee . . . . .

Pound for pound, you'll write more code in VB6 then in Access VB to perform the same function. For this reason I've all but abandoned it.

VB6 does have some functionality not included in Access, but in all my years, I've never had to use it. i considerit to be good, just heavier on coding.

Get a discrete Idea of the functionality of the both, and make your decision.

Flag0.gif
Remember Our Veterans! Remember Sept 11th!
 
VBA is not a trup OOP, that is true, but then neither is VB6, which is exactly what you'd expect, since VB6 is built on top of the same VBA engine.

As far as changing the colors of command buttons, the standard command button control does not provide that method/property in either Access or VB6. But then again, both can incorporate the Forms 2.0 CommandButton which does have that method/property.

Otherwise, I find most differences quite subtle. Other, not quite so subtle differences, are that VB6 does not support subforms, but it's easy in VB6 (with ADO) to call a stored query passing in parameters. Report definition is big difference.

Everyone has an opinion, and each and every one is worth looking at. To me, the biggest difference between a VB6 connected to an Access Database vs an Access application is that in VB6, I don't have that #@$%@@#$% Access application window in the way.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
1 difference I noted that is noteworthy for this discussion is the fact that you can not do arrays in VBA versus VB6. Now I know from first hand experience this can be kind of troublesome in Access if you have a set of controls that you want to do the same thing. In Access you have to code each control seperately, or create a function that passes each control to another function to do the same thing over and over again. That can get very cumbersome and monotonous having to do the same code 150 times over like I did. Even with the cut and paste method you would find yourself zoning out as you danced with the keyboard and mouse getting everthing into position.

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
I think you mean that you cannot do Control Arrays in VBA, which you can in VB6.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
You can, on the other hand, have an array of controls. Don't anyone think that that an array of controls is the same as a control array, because they are two completely different things.

To build an array of controls in Access VBA, you can do the following:
Code:
Dim fCtl_CntlArray(3)   As Control

Private Sub Form_Load()
 
   Set fCtl_CntlArray(0) = txtObjType
   Set fCtl_CntlArray(1) = txtObjName
   Set fCtl_CntlArray(2) = txtSearchString

End Sub

Private Sub cmdToggleEnable_Click()

   Dim Idx As Integer
   
   For Idx = 0 To 2
      fCtl_CntlArray(Idx).Enabled = Not fCtl_CntlArray(Idx).Enabled
   Next Idx
      
End Sub

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Yeah thats exactly what I meant, "control" must have been absent that day since I was not in control of anything that day.

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top