<% ' Copyright (C) 1998-2005 Cyberstrong Internet Services, Inc. All Rights Reserved ' ' This file has been seeded with unique information at point of sale and ' is traceable to its purchaser. ' ' Your license agreement forbids the removal of this notice. ' ADOLIB.ASP '---- Additional DataTypeEnum Values ---- Const adChapter = 136 Const adPropVariant = 138 ' ' These field types won't be displayed ' and are not editable ' dim etCnt dim ExcludeTypes() etCnt = 0 Sub AddExcludeType ( nType ) etCnt = etCnt + 1 Redim Preserve ExcludeTypes(etCnt) ExcludeTypes(etCnt) = nType End Sub AddExcludeType adEmpty ' 0 AddExcludeType adError ' 10 AddExcludeType adUserDefined ' 132 AddExcludeType adVariant ' 12 AddExcludeType adIDispatch ' 9 AddExcludeType adIUnknown ' 13 AddExcludeType adBinary ' 128 AddExcludeType adVarBinary ' 204 AddExcludeType adLongVarBinary ' 205 AddExcludeType adChapter ' 136 AddExcludeType adPropVariant ' 138 ' GetTypeString() - Returns the Type of an ADODB.Field as string Public Function GetTypeString(iType) Dim sReturn Select Case iType Case adEmpty : sReturn = "Empty" Case adTinyInt : sReturn = "TinyInt" Case adSmallInt : sReturn = "SmallInt" Case adInteger : sReturn = "Integer" Case adBigInt : sReturn = "BigInt" Case adUnsignedTinyInt : sReturn = "UnsignedTinyInt" Case adUnsignedSmallInt : sReturn = "UnsignedSmallInt" Case adUnsignedInt : sReturn = "UnsignedInt" Case adUnsignedBigInt : sReturn = "UnsignedBigInt" Case adSingle : sReturn = "Single" Case adDouble : sReturn = "Double" Case adCurrency : sReturn = "Currency" Case adDecimal : sReturn = "Decimal" Case adNumeric : sReturn = "Numeric" Case adBoolean : sReturn = "Boolean" Case adError : sReturn = "Error" Case adUserDefined : sReturn = "UserDefined" Case adVariant : sReturn = "Variant" Case adIDispatch : sReturn = "IDispatch" Case adIUnknown : sReturn = "IUnknown" Case adGUID : sReturn = "GUID" Case adDBDate : sReturn = "DBDate" Case adDBTime : sReturn = "DBTime" Case adDBTimeStamp : sReturn = "DBTimeStamp" Case adBSTR : sReturn = "BSTR" Case adChar : sReturn = "Char" Case adVarChar : sReturn = "VarChar" Case adLongVarChar : sReturn = "LongVarChar" Case adWChar : sReturn = "WChar" Case adVarWChar : sReturn = "VarWChar" Case adLongVarWChar : sReturn = "LongVarWChar" Case adBinary : sReturn = "Binary" Case adVarBinary : sReturn = "VarBinary" Case adLongVarBinary : sReturn = "LongVarBinary" Case adChapter : sReturn = "Chapter" Case adPropVariant : sReturn = "PropVariant" Case Else : sReturn = "Unknown" End Select GetTypeString = sReturn End Function ' GetTypeStringSQL() - Ditto with SQL keywords ... function GetTypeStringSQL(argType) Dim sReturn Select Case argType Case adInteger : sReturn = "int" Case adDouble : sReturn = "float" Case adCurrency : sReturn = "money" Case adDBTimeStamp : sReturn = "datetime" Case adVarChar : sReturn = "nvarchar" Case adVarWChar : sReturn = "nvarchar" Case adLongVarChar : sReturn = "ntext" Case adLongVarWChar : sReturn = "ntext" Case Else : sReturn = "Unknown" End Select GetTypeStringSQL = sReturn End Function ' GetAttributesString() - Returns the Attributes of an ADODB.Field as string function GetAttributesString(nAttrib) dim sReturn sReturn = "" if (nAttrib and adFldMayDefer) then sReturn = sReturn & "MayDefer, " if (nAttrib and adFldUpdatable) then sReturn = sReturn & "Updatable, " if (nAttrib and adFldUnknownUpdatable) then sReturn = sReturn & "UnknownUpdatable, " if (nAttrib and adFldFixed) then sReturn = sReturn & "Fixed, " if (nAttrib and adFldIsNullable) then sReturn = sReturn & "IsNullable, " if (nAttrib and adFldMayBeNull) then sReturn = sReturn & "MayBeNull, " if (nAttrib and adFldLong) then sReturn = sReturn & "Long, " if (nAttrib and adFldRowID) then sReturn = sReturn & "RowID, " if (nAttrib and adFldRowVersion) then sReturn = sReturn & "RowVersion, " if (nAttrib and adFldCacheDeferred) then sReturn = sReturn & "CacheDeferred, " if sReturn <> "" then sReturn = Left(sReturn, Len(sReturn)-2) GetAttributesString = sReturn end function ' ' Checks, if a specified attribute is set ' function Attrib(nField, nAttrib) Attrib = (nField and nAttrib) end function ' ' Checks, if a specified attribute is not set ' function NotAttrib(nField, nAttrib) if Attrib(nField, nAttrib) then NotAttrib = false else NotAttrib = true end if end function ' ' Checks, if given Type is in Exclude List ' function IsExcluded( nType ) bReturn = false for ii = 1 to etCnt if nType = ExcludeTypes(ii) then bReturn = True next IsExcluded = bReturn end function %>