Dynamically Create Databases (.MDB’s) in code

This code creates a Microsoft Access MDB dynamically. Original Author: Kenny Sendel Assumptions This sample code will create a database in the temp directory with the following fields:fldForeNamefldSurnamefldDOBfldFurtherDetails API Declarations NONE Code ”” PUT THIS BEHIND A COMMAND BUTTON TO TEST”’ DeclarationsDim tdExample      As TableDefDim fldForeName     As FieldDim fldSurname     As FieldDim fldDOB       As FieldDim fldFurtherDetails  As FieldDim dbDatabase     As DatabaseDim sNewDBPathAndName  As… Read More »

Associate File Name and Icon

For those of you who want to add a touch of professionalism to your program, now you can create a file type in the Windows Registry database which will associate all files ending with your program’s file extension ( yourfile.xxx) to your program. You also specify an icon for your file type and a description. This example also… Read More »

The Most Simple Credit – Scroller

This code will easily let any user create simple, yet effective credit scroller. This is so effectively easy, that any novice can create it. I created this code because I tried the other source code on this site, and I found it difficult to follow. Original Author: silverx10 Inputs N/A API Declarations Code 1) Create a new project (Standard… Read More »

Office97 Assistant Plays Games!!!

This code makes the irritating office assistant a fun playmate, he play games of Paper, Scissors, Stone…and his expressions change according to your actions!!!! Original Author: Ed Hockaday Assumptions You will need the ietimer.ocx (from ie4) to get this working, a none timer version can be easily built using this code… API Declarations Code ‘This bit goes in a… Read More »

RegCodes

This class contains two functions which can be helpful in creating an online shareware registration system for your software projects. GenerateKeyCode takes a username, or any other string, and generates a unique human-readable registration code (such as 9397-JQM0LD0YJV from the string: Andy Carrasco). GenerateKeyCode will generate a totally unique registration code over and over again, even for the… Read More »

Copying List Items to the Clipboard

This code is a demonstration of a quick and easy way to copy an entire list (without needing to select them all) or selected list items to the clipboard for pasting into other applications. It simply copies the items to a hidden text box and then uses the clipboard method. Follow the instructions below to see how it… Read More »

4 function Calculator with 8 level memory

This is a 4 function calculator with 8 – level memory, it performs calculations Original Author: James Bergeron Assumptions Nothing, it works nicely Returns Values you calculated Side Effects None, I hope 🙂 API Declarations NONE Code Dim calcarray(0 To 3) As DoubleDim holder As IntegerDim operation As IntegerDim decicount As IntegerDim newnum As IntegerDim clearcount As IntegerDim memstorebut(1… Read More »

Distance Calculation

This code shows how to use Visual Basic to calculate great circle distance (distance between 2 points using decimal latitudes and longitudes). Original Author: Corey Behrends Inputs see code Assumptions 1. This code does not figure in differences in altiude2. In order to use this code you must have the latitude and longitude in decmal form. Returns Returns the… Read More »

Aprostrophe

Have you ever try so send a string variable to MS Access that haveapostrophes using a SQL Statement? If YES you will get a run time ERRORHere is your solution….A function that formats thevariable before sending it to the database. Original Author: Gaetan Savoie Inputs sFieldString Assumptions This code should be used in your Classes.For example :let say myVar=”… Read More »

32-bit Floating Toolbar (NT & 95)

This code gives you the ability to create a ‘floating toolbar’ within your application. The old SetWindowWord function is only good for 16-bit applications, so it won’t run under a 32-bit OS (like NT4). The API call you should use if you are programming a 32-bit application is SetWindowLong. It works the same way as SetWindowWord, only uses… Read More »