Reverse a String

This is a string handling function that that reverse a given string. For example, Good Morning becomes gninroM dooG. The code reads a string into an array, which is no surprise. We could use a temporary “working” string, or an array to achieve the goal. What is a bit different here is that as the string is read in from the… Read More »

Read from a database without a control

This snippet of code shows how to connect to a database using a Data Source Name (DSN), and a reference to Microsoft ActiveX Data Objects (ADO). To make the reference to ADO, while in the IDE, click Project, References. In the References window, select the version of MS ADO that you wish to use. In the picture below,… Read More »

Make your application stay on top

Keep your application on top of all other applications. Comes in handy if you’re writing a “toolbar” type of application. Place the following code in a module. This is the reference and configuration for the system API that we are going to use to make our window topmost. Private Declare Function SetWindowpos Lib “user32” ( _    ByVal hWnd As… Read More »

Easily write to the Windows Event Log

This module allows you to write text to the Windows Event Log with with a single method call. Includes options for Type, Source, Category, and Event. Usage LogEvent([Applicaiton Name], [EventLog Type], [Msg to be logged], [Optional Event ID], [Optional Category Number]) Example Dim ret as Longret = LogEvent(“TestApp1”, EVENTLOG_SUCCESS, “Success event!!!!”) Code Copy the entire code below into… Read More »

Send clicks to another application

This code demonstrates how to send mouse clicks to another application using the SendInput API, in user32.dll. First, you’ll want to place the following code in a module. This is where you define some constants, and make reference to the API you are going to use. Public Structure MOUSEINPUT    Public dx As Integer    Public dy As Integer    Public mouseData As Integer    Public… Read More »

Check for duplicates in an array

I’ve been looking around for this code and no one could provide it. So finally I wrote it. It checks for duplicates in an array and returns true if there are any. Public Function AnyDup(NumList As Variant) As Boolean    Dim a As Long, b As Long    ‘Start the first loop    For a = LBound(NumList) To UBound(NumList)   … Read More »

Whitman Point of Sale (POS)

This is a fully functioning point of sale system written in VB6, utilizing an MS Access database. Overview I wrote this way back in 2003 for a friend, who actually used it in his business for quite a number of years. The only reason it went away is because he needed something more robust, with a multi-location and… Read More »

HelpTrax Helpdesk Application

I was going through some of my old code during a backup process, and I stumbled across this mostly complete help desk application I wrote about 13 years ago. Maybe someone can get some use out of it? This app began life as most of my code does, to solve one of my own problems. In this case,… Read More »

Create an Access database with VB6

Creating an Access database with VB6 should not be intimidating, and it is much simpler than you might think.  Four lines of code will do the job. In your project, simply create a refrence to the latest Microsoft DAO Object Library. On my installation, this is shown as Microsoft DAO 3.6 Object Libary. Once the necessary reference is made, simply… Read More »

Building Random People

Yes, building people. This program, meant to demonstrate the use of a few different methods, builds random person data (Address, phone, etc). I didn’t build this for someone to build false identities for nefarious purposes, although it could probably be used for that. Nay, I built this to demonstrate the use of a few different concepts in Visual… Read More »