% 'This if the main datbase connection information 'Dim Conn dbPath=Server.mappath("access_db/kstrat.mdb") Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath 'This procedure sends an email to confirm the person sub sendemail(sendto,sendfrom,cc,bcc,subj,text) strto=sendto strFrom=sendfrom strSubject=subj strBody=text strcc= cc strbcc =bcc Set objCDO = Server.CreateObject("CDONTS.NewMail") With objCDO .To = strTo .From = strFrom .cc = strcc .Bcc =strbcc .Subject = strSubject .body=strBody End With objCDO.Send Set objCDO = Nothing end sub 'This function formats times function rDateTime(mytime) myColon = instr(1, mytime, ":",vbBinaryCompare) myAmPm=right(mytime,2) if myColon = 2 then myHour = Left(mytime,1) myMinute = Mid(mytime, 3, 2) else myHour = Left(mytime,1) myMinute = Mid(mytime, 2, 2) end if if myHour="" then myHour="00" if myMinute="" then myMinute="00" if myHour > 12 then myHour= myHour - 12 end if if isnull(myHour) then rDateTime=NULL else rDateTime=myHour&":"&myMinute&" "&myAmPm end if end function Private Function Format(byVal expression, byVal strFormat) On Error Resume Next Select Case lcase( strFormat ) Case "general date" Format = FormatDateTime(expression, 0) Case "long date" Format = FormatDateTime(expression, 1) Case "short date" Format = FormatDateTime(expression, 2) Case "long time" Format = FormatDateTime(expression, 3) Case "short time" Format = FormatDateTime(expression, 4) Case "general number" Format = Replace( expression, ",", "" ) Case "currency" Format = FormatCurrency(expression, 2) Case "fixed" Format = Replace( FormatNumber(expression, _ 2, -1), ",", "" ) Case "standard" Format = FormatNumber(expression, 2, -1) Case "percent" Format = FormatPercent(expression, 2) Case "yes/no" expression = cLng(expression) If expression = 0 then Format = "No" else Format = "Yes" end if Case "true/false" expression = cLng(expression) If expression = 0 then Format = "False" else Format = "True" end if Case "on/off" expression = cLng(expression) If expression = 0 then Format = "Off" else Format = "On" end if Case Else Format = expression End Select On Error GoTo 0 End Function 'function formatit(thetext) 'if len(thetext) > 45 then 'mytextarray=split(thetext,' ') 'formattedtext=thetext 'else 'formattedtext=thetext 'end if 'formatit=formattedtext 'end function %>
Dallas - phone 214-599-9766 | fax 214-520-3494
Fort Worth - phone 817-288-6123 | fax 817-928-3048 | email info@kstrategies.com
© 2010 K Strategies. All Rights Reserved