VB versus VBA

As Mile essentially said, most everything you learn in VB can be applied to Access VBA. This makes it valuable to know even if you don't care to stray from Access.

I agree with BukHix: VB.NET (roughly, you can think of VB.NET as the latest version of VB) is probably where you want to focus your energy since you will find, as time goes on, more and more support for it and less and less support for VB6 as MS phases out the old in deference to the new. Life's rough that way.

And yet here's a book on VB6 that is excellent. Especially good are the OOP chapters. Throughout you'll find cogent code samples and explanations. It's not a title for beginners --- but keep it mind if you move forward with VB.

The same author, by the way, has a book out on VB.NET -- haven't seen it though...

Regards,
Tim
 
I bought Sams Teach Yourself Visual Basic .Net 2003 on clearance at Barnes & Nobles for $7.95 and it came with a 60 Trial demo of Visual Studio 7 (.Net)
 
Can you do all the things that MS Access does by simply using VB only
- Yes and more as BulkHix said. EXCEPT that Access saves you a trememdous amount of work with it's bound forms and reports. You really can't appreciate what Access does for you behind the scenes until you try to create a bound form that updates a table.

I think that understanding what a compiler does for you is good for the soul. Keep in mind that an interpreter has to do essentially the same thing as a compiler except that it happens in real time every time the code is run whereas the compiler saves the "compiled" output and the runtime runs that. That is why compiled programs execute faster than interpreted programs. When you choose the "compile" option in Access, the VBA source is partially compiled and saved in a "tokenized" form. The final compilation steps happen at runtime.

As someone already pointed out, compilers are multi-phased. That means that they take several passes through the source code doing different things. I can't give you details because I'm not familiar with the VB compiler so I'll just list some of the things that need to be done to produce an .exe.

1. Read through the source code to identify variables and determine their data types.
2. Assign the variables to a memory location.
3. Create a cross reference to be used in later phases
4. Read through the source code to identify instructions and convert them to machine code.
5. Substitute the memory address for each variable within an expression.
6. Read through the code to identify branching points and assign memory addresses to them
7. Substitute the memory address for the text name of each referenced sub or function or call
etc.
The end result of a compliation is a relocatable module. That means that all the absolute address references in the module are in a base and displacement (or segment and offset if you prefer) format. When the module is loaded into memory, the address at which it is loaded becomes the base and all references resolve to that base. So if some variable was located 2500 bytes from the beginning of the module and the module was then loaded into memory starting at address 100000, then the real address of the variable would be 100000 + 2500.
 
You really can't appreciate what Access does for you behind the scenes until you try to create a bound form that updates a table.

Thats my opinion too, and I said that in another thread.
I still believe VB is way behind Access in terms of ease of use and getting things done quickly. What is provoking is that VB doesnt have to be that handicapped!! I really beleive they can be merged into one product. Microsoft owns the code for both products and the window classes and controls and everything.
It seems that it's Microsoft's way to get your money twice, once to buy Access and get things done, and once to buy VB and acheive some other goals like generating an EXE. There is a big chance if you are a serious developer that you will need both!
 
Last edited:
Or it could be their way of getting your money gradually, by releasing VB 5 and and saying it has better support for database, and then VB 6 and saying it has improved crystal reports and improved data controls, and so on. It is like having the blue prints of the 20 GB hard disk yet selling you the 120 MB, and saying it is the latest.
Imagine if Ford was the only car manufacturer, and they decided to start with marketing the stone wheel !!
 
samehkh said:
Imagine if Ford was the only car manufacturer, and they decided to start with marketing the stone wheel !!

Can we have it in an colour as long as it's grey? :)
 

Users who are viewing this thread

Back
Top Bottom