Private Sub List1_DblClick() Dim rst As New ADODB.Recordset Dim strSQL As String Dim tmpStr As String List2.AddItem (List1.List(List1.ListIndex)) If Check1.Value = 1 Then With rst .Source = "select * from " & List1.List(List1.ListIndex) .ActiveConnection = oraCon .CursorType = adOpenKeyset .LockType = adLockOptimistic .Open End With RefreshGrid rst rst.Close End If tmpStr = List1.List(List1.ListIndex) strSQL = "SELECT COLUMN_ID, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE " strSQL = strSQL & "FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME=" strSQL = strSQL & "'" & Mid(tmpStr, InStr(1, tmpStr, ".", vbTextCompare) + 1) & "'" strSQL = strSQL & " and OWNER='" & Mid(tmpStr, 1, InStr(1, tmpStr, ".", vbTextCompare) - 1) & "'" With rst .Source = strSQL .ActiveConnection = oraCon .CursorType = adOpenKeyset .LockType = adLockOptimistic .Open End With rst.MoveFirst RefreshPropGrid rst rst.Close PropGrid.Visible = True SQLScriptList.Visible = False End Sub Private Sub RefreshGrid(rst As ADODB.Recordset) Dim fld As ADODB.Field On Error Resume Next FlxGrid1.Clear rst.MoveFirst If rst.EOF Then Exit Sub End If With FlxGrid1 .Redraw = False .Clear .FixedCols = 0 .FixedRows = 0 .Cols = rst.Fields.Count rst.MoveLast .Rows = rst.RecordCount + 1 .Row = 0 .Col = 0 For Each fld In rst.Fields .Text = fld.Name .ColAlignment(.Col) = 1 .ColWidth(.Col) = Me.TextWidth(fld.Name & "AA") If .Col < rst.Fields.Count - 1 Then .Col = .Col + 1 End If Next rst.MoveFirst Do Until rst.EOF .Row = .Row + 1 .Col = 0 For Each fld In rst.Fields If Not (IsNull(fld.Value)) Then .Text = fld.Value If .ColWidth(.Col) < Me.TextWidth(fld.Value & "AA") Then .ColWidth(.Col) = Me.TextWidth(fld.Value & "AA") End If End If If .Col < rst.Fields.Count - 1 Then .Col = .Col + 1 End If Next rst.MoveNext Loop .FixedRows = 1 .Redraw = True End With End Sub Private Sub FillTabList(rst As ADODB.Recordset) rst.MoveFirst Do Until rst.EOF List1.AddItem (Trim(rst.Fields("Owner").Value) & "." & Trim(rst.Fields("Table_Name").Value)) rst.MoveNext Loop End Sub Private Sub RefreshPropGrid(rst As ADODB.Recordset) Dim fld As ADODB.Field On Error Resume Next PropGrid.Clear If rst.EOF Then Exit Sub End If With PropGrid .Redraw = False .Clear .FixedCols = 0 .FixedRows = 0 .Cols = rst.Fields.Count rst.MoveLast .Rows = rst.RecordCount + 1 .Row = 0 .Col = 0 For Each fld In rst.Fields .Text = fld.Name .ColAlignment(.Col) = 1 .ColWidth(.Col) = Me.TextWidth(fld.Name & "AA") If .Col < rst.Fields.Count - 1 Then .Col = .Col + 1 End If Next rst.MoveFirst Do Until rst.EOF .Row = .Row + 1 .Col = 0 For Each fld In rst.Fields If Not (IsNull(fld.Value)) Then .Text = fld.Value If .ColWidth(.Col) < Me.TextWidth(fld.Value & "AA") Then .ColWidth(.Col) = Me.TextWidth(fld.Value & "AA") End If End If If .Col < rst.Fields.Count - 1 Then .Col = .Col + 1 End If Next rst.MoveNext Loop .FixedRows = 1 .Redraw = True End With End Sub