July 31, 1999

VBControlName – The name of a VB control

‘ the name of a control given the corresponding VBControl object’ (accounts for items in control arrays)Function VBControlName(vbc As VBIDE.VBControl) As String Dim index As Long index = vbc.Properties(“Index”) If index < 0 Then VBControlName = vbc.Properties("Name") Else VBControlName = vbc.Properties("Name") & "(" & CStr(index) & ")" End IfEnd Function

NodeNestingLevel – The nesting level of a TreeView’s node

‘ Returns the nesting level of a TreeView’s Node object’ (returns zero for root nodes.)Function NodeNestingLevel(ByVal Node As Node) As Integer Do Until (Node.Parent Is Nothing) NodeNestingLevel = NodeNestingLevel + 1 Set Node = Node.Parent LoopEnd Function

Fill a TreeView control with random data

Every now and then you need to fill a TreeView control with some random data, for example when you want to test a routine and you don’t want to write a lot of code just for this secondary task. Here is a recursive routine that does the work for you:

ConvertSelectedTex – Convert text selected in code window

‘ Convert to uppercase, lowercase, or propercase the text that is’ currently selected in the active code windowSub ConvertSelectedText(VBInstance As VBIDE.VBE, Optional conversion As Long = _ vbUpperCase) Dim startLine As Long, startCol As Long Dim endLine As Long, endCol As Long Dim codeText As String Dim cpa As VBIDE.CodePane

Improve Performance of IIS by Changing Threading Model

Internet Information Server (IIS), by default, uses an apartment-threaded, or single-threaded, threading model. This design choice was made because many Web sites still used Access as the database backend. Access, being a desktop database system, was not designed to work with multiple concurrent users. As you migrate your databases to