📄 cdataconverter.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CDataConverter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
' DataMonkey Data Conversion Application. Written by Theodore L. Ward
' Copyright (C) 2002 AstroComma Incorporated.
'
' This program is free software; you can redistribute it and/or
' modify it under the terms of the GNU General Public License
' as published by the Free Software Foundation; either version 2
' of the License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
' The author may be contacted at:
' TheodoreWard@Hotmail.com or TheodoreWard@Yahoo.com
Option Explicit
Dim mDataConverter As CCmdConvertData
Dim mLastValueConverted As Variant
Dim mLastTable As Integer
Dim mLastField As String
Dim mLastValue As Variant
Dim mLastCnvToType As Integer
Dim mLastCnvFromType As Integer
Public Sub GetErrorLogInfo(Tbl As String, fld As String, _
val As Variant, cnvTo As String, _
cnvFrom As String)
If mLastTable >= 0 Then
Tbl = GImport.GetOutputObject.GetTableName(mLastTable)
Else
Tbl = ""
End If
fld = mLastField
val = mLastValue
cnvTo = GetTypeDescription(mLastCnvToType)
cnvFrom = GetTypeDescription(mLastCnvFromType)
End Sub
Private Function GetTypeDescription(descType As Integer) As String
Dim rsType As rdtReducedDataTypeSet
' Convert the data type to the reduced set data type.
rsType = GOutputID.ConvertDBTypeToRST(descType)
' Get a description of what this type represents.
GetTypeDescription = GOutputID.GetRSTDescription(rsType)
End Function
Public Property Let ConvertToType(newType As Integer)
mDataConverter.ConvertToType = newType
End Property
Public Property Get ConvertToType() As Integer
ConvertToType = mDataConverter.ConvertToType
End Property
Public Property Let ConvertFromType(newType As Integer)
mDataConverter.ConvertFromType = newType
End Property
Public Property Get ConvertFromType() As Integer
ConvertFromType = mDataConverter.ConvertFromType()
End Property
Public Function Execute(hTable As Integer, Field As String, ByRef value As Variant, Optional ByVal CnvType As Integer = -1) As Boolean
mLastTable = hTable
mLastField = Field
mLastValue = value
mLastCnvToType = CnvType
mLastCnvFromType = mDataConverter.ConvertFromType
Execute = mDataConverter.Execute(value, CnvType)
End Function
Private Sub Class_Initialize()
mLastValueConverted = ""
mLastTable = -1
mLastField = ""
mLastValue = ""
mLastCnvToType = -1
mLastCnvFromType = -1
Set mDataConverter = New CCmdConvertData
End Sub
Private Sub Class_Terminate()
Set mDataConverter = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -