| = "Fixedsys"
Size = 12
Charset = 134
Weight = 400
Underline = 0 ''''False
Italic = 0 ''''False
Strikethrough = 0 ''''False
EndProperty
Height = 1935
Left = 3525
MultiLine = -1 ''''True
ScrollBars = 2 ''''Vertical
TabIndex = 3
Top = 750
Width = 4815
End
Begin VB.CommandButton cmdConn
Caption = "连接数据库"
Height = 390
Left = 0
TabIndex = 2
Top = 0
Width = 1215
End
Begin VB.PictureBox picLeftRight
Height = 5625
Left = 3030
MousePointer = 9 ''''Size W E
ScaleHeight = 5565
ScaleWidth = 30
TabIndex = 1
Top = 570
Width = 90
End
Begin MSComctlLib.TreeView tvwTable
Height = 6015
Left = -15
TabIndex = 0
Top = 405
Width = 2895
_ExtentX = 5106
_ExtentY = 10610
_Version = 393217
HideSelection = 0 ''''False
Indentation = 0
LabelEdit = 1
LineStyle = 1
Style = 7
Checkboxes = -1 ''''True
Appearance = 1
End
End
Attribute VB_Name = "frmViewData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private myConn As ADODB.Connection
Private myRecordSet As ADODB.Recordset
Private strConn As String
Private bolDraging As Boolean
Private lngLastPos As Long
Private Sub SetControlSize()
On Error Resume Next
tvwTable.Width = picLeftRight.Left - tvwTable.Left
tvwTable.Height = Me.ScaleHeight - tvwTable.Top
picLeftRight.Top = tvwTable.Top
picLeftRight.Height = tvwTable.Height
txtSQL.Left = picLeftRight.Left + picLeftRight.Width
txtSQL.Top = tvwTable.Top
txtSQL.Width = Me.ScaleWidth - txtSQL.Left
txtSQL.Height = picUpDown.Top - txtSQL.Top
picUpDown.Left = txtSQL.Left
picUpDown.Width = txtSQL.Width
myGrid.Left = txtSQL.Left
myGrid.Top = picUpDown.Top + picUpDown.Height
myGrid.Width = txtSQL.Width
myGrid.Height = Me.ScaleHeight - myGrid.Top
End Sub
Private Sub cmdConn_Click()
Dim dlg As New MSDASC.DataLinks
Dim myC As New ADODB.Connection
On Error GoTo ConnErr
dlg.hWnd = Me.hWnd
myC.ConnectionString = strConn
If dlg.PromptEdit(myC) = True Then
strConn = myC.ConnectionString
If myConn.State = 1 Then
myConn.Close
End If
myConn.ConnectionString = strConn
myConn.Open
RefreshView
txtSQL.Text = strConn 上一页 [1] [2] [3] [4] [5] [6] 下一页 |