📄 导入导出提示.frm
字号:
VERSION 5.00
Object = "{9ADF72AD-DDA9-11D1-9D4B-000021006D51}#1.2#0"; "UFSpGrid.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frmExportInfo
BorderStyle = 1 'Fixed Single
Caption = "提示信息"
ClientHeight = 3930
ClientLeft = 4665
ClientTop = 2565
ClientWidth = 5715
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3930
ScaleWidth = 5715
Begin MSComDlg.CommonDialog comFile
Left = 1560
Top = 3360
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Height = 375
Left = 3840
TabIndex = 1
Top = 3480
Width = 1095
End
Begin VB.CommandButton cmdClose
Caption = "关闭"
Height = 375
Left = 600
TabIndex = 0
Top = 3480
Width = 1095
End
Begin VB.TextBox txtInfo
Enabled = 0 'False
Height = 3375
Left = 0
MultiLine = -1 'True
TabIndex = 4
Top = 0
Visible = 0 'False
Width = 5775
End
Begin MsSuperGrid.SuperGrid ocxGrid
Height = 3375
Left = 0
TabIndex = 2
Top = 0
Width = 5775
_ExtentX = 10186
_ExtentY = 5953
ReadOnly = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
EditBorderStyle = 0
MouseIcon = "导入导出提示.frx":0000
ForeColorSel = -2147483634
ForeColorFixed = -2147483630
FixedCols = 0
Cols = 3
BackColorSel = -2147483635
BackColorFixed = -2147483633
AllowUserResizing= 1
AllowBigSelection= 0 'False
End
Begin VB.Label Label2
Caption = "0代表成功"
Height = 255
Left = 0
TabIndex = 3
Top = 0
Width = 855
End
End
Attribute VB_Name = "frmExportInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_objDoc As New DOMDocument
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
Dim fso, txtfile
If txtInfo.Text = "" And m_objDoc.xml = "" Then
iShowMsg "没有可保存的内容!"
Exit Sub
End If
comFile.Filename = ""
comFile.Flags = cdlOFNOverwritePrompt Or cdlOFNPathMustExist Or cdlOFNLongNames Or cdlOFNExtensionDifferent Or cdlOFNHideReadOnly
comFile.Filter = "Xml Files(*.xml)|*.xml"
comFile.ShowSave
If comFile.Filename = "" Then
Exit Sub
End If
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtfile = fso.CreateTextFile(comFile.Filename, True)
If txtInfo.Visible Then
txtfile.WriteLine (txtInfo.Text)
Else
If InStr(1, m_objDoc.xml, "<?xml") = 0 Then
txtfile.WriteLine "<?xml version='1.0' encoding='gb2312'?>"
End If
txtfile.WriteLine (m_objDoc.xml)
End If
txtfile.Close
' m_objDoc.save cdFile.Filename
cmdClose_Click
End Sub
Public Sub SetInfo(str As String)
Me.Icon = LoadResPicture(109, vbResIcon)
If bCheckFormat(str) Then
txtInfo.Visible = False
ocxGrid.Visible = True
InitTable
Dom2Table
Else
txtInfo.Visible = True
ocxGrid.Visible = False
txtInfo.Text = str
End If
End Sub
Private Sub Dom2Table()
Dim root As IXMLDOMElement
Dim Node As IXMLDOMNode
Dim i As Integer
Dim tmp
Dim con As ADODB.Connection
On Error GoTo last
Set root = m_objDoc.documentElement.firstChild
Set con = m_objAid.objOpenDB(zjLogInfo.UfDbName)
i = 1
ocxGrid.Rows = root.childNodes.length + 1
'设置标题
For Each Node In root.childNodes
If Node.nodeType = NODE_ELEMENT Then
tmp = m_objAid.GetAttributeVal("succ", Node)
If tmp = "1" Then
tmp = "一般错误"
ElseIf tmp = "-1" Then
tmp = "全局错误"
Else
tmp = "成 功"
End If
ocxGrid.TextMatrix(i, 0) = tmp
tmp = m_objAid.vInRecord("select transactions_code from fd_transactions where transactions_id='" & m_objAid.GetAttributeVal("id", Node) & "'", con)
If Not IsNull(tmp) Then
ocxGrid.TextMatrix(i, 1) = tmp
End If
ocxGrid.TextMatrix(i, 2) = m_objAid.GetAttributeVal("desc", Node)
i = i + 1
End If
Next
Set con = Nothing
Exit Sub
last:
Err.clear
End Sub
Private Sub InitTable()
ocxGrid.TextMatrix(0, 0) = "成功标志"
ocxGrid.TextMatrix(0, 1) = "业务编号"
ocxGrid.TextMatrix(0, 2) = "错误信息"
ocxGrid.colwidth(0) = 1000
ocxGrid.colwidth(1) = 1500
ocxGrid.colwidth(2) = 5000
ocxGrid.ColAlignment(0) = 1
ocxGrid.ColAlignment(1) = 1
ocxGrid.ColAlignment(2) = 1
End Sub
Private Function bCheckFormat(str As String) As Boolean
Dim root As IXMLDOMElement
bCheckFormat = False
If Not m_objDoc.loadXML(str) Then
Exit Function
End If
Set root = m_objAid.objSelectRootTag(m_objDoc)
If root Is Nothing Then
Exit Function
End If
Set root = root.firstChild
If Not root Is Nothing Then
If m_objAid.GetAttributeVal("succ", root) = "" Then
Exit Function
End If
End If
bCheckFormat = True
End Function
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 Then
SendKeys "{F1}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -