打印本文 打印本文 关闭窗口 关闭窗口
VB快捷查看表结构和表数据
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4773  更新时间:2009/4/23 15:43:37  文章录入:mintao  责任编辑:mintao
.Nodes.Clear tvwTable.Visible = True Me.MousePointer = 11 Me.Refresh If VBA.Strings.InStr(1, strProvider, "oracle") > 0 Then strSQL = "Select TName,CName,coltype,width From Col Order by TName,CName" Else strSQL = "select sysobjects.name ,syscolumns.name ,systypes.name ,syscolumns.length ,syscolumns.xtype from syscolumns,sysobjects,systypes where syscolumns.id=sysobjects.id and syscolumns.xtype=systypes.xtype and sysobjects.type=''''U'''' and systypes.name <>''''_default_'''' and systypes.name<>''''sysname'''' order by sysobjects.name,syscolumns.name" End If myRS.Open strSQL, myConn, adOpenStatic, adLockReadOnly, adCmdText Do Until myRS.EOF If strTableName <> myRS.Fields(0).Value Then strTableName = myRS.Fields(0).Value Set TableNode = tvwTable.Nodes.Add() TableNode.Text = strTableName End If Set FieldNode = tvwTable.Nodes.Add(TableNode.Index, tvwChild) FieldNode.Text = myRS.Fields(1).Value myRS.MoveNext Loop myRS.Close Set myRS = Nothing Me.MousePointer = 0 Exit Sub RefreshErr: Set myRS = Nothing Me.MousePointer = 0 On Error GoTo 0 End Sub Private Sub Form_Resize() If Me.WindowState <> 1 Then SetControlSize End If End Sub Private Sub Form_Unload(Cancel As Integer) If myConn.ConnectionString <> "" Then VBA.SaveSetting App.Title, Me.Name, "conn", myConn.ConnectionString End If If myConn.State = 1 Then myConn.Close End If Set myConn = Nothing Set myRecordSet = Nothing End Sub Private Sub picLeftRight_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) bolDraging = True lngLastPos = X End Sub Private Sub picLeftRight_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If bolDraging = True Then Dim lPos As Long lPos = picLeftRight.Left + X - lngLastPos If lPos < 1000 Then lPos = 1000 End If If lPos > Me.ScaleWidth - 1000 Then lPos = Me.ScaleWidth - 1000 End If picLeftRight.Left = lPos SetControlSize End If End Sub Private Sub picLeftRight_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) bolDraging = False End Sub Private Sub picUpDown_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) bolDraging = True lngLastPos = Y End Sub Private Sub picUpDown_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If bolDraging = True Then Dim lPos As Long lPos = picUpDown.Top + Y - lngLastPos If lPos < 1000 Then lPos = 1000 End If If lPos > Me.ScaleHeight - 1000 Then lPos = Me.ScaleHeight - 1000 End If picUpDown.Top = lPos SetControlSize End If End Sub Priva

上一页  [1] [2] [3] [4] [5] [6]  下一页

打印本文 打印本文 关闭窗口 关闭窗口