views:

863

answers:

6

What are all the build in data structures for VB6 (Microsoft Access) ? I know there are arrays, but are there other more modern data structures?

+4  A: 

It has a Dictionary: http://stackoverflow.com/questions/915317/does-vba-have-dictionary-structure/915323

And Collection: http://stackoverflow.com/questions/76882/vba-resource-for-python-programmer

Mitch Wheat
thank you for the help
Milhous
The dictionary is *not* a VBA data structure, but it's usable in VBA simply because a COM object (the scripting runtime) provides it.
David-W-Fenton
@David W. Fenton is of course correct. Both of those COM objects are commonly used in VBA.
Mitch Wheat
+5  A: 

Disconnected recordsets can also be useful: http://stackoverflow.com/questions/226978/syncing-two-lists-with-vba

Remou
+1  A: 

You can also create your own (better accessibility/performance XML collections) in this way:

MS XML Collections

Also consider using hashtables:

Hash Tables

MaSuGaNa
+2  A: 

The excellent book Hardcore Visual Basic by Bruce McKinney includes some code for creating linked lists, stacks, etc. as part of its introduction to object-based programming with VB6. The book is now available free online.

MarkJ
+2  A: 

I don't think I understand the question. When I read it, I thought of:

  • Arrays
  • Collections
  • Types
  • Enums

and so forth. Not sure if I'd consider standalone class modules as part of the answer, as they can have any structure you want, rather than being a particular data structure. And, of course, VBA being COM-based, it can use any data structure from compatible COM objects. This may or may not require a type library (depends on the COM object's implementation).

David-W-Fenton
Yah my first instinct was to explain Types.
Oorang
+1  A: 

I written quite a lot of code in VB6 and for sure I used Dictionary and Collection classes a lot. But I still think that they are not enough in many cases, that's why I advise you to take a look at this library:

http://sourceforge.net/projects/vbcorlib/

that it's a port of .NET libraries to VB6.

Patrizio Rullo