Function convertNullToBlankString(objObject)
	If (IsNull(objObject)) Then
		convertNullToBlankString = ""
	Else
		convertNullToBlankString = CStr(objObject)
	End If
End Function		
Function testEnvironment()
	Err.Clear()
	Dim objFSO, strSaveToFilePath, strTestFilePath, objADOStream, strStatus, strErrorMessage
	strErrorMessage = "Appendix uploads are currently not available. ("
	testEnvironment = ""
	strStatus = ""
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
	If (Not objFSO.FolderExists(strUploadRootDirectory)) Then
		If (testEnvironment = "") Then
			testEnvironment = strErrorMessage & "-1)"
			Exit Function
		End If
	Else
		If (Not objFSO.FolderExists(strUploadDirectory)) Then
			objFSO.CreateFolder(strUploadDirectory)
		End If
		strStatus = strStatus & "<br />Folder Exists"
	End If
	strSaveToFilePath = strUploadDirectory & "\test.txt"
	Set strTestFilePath = objFSO.CreateTextFile(strSaveToFilePath, true)
	If (Err.Number <> 0) Then
		If (testEnvironment = "") Then
			testEnvironment = strErrorMessage & "-2)"
			Exit Function
		End If
	Else
		strStatus = strStatus & "<br />Created File"
	End If
	strTestFilePath.Close
	objFSO.DeleteFile(strSaveToFilePath)
	If (Err.Number <> 0) Then
		If (testEnvironment = "") Then
			testEnvironment = strErrorMessage & "-3)"
			Exit Function
		End If
	Else
		strStatus = strStatus & "<br />Deleted File"
	End If
	Set objADOStream = Server.CreateObject("ADODB.Stream")
	If (Err.Number <> 0) Then
		If (testEnvironment = "") Then
			testEnvironment = strErrorMessage & "-4)"
			Exit Function
		End If
	Else
		strStatus = strStatus & "<br />Created ADODB.Stream"
	End If
	Set objADOStream = Nothing
	'testEnvironment = strStatus
End Function
Function sendEMail(strTo, strCC, strBCC, strFrom, strSubject, strBody, strSMTPServer, blHTML)
	Dim objMessage
	Dim objConfiguration
	Dim objFields
	Set objMessage = CreateObject("CDO.Message")
	Set objConfiguration = CreateObject("CDO.Configuration")
	Set objFields = objConfiguration.Fields
	With objFields
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
		.Update
	End With
	With objMessage
		Set objMessage.Configuration = objConfiguration
		If (strTo <> "") Then
			.To = strTo
		End If
		If (strCC <> "") Then
			.CC = strCC
		End If
		If (strBCC <> "") Then
			.BCC = strBCC
		End If
		If (strFrom <> "") Then
			.From = strFrom
		End If
		.Subject = strSubject
		If (blHTML) Then
			.HTMLBody = strBody
		Else
			.TextBody = strBody
		End If
		.Send
	End With
	Set objMessage = Nothing
	Set objConfiguration = Nothing
	Set objFields = Nothing
End Function
Function cleanValue(strValue)
	If isNull(strValue) Then
		strValue = ""
	End If
	strValue = Trim(strValue)
	strValue = Replace(strValue, "'", "''") 'Translate ' to ''
	strValue = Replace(strValue, "--", "-") 'Translate ' to ''
	strValue = Replace(strValue, vbCRLF, "<br />") 'Translate ' to ''
	cleanValue = strValue
End Function