VERSION 5.00 Begin VB.Form frmOpen Caption = "Open Inform Database" ClientHeight = 2475 ClientLeft = 2280 ClientTop = 1815 ClientWidth = 5775 Icon = "frmOpen.frx":0000 LinkTopic = "Form1" ScaleHeight = 2475 ScaleWidth = 5775 Begin VB.CommandButton cbCancel Caption = "&Cancel" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 405 Left = 2895 TabIndex = 3 Top = 2010 Width = 1320 End Begin VB.CommandButton cbOK Caption = "&OK" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 405 Left = 4335 TabIndex = 2 Top = 2010 Width = 1320 End Begin VB.ListBox lbFiles Height = 1620 Left = 120 TabIndex = 0 Top = 285 Width = 5535 End Begin VB.Label Label1 Caption = "Available Databases" BeginProperty Font Name = "Verdana" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 195 Left = 150 TabIndex = 1 Top = 75 Width = 2175 End End Attribute VB_Name = "frmOpen" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cbCancel_Click() Unload Me End Sub Private Sub cbOK_Click() With frmOpen OpenDatabase "Vinform." & Trim(Left(.lbFiles.Text, 8)) End With Unload Me End Sub Private Sub Form_Load() Dim objRegKey As RegKey Dim objSubKey As RegKey Dim strFile As String Dim strDesc As String Dim intFileCount As Integer Set objRegKey = RegKeyFromString("\HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\") For Each objSubKey In objRegKey.SubKeys If Left(objSubKey.Name, 7) = "VInform" Then intFileCount = intFileCount + 1 strFile = Right(objSubKey.Name, Len(objSubKey.Name) - 8) strFile = strFile & Space(8 - Len(strFile)) strDesc = objSubKey.Values("Description") lbFiles.AddItem strFile & vbTab & strDesc End If Next Set objRegKey = Nothing Set objSubKey = Nothing If intFileCount = 0 Then MsgBox "There are currently no Inform databases available.", , "Open Inform database" Unload Me End If End Sub