Skeeter's Code Examples

These are tasks that I routinely need to do but also routinely forget how to do.
ALOV Map Applet Add toolbars to your map
ALOV Map Applet Filter a layer (shapefile) using the layer's attributes
ALOV Map Applet Make a simple map
ArcObjects Get the map coordinates of a map click event
ArcPad Create and Use Session Variables
ArcPad Deploy an Applet
ArcPad Show a form
ArcPad (VBScript) Open a File Dialog
ArcPad (VBScript) Use ArcPad to interact with an Access or SQL Server database
Coldfusion A Better ParagraphFormat function
Coldfusion Alternate row colors
Coldfusion An advanced search interface example.
Coldfusion Check a URL
Coldfusion Escape special or xml characters from Coldfusion content that may contain html
Coldfusion How to correctly implement the really messed up html checkbox form tag.
Coldfusion Make an RSS feed
Coldfusion Prevent Coldfusion SQL Injection Attack
Coldfusion Refreshing Web Service Stubs in ColdFusion MX
Coldfusion Remove whitespace
Coldfusion Replace carriage returns
Coldfusion Suppress whitespace in a Coldfusion template that outputs xml
DotSpatial Add a point to a map without creating a shapefile
DotSpatial Add a points featureset to a map
Ext-JS Fill a GridPanel with data from a Coldfusion data source
HTML Help Cannot display .chm (html help) files opened over a network.
Janus GridEX Load a GridEX combo box with values
Janus GridEX Loop through GridEX rows
Janus GridEX Populate a GridEX DropDown
Janus GridEX Update the totals row in a Janus GridEX and then use the updated value in a control
Javascript An example javascript tree
MapWindow Create a shapefile and add a point to it
MapWindow Draw a point on a map
MapWindow Draw a spatially referenced point without the bother of building a shapefile
MapWindow Graduate point colors
MapWindow Loop through a shapefile and serialize the shapes to strings
MapWindow Select points
MapWindow Which DLLs do I need to load?
Microsoft Access Associate a .chm help file with a Microsoft Access application
Microsoft Access Associate a .chm help topic with an Access form object.
Microsoft Access Build form to VGA 1024 x 768 screen size
Microsoft Access Clear a ListBox
Microsoft Access Color translations
Microsoft Access Default Value for Datetime Column Appears as 12/30/1899
Microsoft Access Delete files associated with records to be deleted
Microsoft Access Filter a form based on a GUID key value
Microsoft Access Filter a form by selected listbox item
Microsoft Access Filter a subform by the value of a control
Microsoft Access Find a record by listbox selection
Microsoft Access Find all Access forms with a 'stuck' ServerFilter property.
Microsoft Access Form finishing checklist
Microsoft Access Forms refuse to restore
Microsoft Access Generate a fixed number of empty child records for a parent record
Microsoft Access Get the selected records from an Access table
Microsoft Access Get the values out of a listbox with multi-select
Microsoft Access Guid substitute
Microsoft Access Import a .dbf into an Access database
Microsoft Access Import data from a dbf
Microsoft Access Loading an image into a Sql Server varbinary(max) field using Access
Microsoft Access Loop through files in a directory
Microsoft Access Make and loop through an Access recordset
Microsoft Access Open a File Dialog
Microsoft Access Programmatically get the primary key of a database table
Microsoft Access Programmatically get the structure of an Access table using code
Microsoft Access Programmatically retrieve the number of columns in an Access table
Microsoft Access Programmatically set the default value of a detail form's column
Microsoft Access Record when database records are edited
Microsoft Access Refer to a control on a parent form
Microsoft Access Refresh a dropdown selection box on one form after an item is added to the dropdown's rowsource using a different form.
Microsoft Access Select A Folder
Microsoft Access Select multiple items from a listbox and loop through them
Microsoft Access Set warnings off for update and insert queries
Microsoft Access Show an image from a Sql Server varbinary(max) field in an Access Image control
Microsoft Access Show in a label the number of records in a table that meet criteria
Microsoft Access The multi-part identifier XXX could not be bound (Sigh)
Microsoft Access Toggle a subform between datasheet and form view
Microsoft Word Get around 'Paste Formatted' (Which, incidentally, MUST DIE!!!!!!!!!!!!!!!!)
OpenLayers Add a GML Layer
OpenLayers Add layers to an OpenLayers map
OpenLayers Add points to an OpenLayers map
OpenLayers An OpenLayers function to convert geographic coordinates to an OpenLayers.LonLat object in Web Mercator projection
OpenLayers Build a bounding box polygon and put it on an OpenLayers map
OpenLayers Create a map in web mercator projection, add a point in geographic coordinates, project the point and label it
OpenLayers Create an OpenLayers map in Spherical Mercator projection, project some points from geographic coordinates and add them to the map.
OpenLayers OpenLayers vector layer won't render, or renders weirdly in Internet Explorer (the usual culprit).
SQL Cast a string date to DateTime in a query
SQL Custom ORDER BY clause in an SQL query
SQL Generate a concatenated query column
SQL Get the last identity value inserted into an identity column in the same scope (i.e., get the primary key of the last inserted record so you can correctly relate child record inserts).
SQL Select a count of distinct values in a table
SQL Using Exists() in an SQL statement
SQL Server Insert an image into a Sql Server table
SQL Server Express Edition Bit data type: which is true and which is false
SQL Server Express Edition CAST and CONVERT (T-SQL)
SQL Server Express Edition Connect Coldfusion 8 to SQL Server Express Edition
SQL Server Express Edition Copy a table from one sql server database into another
SQL Server Express Edition Enumerate default value constraints using T-SQL
SQL Server Express Edition Generate a guid in a query
SQL Server Express Edition Generate conditional columns in SQL Server using Case statements
SQL Server Express Edition Get all the benefits of a Guid without the pain
SQL Server Express Edition Get Julian day from a date
SQL Server Express Edition Get the primary key(s) of a DataTable
SQL Server Express Edition Query for fractional hours from DateTime values
SQL Server Express Edition Query to get records whose date closely matches a given date
SQL Server Express Edition Select a date formatted with padded values (i.e. get the day or month part of a data with two digits instead of one).
SQL Server Express Edition Set a primary key column's data type to text but have sql server automatically populate it with the string equivalent of a GUID.
SQL Server Express Edition Use T-SQL variables
SQL Server Express Edition Useful SQL Server column default value functions
SQL Server Spatial A SQL Server Great Circle Distance or Haversine Function
SQL Server Spatial Get the text representation of a geography data type in a query
SQL Server Spatial Insert a line into a SQL Server geography column. Example SQL
SQL Server Spatial Load a geographic point coordinate pair into a geography table column
SQL Server Spatial Write a query to return the distance between two non-geographic (text) points
SQL Server Spatial Write a query to update a geography column from decimal latitude and longitude fields
Visual Basic A function to search through text files for a string
Visual Basic A simple and accurate Great Circle or Haversine formula function
Visual Basic Add a calendar control to a DataGridView
Visual Basic Append the name of a failing sub or function to the error message in a Try/Catch block
Visual Basic ArrayList Overview
Visual Basic Bind a text field to a database table field
Visual Basic Build a treeview control to show database records
Visual Basic Calculate elapsed time between two time strings in 24 hour time format
Visual Basic Calculate time difference between two datetimes in minutes
Visual Basic Capture a DataGridView's button column's click event
Visual Basic Check to see if there are any pending changes to a dataset and ask the client if they want to save them
Visual Basic Color a DataGridView cell
Visual Basic Compare dates
Visual Basic Convert a Word document stored as a BLOB in SQL Server back into a document
Visual Basic Convert an image stored in a SQL Server varbinary(max) data type back to an image that can be shown in a PictureBox or DataGridView
Visual Basic Create a custom TreeNodeController class to store and retrieve information from TreeNodes
Visual Basic Create a DataView and set a DataGridView's Datasource to it
Visual Basic Create a form filter
Visual Basic Create and loop through a datareader
Visual Basic Database driven comboboxes
Visual Basic DataGridView won't show scroll bars
Visual Basic DataGridViewAutoSizeColumnsMode options
Visual Basic Dataset.HasChanges() always false
Visual Basic Determine if a directory exists
Visual Basic Drag and drop a filename into a DataGridView
Visual Basic Drag and drop text
Visual Basic Embed a subform in a split pane
Visual Basic File overwrite protection
Visual Basic Fill a listbox with list of Access database tables
Visual Basic Filter a DataTable
Visual Basic Find a record in a BindingSource and move to it
Visual Basic Find a record in a BindingSource and set the BindingSource's position to it
Visual Basic Format a date
Visual Basic Gather information in a dialog form and return it to the parent form (pass data between forms)
Visual Basic Generate a Guid
Visual Basic Generate real random numbers
Visual Basic Get a binding navigator to really delete a record from a DataTable.
Visual Basic Get a filename from a file path
Visual Basic Get image metadata
Visual Basic Get image thumbnail
Visual Basic Get metadata from an image using GDI+
Visual Basic Get the column names from a DataReader object
Visual Basic Get the current username
Visual Basic Get the directory from a full file path
Visual Basic Get the ID of the current record from it's bindingsource
Visual Basic Get the last character of a string
Visual Basic Get the text or tag of a right-clicked treenode.
Visual Basic Gracefully handle a DataGridView DataError event without losing data
Visual Basic Highlight or select a tree node using code
Visual Basic How to Load a DataGridView from a DataReader
Visual Basic How to use a FolderBrowserDialog
Visual Basic How to: Update a Data Source with the Contents of Related DataTables (Visual Basic)
Visual Basic Interrupt or cancel a form closing event
Visual Basic Load a CSV (comma separated values) text file into a Dataset
Visual Basic Load an Excel sheet into a DataTable and DataGridView
Visual Basic Load images into datagridview
Visual Basic Loop through a comma separated list
Visual Basic Loop through a textbox
Visual Basic Loop through the checked items in a CheckedListBox
Visual Basic Make a date picker
Visual Basic Make a Master/Detail Formset in Visual Studio
Visual Basic Make a master-detail formset synchronize data edits
Visual Basic Make a simple graph using ZedGraphControl
Visual Basic Manage the order of update, delete and insert queries
Visual Basic Manually create a datatable and fill it with records
Visual Basic Maximize a form
Visual Basic NullReferenceException handling in database applications
Visual Basic Only save inserted records in a DataTable back to a database.
Visual Basic Open files with the OpenFileDialog
Visual Basic Open windows explorer and show a directory
Visual Basic Pad a number with leading zeroes
Visual Basic Parse a Tree Node Key
Visual Basic Parse comma separated values and strip carriage returns
Visual Basic Pass a variable between forms
Visual Basic Programmatically add a DataGridViewRow row (non-data-bound)
Visual Basic Programmatically add a row to a data bound DataGridView
Visual Basic Programmatically add context menu item
Visual Basic Programmatically bring a tab forward
Visual Basic Programmatically change a ConnectionString
Visual Basic Programmatically create a datatable
Visual Basic Programmatically launch a help file (.chm)
Visual Basic Property grid tutorial
Visual Basic Put a tooltip on a control
Visual Basic Read and loop through a comma separated values file
Visual Basic Read data from a comma separated values (*.csv) into a datatable
Visual Basic Read From Text Files in Visual Basic
Visual Basic Recursive directory treeview
Visual Basic Remove or trim rightmost trailing character
Visual Basic Replace only a certain number of characters in a string
Visual Basic Right-click a DataGridView cell and provide a context menu of options for filling the cell
Visual Basic Save a Dataset's changes back to the database
Visual Basic Save the current cell in a DataGridView even if the user hasn't moved off the cell in order to trigger the Dataset.HasChanges property
Visual Basic SaveFileDialog Example
Visual Basic Saving related tables
Visual Basic Scroll to a selected row in a DataGridView
Visual Basic Search for and highlight text in a RichTextBox
Visual Basic Select and highlight a tree node using code
Visual Basic Select DISTINCT on DataTable
Visual Basic Select distinct values from a DataSet's DataTable.
Visual Basic Serialize an object
Visual Basic Set a DateTimePicker's default value
Visual Basic Set a report's binding source
Visual Basic Set a right clicked DataGridView cell as selected after a right click and get it's value
Visual Basic Set default values for new records in a DataGridView control
Visual Basic Set up GridEX default values and dropdowns programmatically
Visual Basic Setting up a listbox on a form to allow users to choose a record to edit
Visual Basic Show a range of dates in a MonthCalendar control
Visual Basic Show help when a control is clicked
Visual Basic Sort a DataGridView
Visual Basic Sort a Dataset's DataTable object
Visual Basic Split a string into separate words
Visual Basic Store objects in a collection and serialize it to a file
Visual Basic Synchronize a TreeView with a BindingSource
Visual Basic Synchronize data between forms
Visual Basic Synchronize data-bound master/detail formsets
Visual Basic Trim the trailing slash off a directory path or other string
Visual Basic Update a progress bar with each iteration of a loop
Visual Basic Use a treeview control (Various useful functions)
Visual Basic Use the Right() function (or get the file extension of a filename)
Visual Basic Use Visual Basic to interact with Excel spreadsheets
Visual Basic Using Data Across Multiple Windows Forms
Visual Basic Validate data and provide feedback using an ErrorProvider
Visual Basic Validate URLs
Visual Basic Web Browser Functions Overview
Visual Basic Write text field to file
Visual Basic For Applications A sub to load table records into a tree
Visual Basic For Applications A VBA FolderBrowser dialog to get a directory
Visual Basic For Applications Confirm an action in VBA using a message box (MsgBox).
Visual Basic For Applications Convert stupid Excel dates to real dates that you can use
Visual Basic For Applications Get a count of the number of (filltered) records in a recordset
Visual Basic For Applications Get at the values in a multi-column listbox
Visual Basic For Applications Get filename from path
Visual Basic For Applications How to delete files using VBA, including files which may be readonly
Visual Basic For Applications How to reference an Access subform
Visual Basic For Applications Load a file using the default application
Visual Basic For Applications Load a web page into the Microsoft Web Browser Object
Visual Basic For Applications Loop through selected items in a listbox
Visual Basic For Applications Open a directory with File Explorer
Visual Basic For Applications Open a file or url in the default application.
Visual Basic For Applications Open a file with the default application
Visual Basic For Applications Open a URL in a browser
Visual Basic For Applications Parse or loop through a comma separated list using VBA Split function
Visual Basic For Applications Pass a parameter to a form or report
Visual Basic For Applications Read a text file
Visual Basic For Applications Replace a character (or substring) with another
Visual Basic For Applications Timing a process
Visual Basic For Applications Write to a text file
Visual Basic For Applications You must use the dbSeeChanges option with OpenRecordSet when accessing a SQL Server table that has an IDENTITY column
Visual Studio Custom installer header bitmap size
Visual Studio Draw a rectangle and add text
Visual Studio Passing Data Between Forms in a Windows Application
Visual Studio Point a database application to a different back-end database.