Skip to main content

Questions tagged [vb6]

Visual Basic 6.0 (VB6) is the "third-generation" event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. It was also considered a relatively easy programming language to learn and use, because of its graphical development features and BASIC heritage.

Filter by
Sorted by
Tagged with
7 votes
0 answers
101 views

Faster VB6 / VBA class deallocation

VB6 / VBA is slow to deallocate class instances VB* class instance deallocation becomes exponentially slower the more instances of that particular class there are. Quick test. You will need: Guido's ...
Cristian Buse's user avatar
6 votes
1 answer
399 views

ADODB Wrapper Class (Revisited)

I recently posted this question on my implementation of an ADODB Wrapper Class. I realized in my own review that I was missing some very important things, so much so, that I decided it would be worth ...
rickmanalexander's user avatar
2 votes
1 answer
569 views

ADODB Wrapper Class

I use ADO (specifically for accessing SQL) daily at work. So, I finally decided that I was going to create a class that makes it simple for myself and other programmers on the job to use. Just the ...
rickmanalexander's user avatar
5 votes
1 answer
229 views

App for providing accounting solutions for clients

I have a VB6 app that has existed for more than 7 years to which I have a few clients using it for their accounting solutions. Now my problem is that a particular client has grown so big with a 15GB ...
Tobyy Damian's user avatar
12 votes
6 answers
5k views

Format RGB Long as hex string in VB6

This is how I convert e.g. RGB(255, 0, 0) (where red is stored in the least significant byte of a Long) to a 6-digit hex string <...
Felix Dombek's user avatar
  • 1,081
12 votes
1 answer
623 views

Shared VB6 *and* VBA extensibility add-in with OnConnect and OnDisconnect handling

Rubberduck works well enough when the VBE is of the VBA variety, but it currently only works when the Rubberduck is configured to load at VBA start-up, and it has a tendency to crash the host ...
ThunderFrame's user avatar
  • 1,959
9 votes
1 answer
8k views

Multi-dimensional array sort and filter functions

As I said in my last post Multi-dimensional ascending and descending sort array function, I'm back with the final version of the code. Added features: Filter array function by following parameters: <...
Sorin GFS's user avatar
  • 313
4 votes
2 answers
216 views

Implementation of the Access version DBLookup() in VB6

I've tried to implement the access function DBLookup() in VB6 for a project I'm doing. Does anyone have comments on how well done it is and what could be improved? ...
Magisch's user avatar
  • 330
8 votes
1 answer
608 views

Growing my own Tree (Structure)

Summary VB6 doesn't have a great selection of data structures to work with, so again I find myself creating my own. I have a need to dynamically generate a directory structure on the file system. The ...
RubberDuck's user avatar
  • 30.9k
2 votes
1 answer
8k views

Calling Stored Procedures with Lots of Parameters

I have this piece of code for running a Stored Procedure, and I was wondering if there is a way of cutting code like: ...
Dave123432's user avatar
5 votes
1 answer
2k views

Converting to Roman Numeral with Recursive Algorithm

Summary I'm getting ready to dive back into a "more proper" project, so I wanted to take a moment to get my TDD hat on before doing so. I decided to tackle this Roman Numeral Kata for practice. The ...
RubberDuck's user avatar
  • 30.9k
15 votes
3 answers
5k views

Building a better Collection. Enumerable in VBA

VBA's 'Collection' is.... lacking, so, I've been working on a better Collection object that implements many of the features of C#'s Enumerable. This is very much inspired by this question and a follow ...
RubberDuck's user avatar
  • 30.9k
9 votes
2 answers
695 views

No more Fizzbuzz. How about Hello World instead?

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both ...
RubberDuck's user avatar
  • 30.9k
7 votes
2 answers
2k views

Generating Random RGB Colors

I have a function for generating RGB colors in VB6.0, and it is working properly. Please suggest improvements for this, if any. ...
user3905907's user avatar
4 votes
2 answers
857 views

Extract a character at particular place in a string

I have a function: ...
Sujith Karivelil's user avatar
12 votes
1 answer
5k views

Extending the VBA Extensibility Library

The Microsoft Visual Basic for Applications Extensibility library let's us meta-program VBA, but the way it handles (or rather, doesn't handle) getting to the actual subs and functions is clunky at ...
RubberDuck's user avatar
  • 30.9k
15 votes
2 answers
2k views

File reader/writer (text)

Following-up on this post, I wanted to be able to use my FileWriter with a syntax reminiscent of .net's using blocks, which ...
Mathieu Guindon's user avatar
9 votes
4 answers
1k views

FileWriter supporting writing to multiple files

I got bored with opening and closing files whenever I need to write to one, so I wrote a FileWriter class that's used like this: ...
Mathieu Guindon's user avatar
5 votes
1 answer
658 views

Recursively searching the Windows Registry

This function is part of a the Registry class that can be found on Google Drive. The class was originally written by Steve McMahon for VB6, but I ported it to VBA ...
RubberDuck's user avatar
  • 30.9k
14 votes
4 answers
3k views

Materializing any ADODB Query

Following-up on Creating ADODB Parameters on the fly and pushing the "wrapping" of ADODB a step further, I have written two more classes that allows me to expose methods that don't require a ...
Mathieu Guindon's user avatar
34 votes
5 answers
16k views

Creating ADODB Parameters on the fly

I have put together a small wrapper class to simplify creating parameterized ADODB queries with VB6/VBA. At this point I'm keeping things simple, so it's only supporting input parameters and from what ...
Mathieu Guindon's user avatar
8 votes
1 answer
3k views

Dictionary<TKey, TValue> Implementation

This class encapsulates a List<KeyValuePair> (see List<T> implementation here, and ...
Mathieu Guindon's user avatar
4 votes
1 answer
2k views

KeyValuePair implementation

In order to implement my own Dictionary<TKey, TValue> in VB6, I've implemented a KeyValuePair class, which can accomodate ...
Mathieu Guindon's user avatar
10 votes
5 answers
3k views

Testing code with Debug.Assert

I have a small little function in a VB6 codebase: ...
Mathieu Guindon's user avatar
11 votes
2 answers
1k views

Nullable<T> Implementation for VB6/VBA

Because I was spoiled with C# and the .NET framework, whenever I have to work with VB6 I feel like something's missing in the language. A little while ago I implemented a ...
Mathieu Guindon's user avatar
7 votes
2 answers
457 views

Revisited IsTypeSafe method implementation for "type-safe" List

Following up on List<T> implementation for VB6/VBA, I'd like some thoughts about the revisited IsTypeSafe function, below. The previous version pretty much ...
Mathieu Guindon's user avatar
52 votes
3 answers
16k views

List<T> implementation for VB6/VBA

Recently I decided VB6's Collection wasn't enough for my needs, so I decided to implement something like C#'s List<T>. ...
Mathieu Guindon's user avatar
20 votes
3 answers
3k views

A CSharpish String.Format formatting helper

A while ago I implemented .net's string.Format() method in VB6; it works amazingly well, but I'm sure there has to be a way to make it more efficient. I'll start ...
Mathieu Guindon's user avatar
10 votes
3 answers
992 views

A more readable InStr: StringContains

Consider the following: If myString = "abc" Or myString = "def" [...] Or myString = "xyz" Then In C# when myString == "abc" ...
Mathieu Guindon's user avatar
4 votes
3 answers
5k views

Converting base-10 numbers into base-26 letters

I'm writing something that basically takes a bunch of files and renames them into a nice format, such as pic_000.jpeg, ...
Michael's user avatar
  • 323
6 votes
2 answers
4k views

Avoiding the 'possible loss of data' compiler warning

I'm writing a file I/O DLL in C++ which is going to be used from VB6. The interface is already fixed, and uses INT64/Currency as the general integer data type. Now I have this function: ...
Felix Dombek's user avatar
  • 1,081
6 votes
3 answers
15k views

Is it a bad programming practice to declare variable in a loop?

Today, I came across a code example like the following: ...
ray023's user avatar
  • 377
5 votes
2 answers
1k views

VB6: String Searching Performance

5 years ago, when i was in love with VB, I created this simple program to detect if a file is virus or not. What I'd like is to see if you can help me optimize it, ...
Sourav's user avatar
  • 257
19 votes
3 answers
2k views

Shuffling algorithm for a "guess that tune" game

I'm making a "guess that tune" game in Visual Basic 6 that is supposed to play each song in a random order: ...
PleaseStand's user avatar