strData = VBA.Strings.Replace(strData, "<", "<")
strData = VBA.Strings.Replace(strData, ">", ">")
End If
End If
Print #intFH, " <td>" & strData & "</td>"
Next
Print #intFH, "</tr>"
myRS.MoveNext
lRecordCount = lRecordCount + 1
Loop
Print #intFH, "</table>"
Print #intFH, "共返回 " & lRecordCount & " 条记录 ," & myRS.Fields.Count & " 个栏目"
Print #intFH, "</body></html>"
Close #intFH
myGrid.Navigate App.Path & "\temp.htm"
Me.Caption = "共返回 " & myRS.RecordCount & " 条记录"
myRS.Close
Set myRS = Nothing
Exit Sub
QueryErr:
VBA.FileSystem.Reset
Set myRS = Nothing
MsgBox Err.Description, vbCritical, "系统错误"
On Error GoTo 0
End Sub
Private Sub cmdRefreshSQL_Click()
Dim TableNode As MSComctlLib.Node
Dim FieldNode As MSComctlLib.Node
Dim myNode As MSComctlLib.Node
Dim strSQL As String
Dim strTable As String
If tvwTable.Nodes.Count > 0 Then
For Each myNode In tvwTable.Nodes
If myNode.Checked = True And (Not myNode.Parent Is Nothing) Then
If strSQL = "" Then
strSQL = " " & myNode.Parent.Text & "." & myNode.Text
Else
strSQL = strSQL & " ," & vbCrLf & " " & myNode.Parent.Text & "." & myNode.Text
End If
If VBA.Strings.InStr(1, strTable, myNode.Parent.Text & ",") <= 0 Then
strTable = strTable & vbCrLf & myNode.Parent.Text & ","
End If
End If
Next
If strSQL <> "" Then
txtSQL.Text = "Select " & vbCrLf & strSQL & vbCrLf & " From " & VBA.Strings.Left(strTable, VBA.Strings.Len(strTable) - 1)
End If
End If
End Sub
Private Sub Form_Load()
myGrid.Navigate "about:blank"
bolDraging = False
picLeftRight.BorderStyle = 0
picUpDown.BorderStyle = 0
Set myConn = New ADODB.Connection
Set myRecordSet = New ADODB.Recordset
strConn = VBA.GetSetting(App.Title, Me.Name, "conn")
On Error GoTo LoadErr
If strConn <> "" Then
myConn.Open strConn
RefreshView
End If
Exit Sub
LoadErr:
MsgBox Err.Description, vbCritical, "系统错误"
On Error GoTo 0
End Sub
Private Sub RefreshView()
Dim strProvider As String
Dim strSQL As String
Dim strTableName As String
Dim TableNode As MSComctlLib.Node
Dim FieldNode As MSComctlLib.Node
Dim myRS As New ADODB.Recordset
On Error GoTo RefreshErr
strProvider = VBA.Strings.LCase(myConn.Provider)
tvwTable.Visible = False
tvwTable