<% '-------------------------------------------------------------------- ' Microsoft ADO ' ' Copyright (c) 1996-1998 Microsoft Corporation. ' ' ' ' ADO constants include file for VBScript ' '-------------------------------------------------------------------- '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 '---- CursorOptionEnum Values ---- Const adHoldRecords = &H00000100 Const adMovePrevious = &H00000200 Const adAddNew = &H01000400 Const adDelete = &H01000800 Const adUpdate = &H01008000 Const adBookmark = &H00002000 Const adApproxPosition = &H00004000 Const adUpdateBatch = &H00010000 Const adResync = &H00020000 Const adNotify = &H00040000 Const adFind = &H00080000 Const adSeek = &H00400000 Const adIndex = &H00800000 '---- LockTypeEnum Values ---- Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 '---- ExecuteOptionEnum Values ---- Const adAsyncExecute = &H00000010 Const adAsyncFetch = &H00000020 Const adAsyncFetchNonBlocking = &H00000040 Const adExecuteNoRecords = &H00000080 '---- ConnectOptionEnum Values ---- Const adAsyncConnect = &H00000010 '---- ObjectStateEnum Values ---- Const adStateClosed = &H00000000 Const adStateOpen = &H00000001 Const adStateConnecting = &H00000002 Const adStateExecuting = &H00000004 Const adStateFetching = &H00000008 '---- CursorLocationEnum Values ---- Const adUseServer = 2 Const adUseClient = 3 '---- DataTypeEnum Values ---- Const adEmpty = 0 Const adTinyInt = 16 Const adSmallInt = 2 Const adInteger = 3 Const adBigInt = 20 Const adUnsignedTinyInt = 17 Const adUnsignedSmallInt = 18 Const adUnsignedInt = 19 Const adUnsignedBigInt = 21 Const adSingle = 4 Const adDouble = 5 Const adCurrency = 6 Const adDecimal = 14 Const adNumeric = 131 Const adBoolean = 11 Const adError = 10 Const adUserDefined = 132 Const adVariant = 12 Const adIDispatch = 9 Const adIUnknown = 13 Const adGUID = 72 Const adDate = 7 Const adDBDate = 133 Const adDBTime = 134 Const adDBTimeStamp = 135 Const adBSTR = 8 Const adChar = 129 Const adVarChar = 200 Const adLongVarChar = 201 Const adWChar = 130 Const adVarWChar = 202 Const adLongVarWChar = 203 Const adBinary = 128 Const adVarBinary = 204 Const adLongVarBinary = 205 Const adChapter = 136 Const adFileTime = 64 Const adPropVariant = 138 Const adVarNumeric = 139 Const adArray = &H2000 '---- FieldAttributeEnum Values ---- Const adFldMayDefer = &H00000002 Const adFldUpdatable = &H00000004 Const adFldUnknownUpdatable = &H00000008 Const adFldFixed = &H00000010 Const adFldIsNullable = &H00000020 Const adFldMayBeNull = &H00000040 Const adFldLong = &H00000080 Const adFldRowID = &H00000100 Const adFldRowVersion = &H00000200 Const adFldCacheDeferred = &H00001000 Const adFldIsChapter = &H00002000 Const adFldNegativeScale = &H00004000 Const adFldKeyColumn = &H00008000 Const adFldIsRowURL = &H00010000 Const adFldIsDefaultStream = &H00020000 Const adFldIsCollection = &H00040000 '---- EditModeEnum Values ---- Const adEditNone = &H0000 Const adEditInProgress = &H0001 Const adEditAdd = &H0002 Const adEditDelete = &H0004 '---- RecordStatusEnum Values ---- Const adRecOK = &H0000000 Const adRecNew = &H0000001 Const adRecModified = &H0000002 Const adRecDeleted = &H0000004 Const adRecUnmodified = &H0000008 Const adRecInvalid = &H0000010 Const adRecMultipleChanges = &H0000040 Const adRecPendingChanges = &H0000080 Const adRecCanceled = &H0000100 Const adRecCantRelease = &H0000400 Const adRecConcurrencyViolation = &H0000800 Const adRecIntegrityViolation = &H0001000 Const adRecMaxChangesExceeded = &H0002000 Const adRecObjectOpen = &H0004000 Const adRecOutOfMemory = &H0008000 Const adRecPermissionDenied = &H0010000 Const adRecSchemaViolation = &H0020000 Const adRecDBDeleted = &H0040000 '---- GetRowsOptionEnum Values ---- Const adGetRowsRest = -1 '---- PositionEnum Values ---- Const adPosUnknown = -1 Const adPosBOF = -2 Const adPosEOF = -3 '---- BookmarkEnum Values ---- Const adBookmarkCurrent = 0 Const adBookmarkFirst = 1 Const adBookmarkLast = 2 '---- MarshalOptionsEnum Values ---- Const adMarshalAll = 0 Const adMarshalModifiedOnly = 1 '---- AffectEnum Values ---- Const adAffectCurrent = 1 Const adAffectGroup = 2 Const adAffectAllChapters = 4 '---- ResyncEnum Values ---- Const adResyncUnderlyingValues = 1 Const adResyncAllValues = 2 '---- CompareEnum Values ---- Const adCompareLessThan = 0 Const adCompareEqual = 1 Const adCompareGreaterThan = 2 Const adCompareNotEqual = 3 Const adCompareNotComparable = 4 '---- FilterGroupEnum Values ---- Const adFilterNone = 0 Const adFilterPendingRecords = 1 Const adFilterAffectedRecords = 2 Const adFilterFetchedRecords = 3 Const adFilterConflictingRecords = 5 '---- SearchDirectionEnum Values ---- Const adSearchForward = 1 Const adSearchBackward = -1 '---- PersistFormatEnum Values ---- Const adPersistADTG = 0 Const adPersistXML = 1 '---- StringFormatEnum Values ---- Const adClipString = 2 '---- ConnectPromptEnum Values ---- Const adPromptAlways = 1 Const adPromptComplete = 2 Const adPromptCompleteRequired = 3 Const adPromptNever = 4 '---- ConnectModeEnum Values ---- Const adModeUnknown = 0 Const adModeRead = 1 Const adModeWrite = 2 Const adModeReadWrite = 3 Const adModeShareDenyRead = 4 Const adModeShareDenyWrite = 8 Const adModeShareExclusive = &Hc Const adModeShareDenyNone = &H10 Const adModeRecursive = &H400000 '---- RecordCreateOptionsEnum Values ---- Const adCreateCollection = &H00002000 Const adCreateStructDoc = &H80000000 Const adCreateNonCollection = &H00000000 Const adOpenIfExists = &H02000000 Const adCreateOverwrite = &H04000000 Const adFailIfNotExists = -1 '---- RecordOpenOptionsEnum Values ---- Const adOpenRecordUnspecified = -1 Const adOpenSource = &H00800000 Const adOpenAsync = &H00001000 Const adDelayFetchStream = &H00004000 Const adDelayFetchFields = &H00008000 '---- IsolationLevelEnum Values ---- Const adXactUnspecified = &Hffffffff Const adXactChaos = &H00000010 Const adXactReadUncommitted = &H00000100 Const adXactBrowse = &H00000100 Const adXactCursorStability = &H00001000 Const adXactReadCommitted = &H00001000 Const adXactRepeatableRead = &H00010000 Const adXactSerializable = &H00100000 Const adXactIsolated = &H00100000 '---- XactAttributeEnum Values ---- Const adXactCommitRetaining = &H00020000 Const adXactAbortRetaining = &H00040000 '---- PropertyAttributesEnum Values ---- Const adPropNotSupported = &H0000 Const adPropRequired = &H0001 Const adPropOptional = &H0002 Const adPropRead = &H0200 Const adPropWrite = &H0400 '---- ErrorValueEnum Values ---- Const adErrProviderFailed = &Hbb8 Const adErrInvalidArgument = &Hbb9 Const adErrOpeningFile = &Hbba Const adErrReadFile = &Hbbb Const adErrWriteFile = &Hbbc Const adErrNoCurrentRecord = &Hbcd Const adErrIllegalOperation = &Hc93 Const adErrCantChangeProvider = &Hc94 Const adErrInTransaction = &Hcae Const adErrFeatureNotAvailable = &Hcb3 Const adErrItemNotFound = &Hcc1 Const adErrObjectInCollection = &Hd27 Const adErrObjectNotSet = &Hd5c Const adErrDataConversion = &Hd5d Const adErrObjectClosed = &He78 Const adErrObjectOpen = &He79 Const adErrProviderNotFound = &He7a Const adErrBoundToCommand = &He7b Const adErrInvalidParamInfo = &He7c Const adErrInvalidConnection = &He7d Const adErrNotReentrant = &He7e Const adErrStillExecuting = &He7f Const adErrOperationCancelled = &He80 Const adErrStillConnecting = &He81 Const adErrInvalidTransaction = &He82 Const adErrUnsafeOperation = &He84 Const adwrnSecurityDialog = &He85 Const adwrnSecurityDialogHeader = &He86 Const adErrIntegrityViolation = &He87 Const adErrPermissionDenied = &He88 Const adErrDataOverflow = &He89 Const adErrSchemaViolation = &He8a Const adErrSignMismatch = &He8b Const adErrCantConvertvalue = &He8c Const adErrCantCreate = &He8d Const adErrColumnNotOnThisRow = &He8e Const adErrURLIntegrViolSetColumns = &He8f Const adErrURLDoesNotExist = &He8f Const adErrTreePermissionDenied = &He90 Const adErrInvalidURL = &He91 Const adErrResourceLocked = &He92 Const adErrResourceExists = &He93 Const adErrCannotComplete = &He94 Const adErrVolumeNotFound = &He95 Const adErrOutOfSpace = &He96 Const adErrResourceOutOfScope = &He97 Const adErrUnavailable = &He98 Const adErrURLNamedRowDoesNotExist = &He99 Const adErrDelResOutOfScope = &He9a Const adErrPropInvalidColumn = &He9b Const adErrPropInvalidOption = &He9c Const adErrPropInvalidValue = &He9d Const adErrPropConflicting = &He9e Const adErrPropNotAllSettable = &He9f Const adErrPropNotSet = &Hea0 Const adErrPropNotSettable = &Hea1 Const adErrPropNotSupported = &Hea2 Const adErrCatalogNotSet = &Hea3 Const adErrCantChangeConnection = &Hea4 Const adErrFieldsUpdateFailed = &Hea5 Const adErrDenyNotSupported = &Hea6 Const adErrDenyTypeNotSupported = &Hea7 '---- ParameterAttributesEnum Values ---- Const adParamSigned = &H0010 Const adParamNullable = &H0040 Const adParamLong = &H0080 '---- ParameterDirectionEnum Values ---- Const adParamUnknown = &H0000 Const adParamInput = &H0001 Const adParamOutput = &H0002 Const adParamInputOutput = &H0003 Const adParamReturnValue = &H0004 '---- CommandTypeEnum Values ---- Const adCmdUnknown = &H0008 Const adCmdText = &H0001 Const adCmdTable = &H0002 Const adCmdStoredProc = &H0004 Const adCmdFile = &H0100 Const adCmdTableDirect = &H0200 '---- EventStatusEnum Values ---- Const adStatusOK = &H0000001 Const adStatusErrorsOccurred = &H0000002 Const adStatusCantDeny = &H0000003 Const adStatusCancel = &H0000004 Const adStatusUnwantedEvent = &H0000005 '---- EventReasonEnum Values ---- Const adRsnAddNew = 1 Const adRsnDelete = 2 Const adRsnUpdate = 3 Const adRsnUndoUpdate = 4 Const adRsnUndoAddNew = 5 Const adRsnUndoDelete = 6 Const adRsnRequery = 7 Const adRsnResynch = 8 Const adRsnClose = 9 Const adRsnMove = 10 Const adRsnFirstChange = 11 Const adRsnMoveFirst = 12 Const adRsnMoveNext = 13 Const adRsnMovePrevious = 14 Const adRsnMoveLast = 15 '---- SchemaEnum Values ---- Const adSchemaProviderSpecific = -1 Const adSchemaAsserts = 0 Const adSchemaCatalogs = 1 Const adSchemaCharacterSets = 2 Const adSchemaCollations = 3 Const adSchemaColumns = 4 Const adSchemaCheckConstraints = 5 Const adSchemaConstraintColumnUsage = 6 Const adSchemaConstraintTableUsage = 7 Const adSchemaKeyColumnUsage = 8 Const adSchemaReferentialConstraints = 9 Const adSchemaTableConstraints = 10 Const adSchemaColumnsDomainUsage = 11 Const adSchemaIndexes = 12 Const adSchemaColumnPrivileges = 13 Const adSchemaTablePrivileges = 14 Const adSchemaUsagePrivileges = 15 Const adSchemaProcedures = 16 Const adSchemaSchemata = 17 Const adSchemaSQLLanguages = 18 Const adSchemaStatistics = 19 Const adSchemaTables = 20 Const adSchemaTranslations = 21 Const adSchemaProviderTypes = 22 Const adSchemaViews = 23 Const adSchemaViewColumnUsage = 24 Const adSchemaViewTableUsage = 25 Const adSchemaProcedureParameters = 26 Const adSchemaForeignKeys = 27 Const adSchemaPrimaryKeys = 28 Const adSchemaProcedureColumns = 29 Const adSchemaDBInfoKeywords = 30 Const adSchemaDBInfoLiterals = 31 Const adSchemaCubes = 32 Const adSchemaDimensions = 33 Const adSchemaHierarchies = 34 Const adSchemaLevels = 35 Const adSchemaMeasures = 36 Const adSchemaProperties = 37 Const adSchemamemCompany = 38 Const adSchemaTrustees = 39 '---- FieldStatusEnum Values ---- Const adFieldOK = 0 Const adFieldCantConvertValue = 2 Const adFieldIsNull = 3 Const adFieldTruncated = 4 Const adFieldSignMismatch = 5 Const adFieldDataOverflow = 6 Const adFieldCantCreate = 7 Const adFieldUnavailable = 8 Const adFieldPermissionDenied = 9 Const adFieldIntegrityViolation = 10 Const adFieldSchemaViolation = 11 Const adFieldBadStatus = 12 Const adFieldDefault = 13 Const adFieldIgnore = 15 Const adFieldDoesNotExist = 16 Const adFieldInvalidURL = 17 Const adFieldResourceLocked = 18 Const adFieldResourceExists = 19 Const adFieldCannotComplete = 20 Const adFieldVolumeNotFound = 21 Const adFieldOutOfSpace = 22 Const adFieldCannotDeleteSource = 23 Const adFieldReadOnly = 24 Const adFieldResourceOutOfScope = 25 Const adFieldAlreadyExists = 26 Const adFieldPendingInsert = &H10000 Const adFieldPendingDelete = &H20000 Const adFieldPendingChange = &H40000 Const adFieldPendingUnknown = &H80000 Const adFieldPendingUnknownDelete = &H100000 '---- SeekEnum Values ---- Const adSeekFirstEQ = &H1 Const adSeekLastEQ = &H2 Const adSeekAfterEQ = &H4 Const adSeekAfter = &H8 Const adSeekBeforeEQ = &H10 Const adSeekBefore = &H20 '---- ADCPROP_UPDATECRITERIA_ENUM Values ---- Const adCriteriaKey = 0 Const adCriteriaAllCols = 1 Const adCriteriaUpdCols = 2 Const adCriteriaTimeStamp = 3 '---- ADCPROP_ASYNCTHREADPRIORITY_ENUM Values ---- Const adPriorityLowest = 1 Const adPriorityBelowNormal = 2 Const adPriorityNormal = 3 Const adPriorityAboveNormal = 4 Const adPriorityHighest = 5 '---- ADCPROP_AUTORECALC_ENUM Values ---- Const adRecalcUpFront = 0 Const adRecalcAlways = 1 '---- ADCPROP_UPDATERESYNC_ENUM Values ---- '---- ADCPROP_UPDATERESYNC_ENUM Values ---- '---- MoveRecordOptionsEnum Values ---- Const adMoveUnspecified = -1 Const adMoveOverWrite = 1 Const adMoveDontUpdateLinks = 2 Const adMoveAllowEmulation = 4 '---- CopyRecordOptionsEnum Values ---- Const adCopyUnspecified = -1 Const adCopyOverWrite = 1 Const adCopyAllowEmulation = 4 Const adCopyNonRecursive = 2 '---- StreamTypeEnum Values ---- Const adTypeBinary = 1 Const adTypeText = 2 '---- LineSeparatorEnum Values ---- Const adLF = 10 Const adCR = 13 Const adCRLF = -1 '---- StreamOpenOptionsEnum Values ---- Const adOpenStreamUnspecified = -1 Const adOpenStreamAsync = 1 Const adOpenStreamFromRecord = 4 '---- StreamWriteEnum Values ---- Const adWriteChar = 0 Const adWriteLine = 1 '---- SaveOptionsEnum Values ---- Const adSaveCreateNotExist = 1 Const adSaveCreateOverWrite = 2 '---- FieldEnum Values ---- Const adDefaultStream = -1 Const adRecordURL = -2 '---- StreamReadEnum Values ---- Const adReadAll = -1 Const adReadLine = -2 '---- RecordTypeEnum Values ---- Const adSimpleRecord = 0 Const adCollectionRecord = 1 Const adStructDoc = 2 %> <% Class cDatabase Private objConnection Private strDBServer, strDBUser, strDBPass, strDB Private Sub Class_Initialize strDBServer="mssql.saratogaweb.local" strDBUser="BJournDBuser" strDBPass="busjrndatabaccess" strDB="BJournal" Set objConnection = Server.CreateObject("ADODB.Connection") objConnection.Open "Driver={SQL Server};Server=" & strDBServer & ";Uid=" & strDBUser & ";Pwd=" & strDBPass & ";Database=" & strDB End Sub Private Sub Class_Terminate objConnection.Close Set objConnection = Nothing End Sub Public Function getCommand() Dim objCommand Set objCommand = Server.CreateObject("ADODB.Command") objCommand.ActiveConnection = objConnection Set getCommand = objCommand End Function Public Function getRSFromCmd(cmd) dim objRS set objRS=server.CreateObject("adodb.recordset") objRS.open cmd,,adOpenKeyset,adLockOptimistic set getRSFromCMD = objRS End Function Public Function getRS(sql) dim objRS set objRS=server.CreateObject("adodb.recordset") objRS.ActiveConnection = objConnection objRS.LockType = adLockOptimistic objRS.CursorType = adOpenKeyset objRS.open sql set getRS=objRS End Function Public Sub closeRS(rs) rs.close End Sub Public Sub killRS(rs) rs.close set rs=nothing end Sub End Class %> <% '----------------------------------------------------- ' CLASS: ' cStd ' ' This class contains a basic set of standard tools '----------------------------------------------------- Class cStd '------------------------------------------------------------ ' METHOD: ' getEncType() ' ' PURPOSE: ' This method gets the encoding type used for a form ' ' REQUIRES: ' Nothing ' ' PROMISES: ' To return the type of encoding '------------------------------------------------------------ Public Function getEncType() Dim strContentType strContentType = Request.ServerVariables("HTTP_CONTENT_TYPE") Dim arrContentType arrContentType = Split(strContentType, ";") Dim strEncType If (UBound(arrContentType) > 0) Then strEncType = Trim(arrContentType(0)) Else strEncType = "" End If getEncType = strEncType End Function '------------------------------------------------------------ ' METHOD: ' formatDate() ' ' PURPOSE: ' This method formats a date from a Date or DateTime value ' ' REQUIRES: ' A date value or NULL ' ' PROMISES: ' To return a properly formatted date ' or an empty string if the value is NULL '------------------------------------------------------------ Public Function formatDate(strDate) If IsNull(strDate) Then strDate = "" Else On Error Resume Next strDate = FormatDateTime(strDate, vbShortDate) If Err.Number <> 0 Then strDate = "" End If On Error GoTo 0 End If formatDate = strDate End Function '------------------------------------------------------------ ' METHOD: ' formatTime() ' ' PURPOSE: ' This method formats a time from a Time or DateTime value ' ' REQUIRES: ' A time value or NULL ' ' PROMISES: ' To return a properly formatted time ' or an empty string if the value is NULL '------------------------------------------------------------ Public Function formatTime(strTime) If IsNull(strTime) Then strTime = "" Else On Error Resume Next strTime = FormatDateTime(strTime, vbLongTime) If Err.Number <> 0 Then strTime = "" End If On Error GoTo 0 End If If strTime <> "" Then Dim objRegExp Set objRegExp = New RegExp With objRegExp .Pattern = ":\d\d " strTime = .Replace(strTime, " ") End With Set objRegExp = Nothing End If formatTime = strTime End Function Public Sub loginRedirect(strMsg,strFrm) response.redirect("login.asp?message=" & server.URLEncode(strMsg) & "&from=" & server.URLEncode(strFrm)) End Sub Public Function currentPage() currentPage=mid(request.ServerVariables("PATH_INFO"),instrrev(request.ServerVariables("PATH_INFO"),"/")+1) End Function '------------------------------------------------------------ ' PURPOSE: ' This function strips html tags out of a string ' ' REQUIRES: ' A string '------------------------------------------------------------ Public Function stripHTMLtags(HTMLstring) Set RegularExpressionObject = New RegExp With RegularExpressionObject .Pattern = "<[^>]+>" .IgnoreCase = True .Global = True End With stripHTMLtags = RegularExpressionObject.Replace(HTMLstring, "") Set RegularExpressionObject = nothing End Function '------------------------------------------------------------ ' PURPOSE: ' This function strips html tags out of a string, but replaces closing html tags with
' ' REQUIRES: ' A string '------------------------------------------------------------ Public Function stripHTMLtagsWithBr(HTMLstring) Set RegularExpressionObject = New RegExp With RegularExpressionObject .Pattern = "|
" .IgnoreCase = True .Global = True End With HTMLstring = RegularExpressionObject.Replace(HTMLstring, "{br}") With RegularExpressionObject .Pattern = "<[^>]+>" .IgnoreCase = True .Global = True End With HTMLstring = RegularExpressionObject.Replace(HTMLstring, "") Set RegularExpressionObject = nothing stripHTMLtagsWithBr = replace(HTMLstring, "{br}", "
") End Function End Class %> <% Class cEmail Private objCDO Private strSendUsing, strSMTPServer, strSMTPServerPort Private Sub Class_Initialize set objCDO=server.CreateObject("cdo.message") strSendUsing="http://schemas.microsoft.com/cdo/configuration/sendusing" strSMTPServer="http://schemas.microsoft.com/cdo/configuration/smtpserver" strSMTPServerPort="http://schemas.microsoft.com/cdo/configuration/smtpserverport" objCDO.configuration.fields.item(strSendUsing)=2 objCDO.configuration.fields.item(strSMTPServer)="localhost" objCDO.configuration.fields.item(strSMTPServerPort)="25" objCDO.configuration.fields.update End Sub Private Sub Class_Terminate set objCDO=nothing End Sub Property Let HTMLBody(strIn) objCDO.HTMLBody=strIn End Property Property Get HTMLBody HTMLBody=objCDO.HTMLBody End Property Property Let TextBody(strIn) objCDO.TextBody=strIn End Property Property Get TextBody TextBody=objCDO.TextBody End Property Property Let ToEmail(strIn) objCDO.To=strIn End Property Property Let FromEmail(strIn) objCDO.From=strIn End Property Property Let Subject(strIn) objCDO.Subject=strIn End Property Public Sub Send objCDO.Send End Sub End Class %> <% Class cNews Public nID, nDate, nHeadline, nAuthor, nContent, nActive Public objDatabase Private objRS Private Sub Class_Initialize nID=0 nDate="" nHeadline="" nAuthor="" nContent="" nActive=True End Sub Private Sub Class_Terminate set objRS=nothing End Sub Public Function Add() if nDate="" or nHeadline="" or nContent="" then Add=False exit function end if set objRS=objDatabase.getRS("tblNews") objRS.AddNew objRS("nDate")=nDate objRS("nHeadline")=nHeadline objRS("nAuthor")=nAuthor objRS("nContent")=nContent objRS("nActive")=cint(nActive) objRS.Update set objRS=nothing getArticle Add=True End Function Public Function Delete() if nID=0 or not isNumeric(nID) then Delete=False exit function end if set objRS=objDatabase.getRS("tblNews") objRS.filter="nID=" & nID objRS.delete objRS.update set objRS=nothing Delete=True End Function Public Function Update() if nID=0 or not isNumeric(nID) then Update=False exit function end if set objRS=objDatabase.getRS("tblNews") objRS.filter="nID=" & nID objRS("nDate")=nDate objRS("nHeadline")=nHeadline objRS("nAuthor")=nAuthor objRS("nContent")=nContent objRS("nActive")=cint(nActive) objRS.update set objRS=nothing Update=True End Function Public Function addFromForm() getFromForm addFromForm=Add() End Function Public Function updateFromForm() getFromForm updateFromForm=Update() End Function Private Sub getFromForm() nID=cint(Trim(Request.Form("txtID"))) nDate=Trim(Request.Form("txtDate")) nHeadline=Trim(Request.Form("txtHeadline")) nAuthor=Trim(Request.Form("txtAuthor")) nContent=Trim(Request.Form("txtContent")) nActive=Trim(Request.Form("chkActive")) nActive=(nActive<>"") End Sub Public Sub getArticle() if (nID=0 or not isNumeric(nID)) and (nDate="" and nHeadline="") then exit sub set objRS=objDatabase.getRS("tblNews") if nID > 0 and isNumeric(nID) then objRS.filter="nID=" & nID nDate=objRS("nDate") nHeadline=objRS("nHeadline") nAuthor=objRS("nAuthor") nContent=objRS("nContent") nActive=objRS("nActive") else objRS.filter="nDate=#" & nDate & "# and nHeadline='" & replace(nHeadline, "'", "''") & "' and nContent='" & replace(nContent, "'", "''") & "'" nID=objRS("nID") end if set objRS=nothing End Sub Public Function getArticles(strTop, strFilter, strSort) dim strSQL, strOrderBy, strDBtable, strDisplayAmount strSQL="select" strDBtable=" * from tblNews " if strTop <> "" then strDisplayAmount =" top " & strTop strSQL=strSQL & strDisplayAmount & strDBtable else strSQL=strSQL & strDBtable end if if strSort <> "" then strOrderBy=" order by " & strSort end if if strFilter="*" or strFilter="" then strSQL=strSQL & strOrderBy else strSQL=strSQL & "where " & strFilter & " " & strOrderBy end if set getArticles=objDatabase.getRS(strSQL) End Function Public Function short12hrTime(rTime) DIM myTime DIM myAMPM, myHour, myColon, myMinute 'get AM or PM from the time myAMPM = Right(rTime,2) 'get Hour and Minute myColon = instr(1, rTime, ":",vbBinaryCompare) IF myColon = 2 THEN myHour = Left(rTime,1) myMinute = Mid(rTime, 3, 2) ELSE myHour = Left(rTime,2) myMinute = Mid(rTime, 4, 2) END IF 'concatenate the time myTime = myHour & ":" & myMinute & " " & myAMPM 'concatenate variables short12hrTime = myTime End Function Public Function getArchiveYears() dim strSQL strSQL="select year(ndate) as nYear from tblnews group by year(ndate) order by year(ndate) desc" set getArchiveYears=objDatabase.getRS(strSQL) End Function End Class %> <% Class cArticles Public aID, aDate, aHeadline, aAuthor, aContent, aActive Public objDatabase Private objRS Private Sub Class_Initialize aID=0 aDate="" aHeadline="" aAuthor="" aContent="" aActive=True End Sub Private Sub Class_Terminate set objRS=nothing End Sub Public Function Add() if aDate="" or aHeadline="" or aContent="" then Add=False exit function end if set objRS=objDatabase.getRS("tblArticles") objRS.AddNew objRS("aDate")=aDate objRS("aHeadline")=aHeadline objRS("aAuthor")=aAuthor objRS("aContent")=aContent objRS("aActive")=cint(aActive) objRS.Update set objRS=nothing getArticle Add=True End Function Public Function Delete() if aID=0 or not isNumeric(aID) then Delete=False exit function end if set objRS=objDatabase.getRS("tblArticles") objRS.filter="aID=" & aID objRS.delete objRS.update set objRS=nothing Delete=True End Function Public Function Update() if aID=0 or not isNumeric(aID) then Update=False exit function end if set objRS=objDatabase.getRS("tblArticles") objRS.filter="aID=" & aID objRS("aDate")=aDate objRS("aHeadline")=aHeadline objRS("aAuthor")=aAuthor objRS("aContent")=aContent objRS("aActive")=cint(aActive) objRS.update set objRS=nothing Update=True End Function Public Function addFromForm() getFromForm addFromForm=Add() End Function Public Function updateFromForm() getFromForm updateFromForm=Update() End Function Private Sub getFromForm() aID=cint(Trim(Request.Form("txtID"))) aDate=Trim(Request.Form("txtDate")) aHeadline=Trim(Request.Form("txtHeadline")) aAuthor=Trim(Request.Form("txtAuthor")) aContent=Trim(Request.Form("txtContent")) aActive=Trim(Request.Form("chkActive")) aActive=(aActive<>"") End Sub Public Sub getArticle() if (aID=0 or not isNumeric(aID)) and (aDate="" and aHeadline="") then exit sub set objRS=objDatabase.getRS("tblArticles") if aID > 0 and isNumeric(aID) then objRS.filter="aID=" & aID aDate=objRS("aDate") aHeadline=objRS("aHeadline") aAuthor=objRS("aAuthor") aContent=objRS("aContent") aActive=objRS("aActive") else objRS.filter="aDate=#" & aDate & "# and aHeadline='" & replace(aHeadline, "'", "''") & "' and aContent='" & replace(aContent, "'", "''") & "'" aID=objRS("aID") end if set objRS=nothing End Sub Public Function getArticles(strTop, strFilter, strSort) dim strSQL, strOrderBy, strDBtable, strDisplayAmount strSQL="select" strDBtable=" * from tblArticles " if strTop <> "" then strDisplayAmount =" top " & strTop strSQL=strSQL & strDisplayAmount & strDBtable else strSQL=strSQL & strDBtable end if if strSort <> "" then strOrderBy=" order by " & strSort end if if strFilter="*" or strFilter="" then strSQL=strSQL & strOrderBy else strSQL=strSQL & "where " & strFilter & " " & strOrderBy end if set getArticles=objDatabase.getRS(strSQL) End Function Public Function short12hrTime(rTime) DIM myTime DIM myAMPM, myHour, myColon, myMinute 'get AM or PM from the time myAMPM = Right(rTime,2) 'get Hour and Minute myColon = instr(1, rTime, ":",vbBinaryCompare) IF myColon = 2 THEN myHour = Left(rTime,1) myMinute = Mid(rTime, 3, 2) ELSE myHour = Left(rTime,2) myMinute = Mid(rTime, 4, 2) END IF 'concatenate the time myTime = myHour & ":" & myMinute & " " & myAMPM 'concatenate variables short12hrTime = myTime End Function Public Function getArchiveYears() dim strSQL strSQL="select year(aDate) as aYear, month(aDate) as aMonth from tblArticles group by year(aDate), month(aDate) order by year(aDate) desc, month(aDate) desc" set getArchiveYears=objDatabase.getRS(strSQL) End Function End Class %> <% Class cCoverStory Public csID, csDate, csHeadline, csAuthor, csContent, csActive Public objDatabase Public objUpload Private objRS Private Sub Class_Initialize csID=0 csDate="" csHeadline="" csAuthor="" csContent="" csActive=True End Sub Private Sub Class_Terminate set objRS=nothing End Sub Public Function Add() if csDate="" then Add=False exit function end if set objRS=objDatabase.getRS("tblCoverStory") objRS.AddNew objRS("csDate")=csDate objRS("csHeadline")=csHeadline objRS("csAuthor")=csAuthor objRS("csContent")=csContent objRS("csActive")=cint(csActive) objRS.Update getStory SaveImage set objRS=nothing Add=True End Function Public Function Delete() if csID=0 or not isNumeric(csID) then Delete=False exit function end if set objRS=objDatabase.getRS("tblCoverStory") objRS.filter="csID=" & csID objRS.delete objRS.update set objRS=nothing Dim strImageURL strImageURL = getImageURL(csID) If strImageURL <> "" Then dim objFSO set objFSO=server.CreateObject("scripting.filesystemobject") objFSO.DeleteFile server.MapPath("/images/database/coverStory/" & csID & ".jpg") set objFSO=nothing End If Delete=True End Function Public Function Update() if csID=0 or not isNumeric(csID) then Update=False exit function end if set objRS=objDatabase.getRS("tblCoverStory") objRS.filter="csID=" & csID objRS("csDate")=csDate objRS("csHeadline")=csHeadline objRS("csAuthor")=csAuthor objRS("csContent")=csContent objRS("csActive")=cint(csActive) objRS.update set objRS=nothing SaveImage Update=True End Function Public Function addFromForm() getFromForm addFromForm=Add() End Function Public Function updateFromForm() getFromForm updateFromForm=Update() End Function Private Sub getFromForm() csID=cint(Trim(objUpload.Form("txtID"))) csDate=Trim(objUpload.Form("txtDate")) csHeadline=Trim(objUpload.Form("txtHeadline")) csAuthor=Trim(objUpload.Form("txtAuthor")) csContent=Trim(objUpload.Form("txtContent")) csActive=Trim(objUpload.Form("chkActive")) csActive=(csActive<>"") End Sub Public Sub getStory() if (csID=0 or not isNumeric(csID)) and (csDate="") then exit sub set objRS=objDatabase.getRS("tblCoverStory") if csID > 0 and isNumeric(csID) then objRS.filter="csID=" & csID csDate=objRS("csDate") csHeadline=objRS("csHeadline") csAuthor=objRS("csAuthor") csContent=objRS("csContent") csActive=objRS("csActive") else objRS.filter="csDate='" & replace(csDate, "'", "''") & "' and csHeadline='" & replace(csHeadline, "'", "''") & "'" csID=objRS("csID") end if set objRS=nothing End Sub Public Function getStories(strTop, strFilter, strSort) dim strSQL, strOrderBy, strDBtable, strDisplayAmount strSQL="select" strDBtable=" * from tblCoverStory " if strTop <> "" then strDisplayAmount =" top " & strTop strSQL=strSQL & strDisplayAmount & strDBtable else strSQL=strSQL & strDBtable end if if strSort <> "" then strOrderBy=" order by " & strSort end if if strFilter="*" or strFilter="" then strSQL=strSQL & strOrderBy else strSQL=strSQL & "where " & strFilter & " " & strOrderBy end if set getStories=objDatabase.getRS(strSQL) End Function Private Sub SaveImage() If (objUpload.Files.Count > 0) Then Dim objJPEG Set objJPEG = Server.CreateObject("Persits.Jpeg") Dim ImageWidth, ImageHeight ImageWidth = 364 Dim strImageFilename strImageFilename = Server.MapPath("/") & "\images\database\coverStory\" & csID & ".jpg" objJPEG.OpenBinary(objUpload.Files(1).Binary) objJPEG.PreserveAspectRatio = True If objJPEG.OriginalWidth > ImageWidth Then objJPEG.Width = ImageWidth End If objJPEG.ToRGB 'objJPEG.Sharpen 1,105 objJPEG.Interpolation = 1 objJPEG.Quality = 100 objJPEG.Save strImageFilename Set objJPEG = Nothing End If End Sub Public Function getImageURL(csID) Dim strImageURL strImageURL = "" If IsNumeric(csID) And csID > 0 Then Dim strImageFilename strImageFilename = Server.MapPath("/") & "\images\database\coverStory\" & csID & ".jpg" Dim objFileSystemObject Set objFileSystemObject = Server.CreateObject("Scripting.FileSystemObject") If objFileSystemObject.FileExists(strImageFilename) Then strImageURL = "/images/database/coverStory/" & csID & ".jpg" End If Set objFileSystemObject = Nothing End If getImageURL = strImageURL End Function End Class %> <% Class cPages Public pID, pTitle, pContent Public objDatabase Private objRS Private Sub Class_Initialize pID=0 pTitle="" pContent="" End Sub Private Sub Class_Terminate set objRS=nothing End Sub Public Function Add() if pTitle="" or pContent="" then Add=False exit function end if set objRS=objDatabase.getRS("tblPages") objRS.AddNew objRS("pTitle")=pTitle objRS("pContent")=pContent objRS.Update set objRS=nothing getPage Add=True End Function Public Function Delete() if pID=0 or not isNumeric(pID) then Delete=False exit function end if set objRS=objDatabase.getRS("tblPages") objRS.filter="pID=" & pID objRS.delete objRS.update set objRS=nothing Delete=True End Function Public Function Update() if pID=0 or not isNumeric(pID) then Update=False exit function end if set objRS=objDatabase.getRS("tblPages") objRS.filter="pID=" & pID objRS("pTitle")=pTitle objRS("pContent")=pContent objRS.update set objRS=nothing Update=True End Function Public Function addFromForm() getFromForm addFromForm=Add() End Function Public Function updateFromForm() getFromForm updateFromForm=Update() End Function Private Sub getFromForm() pID=cint(Trim(Request.Form("txtID"))) pTitle=Trim(Request.Form("txtTitle")) pContent=Trim(Request.Form("txtContent")) End Sub Public Sub getPage() if (pID=0 or not isNumeric(pID)) and (pContent="" and pTitle="") then exit sub set objRS=objDatabase.getRS("tblPages") if pID > 0 and isNumeric(pID) then objRS.filter="pID=" & pID pTitle=objRS("pTitle") pContent=objRS("pContent") else objRS.filter="pTitle='" & replace(pTitle, "'", "''") & "' and pContent='" & replace(pContent, "'", "''") & "'" pID=objRS("pID") end if set objRS=nothing End Sub Public Function getPages(strTop, strFilter, strSort) dim strSQL, strOrderBy, strDBtable, strDisplayAmount strSQL="select" strDBtable=" * from tblPages " if strTop <> "" then strDisplayAmount =" top " & strTop strSQL=strSQL & strDisplayAmount & strDBtable else strSQL=strSQL & strDBtable end if if strSort <> "" then strOrderBy=" order by " & strSort end if if strFilter="*" or strFilter="" then strSQL=strSQL & strOrderBy else strSQL=strSQL & "where " & strFilter & " " & strOrderBy end if set getPages=objDatabase.getRS(strSQL) End Function End Class %>

Privacy Policy

Visit www.bjournal.com to access company, products, and services information, along with news and event updates, without telling us who you are or revealing any personal information. The only data we collect and store during normal website usage is typical web server log data. Examples of this type of data are: the name of your Internet service provider, the site that referred you to us, any pages you request, and the time and date of those requests etc. We use this information to generate statistics and measure site activity to benefit www.bjournal.com users. This same information may be shared with third parties in order to provide these services or to analyze, store, or aggregate the information. It may also be shared with other third parties, working with us to improve the services of The Business Journal of Tri-Cities TN/VA or this website.

There are instances where The Business Journal of Tri-Cities TN/VA requests personally identifiable information to provide site visitors with a service. This information, such as name, mailing address, email address, and type of request, is collected and stored in a manner appropriate to the nature of the request, as determined by The Business Journal of Tri-Cities TN/VA, to fulfill your needs. To reiterate, all information you provide is used to improve the services offered by The Business Journal of Tri-Cities TN/VA. This information may also be provided to our agencies for use on behalf of The Business Journal of Tri-Cities TN/VA in accordance with our proscribed privacy statement. However, it is never provided or sold to any other company for that company's independent use. During the course of your visit, you may move to other The Business Journal websites. In addition, this site may provide links to third party sites not controlled by The Business Journal of Tri-Cities TN/VA, such as those belonging to our many vendors or clients. It is recommended that you check the specific privacy statements of any site before providing any personally identifiable information.

A "cookie" is a small line of text that is stored within your browser when you visit a cookie-enabled website. As you browse the Web, cookie-enabled sites will send cookies to your browser, along with pages. Your browser probably has options that will let you control whether the browser accepts cookies, rejects cookies, or notifies you each time a cookie is sent to you. If your browser is set to reject cookies, cookie-enabled websites will not recognize you when you return. This provides you with anonymity, but it also makes it very difficult to offer you customized services. It is also less secure than using cookies, because all of your specific data must be sent to the website each time you view a page. Accepting cookies means your private data can stay at the Web server, and the only information transmitted over the Internet is your ID cookie. If your browser is set to accept cookies, any cookies that are sent to your browser are stored in your computer for a period of time. There are a few different types of cookies. A "session" cookie is stored only in your computer's working memory (RAM) and only lasts for your browsing session. When you close all of your browser's windows, or when you shut down your computer, the session cookie disappears forever. A "permanent" cookie is stored on your computer's hard drive until a specified date, which could be tomorrow, next week, or 10 years from now. Permanent cookies stay on your computer until either: a) they expire, b) they are overwritten with newer cookies, c) you manually remove them.

To use our Internet services, such as ROI tools or Contact Form, we also require a certain amount of personally identifying information. That information may be in the form of a name, account number, zip code, or personal identification number. We use this information to verify that you are a The Business Journal of Tri-Cities TN/VA customer or meet the criteria required to process your request. We may also use this information to enhance our understanding of you and improve our services.

Website users may decide to send The Business Journal of Tri-Cities TN/VA personally identifying information via email. We will use this information for the purpose identified in the email message and to enhance our understanding of you in order to improve our services to you. A revised privacy statement will only apply to data collected subsequent to its effective date on this version of the website. Any revisions will be posted at least 7 days prior to its effective date. New versions of this website may have a new privacy statement effective with its launch. This site is provided by The Business Journal of Tri-Cities TN/VA and may be used for informational purposes only. By using this site or downloading materials from this site, you agree to abide by the terms and conditions, set forth in this agreement. If you do not agree to abide by these terms and conditions, do not use this site or download materials from this site. Subject to your continued compliance with the terms and conditions set forth in this agreement, The Business Journal grants you a non-exclusive, non-transferable, limited right to access, use, display, and listen to this site and the information, images, sounds, and text ("materials") thereon. You agree not to interrupt or attempt to interrupt the operation of the site in any way.

The Business Journal authorizes you to view and download the materials at this site only for your personal, non-commercial use. This authorization is not a transfer of title in the materials and copies of the materials and is subject to the following restrictions: 1) you must retain, on all copies of the materials downloaded, all copyright and other proprietary notices contained in the materials; 2) you may not modify the materials in any way or reproduce or publicly display, perform, distribute, or otherwise use them for any public or commercial purpose; 3) you must not transfer the materials to any other person unless you give them notice of, and they agree to accept, the obligations arising under these terms and conditions of use. This site, including all materials, is protected by worldwide copyright laws and treaty provisions, whether or not a copyright notice is present on the materials. You agree to comply with all copyright laws worldwide in your use of this site and to prevent any unauthorized copying of the materials. Except as expressly provided herein, The Business Journal of Tri-Cities TN/VA does not grant any express or implied right to you under any patents, trademarks, or copyrights.