<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Shai Perednik.com &#187; Code</title> <atom:link href="http://shaiperednik.com/category/code/feed/" rel="self" type="application/rss+xml" /><link>http://shaiperednik.com</link> <description>IT Guru &#38; Developer</description> <lastBuildDate>Fri, 30 Dec 2011 13:52:36 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Make EMC Retrospect Email on Events</title><link>http://shaiperednik.com/2009/09/make-emc-retrospect-email-on-events/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-emc-retrospect-email-on-events</link> <comments>http://shaiperednik.com/2009/09/make-emc-retrospect-email-on-events/#comments</comments> <pubDate>Tue, 15 Sep 2009 21:46:28 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[backup]]></category> <category><![CDATA[blockquote]]></category> <category><![CDATA[email]]></category> <category><![CDATA[emc]]></category> <category><![CDATA[event handler]]></category> <category><![CDATA[Information]]></category> <category><![CDATA[IO]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[retrospect]]></category> <category><![CDATA[script]]></category> <category><![CDATA[ssl]]></category> <category><![CDATA[tls]]></category> <category><![CDATA[XP]]></category><guid isPermaLink="false">http://shaiperednik.com/?p=656</guid> <description><![CDATA[EMC Retrospect 7.6 has a built email notification option.  However, its premetive and doesn't allow for custom messages,  alternate ports, or TLS/SSL.So after much digging and hacking I through together the script below which does the job.  This is based on the example vbs script supplied by retrospect, so cudos to them for the initial work.]]></description> <content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 471px"><a href="http://upload.wikimedia.org/wikipedia/commons/e/ee/Backup_Backup_Backup_-_And_Test_Restores.jpg" rel="lightbox[656]"><img class=" " title="Backup PC" src="http://upload.wikimedia.org/wikipedia/commons/e/ee/Backup_Backup_Backup_-_And_Test_Restores.jpg" alt="Are you backed up?" width="461" height="444" /></a><p class="wp-caption-text">Are you backed up?</p></div><p><a href="http://shaiperednik.com/tag/emc/" class="st_tag internal_tag" rel="tag" title="Posts tagged with emc">EMC</a> <a href="http://shaiperednik.com/tag/retrospect/" class="st_tag internal_tag" rel="tag" title="Posts tagged with retrospect">Retrospect</a> 7.6 has a built <a href="http://shaiperednik.com/tag/email/" class="st_tag internal_tag" rel="tag" title="Posts tagged with email">email</a> notification option.  However, its premetive and doesn’t allow for custom messages,  alternate ports, or <a href="http://shaiperednik.com/tag/tls/" class="st_tag internal_tag" rel="tag" title="Posts tagged with tls">TLS</a>/<a href="http://shaiperednik.com/tag/ssl/" class="st_tag internal_tag" rel="tag" title="Posts tagged with ssl">SSL</a>.</p><p>So after much digging and hacking I through together the <a href="http://shaiperednik.com/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with script">script</a> below which does the job.  This is based on the example vbs <a href="http://shaiperednik.com/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with script">script</a> supplied by retrospect, so cudos to them for the initial work.</p><p><a href="http://shaiperednik.com/wp-content/uploads/2009/09/retroeventhandler.vbs">Download retroeventhandler.vbs </a></p><p>Also, note that you will need to change your settings according in the last part of the script.</p><pre class="brush: vb; title: ; notranslate">
'RetroEventHandler.vbs
'
'	  Sample VBScript <a href="http://shaiperednik.com/tag/event-handler/" class="st_tag internal_tag" rel="tag" title="Posts tagged with event handler">event handler</a> for the Retrospect application.
'
'
' Sample call:
' wscript RetroEventHandler.vbs &quot;StartApp&quot; &quot;12/14/99 16:32 PM&quot; &quot;true&quot;
'
'Copyright 2000-2006 EMC Corporation
'

Option Explicit

dim WshShell
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)

dim msgDivider
msgDivider = &quot;:&quot; &amp; vbCrLf &amp; vbCrLf

Call HandleEvent()

' FormatError
'	  Return a string for the passed in error code and error string.
' This is a utility function for the scripts below.
'
Function FormatError(errCode, errMsg)
FormatError = &quot;error #&quot; &amp; errCode &amp; &quot; (&quot; &amp; errMsg &amp; &quot;)&quot;
End Function

'
' FormatSeconds
'     Return a string representing the passed in number of seconds.
' E.g.
'     &quot;3 hours 1 minute&quot;
'     &quot;2 hours 2 seconds&quot;
'
Function FormatSeconds(secondsStr)
dim secStr
dim seconds

' convert string to number of seconds
seconds = 0
On Error Resume Next
seconds = 1 * secondsStr
On Error GoTo 0

secStr = &quot;&quot;
If (seconds &gt;= 86400 * 2) Then
secStr = secStr &amp; (seconds \ 86400) &amp; &quot; days &quot;
seconds = seconds mod 86400
ElseIf (seconds &gt;= 86400) Then
secStr = secStr  &amp; &quot;1 day &quot;
seconds = seconds mod 86400
End If

If (seconds &gt;= 3600 * 2) Then
secStr = secStr &amp; (seconds \ 3600) &amp; &quot; hours &quot;
seconds = seconds mod 3600
ElseIf (seconds &gt;= 3600) Then
secStr = secStr  &amp; &quot;1 hour &quot;
seconds = seconds mod 3600
End If

If (seconds &gt;= 60 * 2) Then
secStr = secStr &amp; (seconds \ 60) &amp; &quot; minutes &quot;
seconds = seconds mod 60
ElseIf (seconds &gt;= 60) Then
secStr = secStr &amp; &quot;1 minute &quot;
seconds = seconds mod 60
End If

If (seconds &gt;= 2) Then
secStr = secStr &amp; seconds &amp; &quot; seconds &quot;
ElseIf (seconds = 1) Then
secStr = secStr &amp; &quot;1 second &quot;
End If

If (Len(secStr) &gt; 2) Then
FormatSeconds = Left(secStr, Len(secStr) - 1)
Else
FormatSeconds = &quot;0 seconds&quot;
End If
End Function

' ReturnResult
'     If result is false, create a file to inform the caller we wish to abort.
' Quit when done.
'
Sub ReturnResult(msg, interventionFile)
Dim fs, f

Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set f = fs.CreateTextFile(interventionFile)
f.Write msg
f.Close
End Sub

'
' StartApp
'	  Sent when Retrospect launches. wasAutoLaunched is true if Retrospect was
' launched automatically to run a scheduled script.
'
Sub StartApp(startDate, wasAutoLaunched, interventionFile)
Dim msg

If (wasAutoLaunched) Then
msg = &quot;StartApp&quot; &amp; msgDivider &amp; _
&quot;Retrospect autolaunched on &quot; &amp; startDate &amp; &quot;.&quot;
Else
msg = &quot;StartApp&quot; &amp; msgDivider &amp; _
&quot;Retrospect launched on &quot; &amp; startDate &amp; &quot;.&quot;
End If
SendMail msg
End Sub

'
' EndApp
'	  Sent when Retrospect is quiting.
'
Sub EndApp(endDate)
Dim msg

msg = &quot;EndApp&quot; &amp; msgDivider &amp; _
&quot;Retrospect quit on &quot; &amp; endDate &amp; &quot;.&quot;
SendMail msg
End Sub

'
' StartBackupServer
'	  Sent when the BackupServer is started via either a script or manually.
' Return false to prevent <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">backup</a> server starting
'
Sub StartBackupServer(startDate, interventionFile)
Dim msg

msg = &quot;StartBackupServer&quot; &amp; msgDivider &amp; _
&quot;Retrospect <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">Backup</a> Server is starting on &quot; &amp; _
startDate &amp; &quot;.&quot; &amp; vbCrLf &amp; _
&quot;Let <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">Backup</a> Server run?&quot;

SendMail msg
End Sub

'
' StopBackupServer
'	  Sent when <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">Backup</a> Server stops.
'
Sub StopBackupServer(endDate)
Dim msg

msg =  &quot;StopBackupServer&quot; &amp; msgDivider &amp; _
&quot;Retrospect <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">Backup</a> Server stopped on &quot; &amp; endDate &amp; &quot;.&quot;
SendMail msg
End Sub

'
' StartScript
'	  Sent when a script is run, either manually or as part of a scheduled
' execution. Return false to prevent script starting
'
Sub StartScript(scriptName, startDate, interventionFile)
Dim msg

msg = &quot;StartScript&quot; &amp; msgDivider &amp; _
&quot;Retrospect script '&quot; &amp; scriptName &amp; &quot;' is starting on &quot; &amp; _
startDate &amp; &quot;.&quot;

SendMail msg
End Sub

'
' EndScript
'	  Sent when a script finishes.
' numErrors is the total number of errors that occured. fatalErrCode is zero if
' the script was able to complete, otherwise it is a negative number for the
' error that caused the script to abort execution. errMsg is &quot;successful&quot; if
' there was no fatal error, otherwise it is the description of the error.
'
Sub EndScript(scriptName, _
numErrors, _
fatalErrCode, _
errMsg)
Dim msg

msg = &quot;EndScript&quot; &amp; msgDivider &amp; &quot;Retrospect script '&quot; &amp; scriptName &amp; &quot;' finished&quot;

If (fatalErrCode &lt;&gt; 0) Then
msg = msg &amp; &quot;.&quot; &amp; vbCrLf &amp; &quot;The script was stopped by &quot; &amp; _
FormatError(fatalErrCode, errMsg) &amp; &quot;.&quot;
ElseIf (numErrors = 0) Then
msg = msg &amp; &quot; with no errors.&quot;
ElseIf (numErrors = 1) Then
msg = msg &amp; &quot; with one non-fatal error.&quot;
Else
msg = msg &amp; &quot; with &quot; &amp; FormatNumber(numErrors,0) &amp; &quot; non-fatal errors.&quot;
End If

SendMail msg
End Sub

' StartSource
'	  Sent immediately before a script backs up a source volume.
' sourceName is the volume name that is being backed up, it will be prefaced
' with &quot;My Computer\&quot; if it is a local volume or the clientName otherwise.
' sourcePath is the file system path of the volume.
'

Sub StartSource(scriptName, sourceName, sourcePath, clientName, interventionFile)
Dim myComputerName
Dim msg

myComputerName = &quot;My Computer&quot;
msg = &quot;StartSource&quot; &amp; msgDivider
If (Left(sourceName, Len(myComputerName)) = myComputerName) Then
sourceName = Right(sourceName, Len(sourceName) - Len(myComputerName) - 1)
msg = msg &amp; &quot;The local volume '&quot; &amp; sourceName &amp; &quot;' at &quot; &amp; sourcePath &amp; _
&quot; is about to be backed up by script '&quot; &amp; scriptName &amp;&quot;'.&quot;
Else
msg = msg &amp; &quot;Client '&quot; &amp; clientName &amp; &quot;'s' volume, '&quot; &amp; sourceName &amp; &quot;' at &quot; &amp; _
sourcePath &amp; &quot; is about to be backed up by &quot; &amp; scriptName &amp; &quot;.&quot;
End If

SendMail msg
End Sub

'
' EndSource
'
'     Sent after a script has completed backing up a source. As above, sourceName
' is prefaced with either the client name or &quot;My Computer\&quot;.
'

Sub EndSource( _
scriptName, _
sourceName, _
sourcePath, _
clientName, _
KBBackedUp, _
numFiles, _
durationInSecs, _
backupStartDate, _
backupStopDate, _
scriptStartDate, _
backupSet, _
backupAction, _
parentVolume, _
numErrors, _
fatalErrCode, _
errMsg)
Dim myComputerName
Dim msg

myComputerName = &quot;My Computer&quot;
msg = &quot;EndSource&quot; &amp; msgDivider

' Volume/Client
If (Left(clientName, Len(myComputerName)) = myComputerName) Then
sourceName = Right(sourceName, Len(sourceName) - Len(myComputerName) - 1)
msg = msg &amp; &quot;The local volume '&quot; &amp; sourceName &amp; &quot;' at &quot; &amp; sourcePath
Else
msg = msg &amp; &quot;Client '&quot; &amp; clientName &amp; &quot;'s' volume, '&quot; &amp; sourceName &amp; _
&quot;' at &quot; &amp; sourcePath
End If

' Errors
If (fatalErrCode &lt;&gt; 0) Then
msg = msg &amp; &quot; stopped by &quot; &amp; FormatError(fatalErrCode, errMsg) &amp; &quot;.&quot;
ElseIf (numErrors = 0) Then
msg = msg &amp; &quot; completed successfully.&quot;
ElseIf (numErrors = 1) Then
msg = msg &amp; &quot; completed with one non-fatal error.&quot;
Else
msg = msg &amp; &quot; completed with &quot; &amp; FormatNumber(numErrors, 0) &amp; &quot; non-fatal errors.&quot;
End If
msg = msg &amp; vbCrlf &amp; &quot;Script '&quot; &amp; scriptName &amp; &quot;' finished a &quot; &amp; backupAction &amp; _
&quot; <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">backup</a> to '&quot; &amp; backupSet &amp; &quot;'. &quot; &amp; FormatNumber(numFiles, 0) &amp; _
&quot; files (&quot; &amp; FormatNumber(KBBackedUp, 0) &amp; &quot;KB) were backed up in &quot; &amp; _
FormatSeconds(durationInSecs) &amp; &quot;.&quot; &amp; vbCrlf
msg = msg &amp; &quot;The script started on &quot; &amp; scriptStartDate &amp; _
&quot; and the <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">backup</a> started on &quot; &amp; backupStartDate &amp; _
&quot; and finished on &quot; &amp; backupStopDate &amp; &quot;.&quot;

SendMail msg
End Sub

'
' MediaRequest
'
'     Sent before Retrospect requests media needed for a <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">backup</a>.
'
'     Return true to fail media request.
'

Sub MediaRequest(mediaLabel, _
mediaName, _
mediaIsKnown, _
secondsWaited, _
interventionFile)
Dim msg

msg = &quot;MediaRequest&quot; &amp; msgDivider &amp; _
&quot;Retrospect is requesting media '&quot; &amp; mediaName &amp; &quot;' (&quot; &amp; mediaLabel &amp; &quot;)&quot;
If (mediaIsKnown) Then
msg = msg &amp; vbCrlf &amp; &quot;Retrospect has backed up to this media before.&quot;
Else
msg = msg &amp; vbCrlf &amp; &quot;This is either a new or unknown media.&quot;
End If
msg = msg &amp; vbCrlf &amp; &quot;Retrospect has waited &quot; &amp; FormatSeconds(secondsWaited*60) &amp; &quot; so far.&quot;
msg = msg &amp; vbCrlf &amp; &quot;Continue with the media request?&quot;

SendMail msg
End Sub

'
' TimedOutMediaRequest
'
'     Sent before Retrospect times out on waiting for a media request. Note that
' the &quot;Media Request Timeout&quot; option in the preferences must be turned on to
' receive this event.
'
'     Return true to reset timeout request.
'

Sub TimedOutMediaRequest(mediaLabel, _
mediaName, _
mediaIsKnown, _
secondsWaited, _
interventionFile)
Dim msg

msg = &quot;TimedOutMediaRequest&quot; &amp; msgDivider &amp; _
&quot;Retrospect's media request for '&quot; &amp; mediaName &amp; &quot;' (&quot; &amp; mediaLabel &amp; _
&quot;) is about to time out after waiting &quot; &amp; FormatSeconds(secondsWaited*60) &amp; &quot;.&quot; &amp; vbCrLf &amp; _
&quot;Let Retrospect time out?&quot;

SendMail msg
End Sub

'
' ScriptCheckFailed
'
'     Sent before Retrospect quits when the next script to execute will not be
' able to run. &quot;Check validity of next script&quot; must be checked in Retrospect's
' preferences (Notification:Alerts) to receive this event.
'

Sub ScriptCheckFailed( _
scriptName, _
nextDate, _
reason, _
errCode, _
errMsg)
Dim msg

msg = &quot;ScriptCheckFailed&quot; &amp; msgDivider &amp; _
&quot;The Retrospect script '&quot; &amp; scriptName &amp; &quot;' will not run on &quot; &amp; _
nextDate &amp; vbCrLf &amp; _
FormatError(errCode, errMsg) &amp; &quot;.&quot; &amp; vbCrLf &amp; _
&quot;Retrospect's dialog: '&quot; &amp; reason &amp; &quot;'&quot;
SendMail msg
End Sub

'
' NextExec
'
'     Sent before Retrospect quits when the next script to execute is able to
' run. &quot;Check validity of next script&quot; must be checked in Retrospect's
' preferences (Notification:Alerts) to receive this event.
'

Sub NextExec(scriptName, nextDate)
Dim msg

msg = &quot;NextExec&quot; &amp; msgDivider
msg = msg &amp; &quot;Script '&quot; &amp; scriptName &amp; &quot;' is scheduled to run on &quot; &amp; _
nextDate &amp; &quot;.&quot;
SendMail msg
End Sub

'
' StopSched
'
'     Sent when an unattended script is scheduled to stop. Return false to keep
' script running.
'

Sub StopSched(scriptName, schedStopDate, interventionFile)
Dim msg

msg = &quot;StopSched&quot; &amp; msgDivider
msg = msg &amp; &quot;Script '&quot; &amp; scriptName &amp; &quot;' is scheduled to stop on &quot; &amp; _
schedStopDate &amp; &quot;.&quot;

msg = msg &amp; vbCrLf &amp; &quot;Let the script stop?&quot;
btnClicked = WshShell.Popup(msg, 120, &quot;RetroEventHandler:StopSched&quot;, 1)
SendMail msg
End Sub

'
' PasswordEntry
'
'     Sent when a password is entered.
'

Sub PasswordEntry( _
actionString, _
attempts, _
errCode, _
errMsg)
Dim msg

msg = &quot;PasswordEntry&quot; &amp; msgDivider
If (errCode &lt;&gt; 0) Then
msg = msg &amp; &quot;Login failed after &quot; &amp; FormatNumber(attempts, 0) &amp; _
&quot; attempts (error #&quot; &amp; errCode &amp; &quot; - &quot; &amp; errMsg &amp; &quot;)&quot; &amp; &quot;.&quot; &amp; _
vbCrLf &amp; &quot;Retrospect's dialog: &quot; &amp; actionString &amp; &quot;&quot;
ElseIf (attempts = 1) Then
msg = msg &amp; &quot;Login successful&quot; &amp; vbCrLf &amp; &quot;Retrospect's dialog: &quot; &amp; _
actionString &amp; &quot;&quot;
Else
msg = msg &amp; &quot;Login successful after &quot; &amp; FormatNumber(attempts, 0) &amp; _
&quot; attempts.&quot; &amp; vbCrLf &amp; &quot;Retrospect's dialog: &quot; &amp; actionString &amp;_
&quot;&quot;
End If
SendMail msg
End Sub

'
' FatalBackupError
'
'     Sent when a unrecoverable error is detected, such as a hardware
' failure
'

Sub FatalBackupError( _
scriptName, _
reason, _
errCode, _
errMsg, _
errZone, _
interventionFile)

Dim msg

msg = &quot;FatalBackupError&quot; &amp; msgDivider
msg = msg &amp; &quot;Script '&quot; &amp; scriptName &amp; &quot;' failed in &quot; &amp; errZone &amp; _
&quot; &quot; &amp; FormatError(errCode, errMsg) &amp; vbCrLf &amp; _
reason &amp; &quot;.&quot; &amp; vbCrLf &amp; _
&quot;Retrospect's dialog: &quot; &amp; &quot;'&quot; &amp; reason &amp; &quot;'&quot; &amp; vbCrLf &amp; _
&quot;Do you want to display a modal dialog?&quot;
SendMail msg
End Sub

'
' HandleEvent
'	  Dispatch event to each possible function above.
'

Sub HandleEvent()
Dim cmdArgs
Dim eventMsg
Dim argNo
Dim debugArgs

Set cmdArgs = WScript.Arguments

If (cmdArgs.Count &lt; 1) Then
WshShell.Popup &quot;This is a sample Retrospect external script written in VBScript.&quot; &amp; _
vbCrLf &amp; _
vbCrLf &amp; &quot;To use this file on the <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">backup</a> server, move it to Retrospect's directory.&quot; &amp; _
vbCrLf &amp; &quot;To use this file on a client machine, copy it to the directory containing&quot; &amp; _
vbCrLf &amp; &quot;the Retrospect client ('retroclient.exe').&quot;
Exit Sub
Else
eventMsg = cmdArgs(0)
End If

' get args for debugging
debugArgs = &quot;Arguments:&quot;
For argNo = 0 To cmdArgs.Count - 1
debugArgs = debugArgs &amp; vbCrlf &amp; FormatNumber(argNo, 0) &amp; &quot;:&quot; &amp; cmdArgs(argNo)
Next
'WshShell.Popup debugArgs								' Uncomment for debugging

' Handle event
Select Case eventMsg
Case &quot;StartApp&quot;
StartApp cmdArgs(1), cmdArgs(2) = &quot;true&quot;, cmdArgs(3)
Case &quot;EndApp&quot;
EndApp cmdArgs(1)
Case &quot;StartBackupServer&quot;
StartBackupServer cmdArgs(1), cmdArgs(2)
Case &quot;StopBackupServer&quot;
StopBackupServer cmdArgs(1)
Case &quot;StartScript&quot;
StartScript cmdArgs(1), cmdArgs(2), cmdArgs(3)
Case &quot;EndScript&quot;
EndScript cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4)
Case &quot;StartSource&quot;
StartSource cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4), cmdArgs(5)
Case &quot;EndSource&quot;
EndSource cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4), cmdArgs(5), cmdArgs(6), _
cmdArgs(7), cmdArgs(8), cmdArgs(9), cmdArgs(10), cmdArgs(11), _
cmdArgs(12), cmdArgs(13), cmdArgs(14), cmdArgs(15), cmdArgs(16)
Case &quot;MediaRequest&quot;
MediaRequest cmdArgs(1), cmdArgs(2), cmdArgs(3) = &quot;true&quot;, cmdArgs(4), cmdArgs(5)
Case &quot;TimedOutMediaRequest&quot;
TimedOutMediaRequest cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4), cmdArgs(5)
Case &quot;ScriptCheckFailed&quot;
ScriptCheckFailed cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4), cmdArgs(5)
Case &quot;NextExec&quot;
NextExec cmdArgs(1), DateValue(cmdArgs(2))
Case &quot;StopSched&quot;
StopSched cmdArgs(1), cmdArgs(2), cmdArgs(3)
Case &quot;PasswordEntry&quot;
PasswordEntry cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4)
Case &quot;FatalBackupError&quot;
FatalBackupError cmdArgs(1), cmdArgs(2), cmdArgs(3), cmdArgs(4), cmdArgs(5), cmdArgs(6)
Case Else
MsgBox &quot;Unknown command: &quot; &amp; eventMsg
End Select
End Sub

Sub SendMail(strMsg)
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Dim objMessage

Set objMessage = CreateObject(&quot;CDO.Message&quot;)
objMessage.Subject = &quot;Retrospect <a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">Backup</a>&quot;
objMessage.From = &quot;&quot;&quot;<a href="http://shaiperednik.com/tag/backup/" class="st_tag internal_tag" rel="tag" title="Posts tagged with backup">Backup</a> Server&quot;&quot; &lt;noreply@example.com&gt;&quot;
objMessage.To = &quot;youremail@example.com&quot;
objMessage.TextBody = strMsg

'==This section provides the configuration <a href="http://shaiperednik.com/tag/information/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Information">information</a> for the remote SMTP server.

objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/sendusing&quot;) = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/smtpserver&quot;) = &quot;YourSMTP&quot;

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/smtpauthenticate&quot;) = cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/sendusername&quot;) = &quot;USERID&quot;

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/sendpassword&quot;) = &quot;Password&quot;

'Server port (typically 465,25, or 587)
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/smtpserverport&quot;) = 465

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/smtpusessl&quot;) = True

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
(&quot;http://schemas.<a href="http://shaiperednik.com/tag/microsoft/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft">microsoft</a>.com/cdo/configuration/smtpconnectiontimeout&quot;) = 60

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send
End Sub</pre><p><a href="http://shaiperednik.com/2009/09/make-emc-retrospect-email-on-events/" rel="bookmark">Make EMC Retrospect Email on Events</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on September 15, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/09/make-emc-retrospect-email-on-events/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Enable mod_rewrite in APACHE</title><link>http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enable-mod_rewrite-in-apache</link> <comments>http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/#comments</comments> <pubDate>Fri, 21 Aug 2009 18:11:35 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[blockquote]]></category> <category><![CDATA[Bookmarklet]]></category> <category><![CDATA[CURL]]></category> <category><![CDATA[IO]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[php]]></category> <category><![CDATA[Sudo]]></category> <category><![CDATA[tr.im]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://shaiperednik.com/?p=512</guid> <description><![CDATA[With all the commosion lately relating to tr.im&#8217;s closure and reopening most people are opting to setup their own shortning service. There&#8217;s Lessn and Yours.  Both I searched around but couldn&#8217;t get a clear answer that worked. With all the hullabaloo lately relating to tr.im&#8216;s closure and reopening most people are opting to setup their own [...]]]></description> <content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">With all the commosion lately relating to <a href="http://shaiperednik.com/tag/tr-im/" class="st_tag internal_tag" rel="tag" title="Posts tagged with tr.im">tr.im</a>&#8217;s closure and reopening most people are opting to setup their own shortning service.</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">There&#8217;s Lessn and Yours.  Both</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I searched around but couldn&#8217;t get a clear answer that worked.</div><p>With all the <span style="font-family: Arial; line-height: normal; border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">hullabaloo</span> lately relating to <a href="tr.im" target="_blank">tr.im</a>&#8216;s closure and reopening most people are opting to setup their own shortning service.</p><p>There&#8217;s <a href="http://shauninman.com/archive/2009/08/17/less_n" target="_blank">Lessn</a> and <a href="http://yourls.org/" target="_blank">Yourls</a>.  Both are great but Yours takes the cake for the admin panel and more detailed info.   I followed the <a href="http://lifehacker.com/5335216/make-your-own-url-shortening-service" target="_blank">LifeHacker Tutorial</a>,<span style="background-color: #ffffff;"> but couldn&#8217;t get <span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;"><strong><a href="http://shaiperednik.com/tag/mod_rewrite/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mod_rewrite">mod_rewrite</a> </strong>working.  With the help of this <a href="http://ubuntuforums.org/showthread.php?t=255556&amp;page=2">post</a> I figured it out.</span></span></p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">change the following line in /etc/<a href="http://shaiperednik.com/tag/apache/" class="st_tag internal_tag" rel="tag" title="Posts tagged with apache">apache</a>2/sites-enabled/000-default</span></p><blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px;"> </span></p><pre class="alt2" style="background-image: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; color: #000000; width: 640px; height: 194px; text-align: left; overflow-x: auto; overflow-y: auto; background-position: initial initial; padding: 6px; margin: 0px; border: 1px inset initial;" dir="ltr"> DocumentRoot /var/www/
        &lt;Directory /&gt;
                Options FollowSymLinks
                <span style="color: red;">AllowOverride all</span>
        &lt;/Directory&gt;
        &lt;Directory /var/www/&gt;
                Options FollowSymLinks
                <span style="color: red;">AllowOverride all</span>
                Order allow,deny
                allow from all
        &lt;/Directory&gt;</pre></blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">then restart apache</span></p><blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;"><a href="http://shaiperednik.com/tag/sudo/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Sudo">sudo</a> /etc/init.d/apache2 restart</span></p></blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">Theres also a <a href="http://jarb.ro/M">bookmarklet</a> for Yourls from <a href="http://twitter.com/jarbro" target="_blank">twitter.com/jarbro</a> <span style="text-decoration: line-through;">but I&#8217;m still working on getting past the &#8220;Unknown&#8221; error.</span></span></p><p><strong>UPDATE: </strong>The unknown error is normal.  You just need to drag the links to the bookmark bar.</p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">I have to install <a href="http://shaiperednik.com/tag/php/" class="st_tag internal_tag" rel="tag" title="Posts tagged with php">php</a>5-<a href="http://shaiperednik.com/tag/curl/" class="st_tag internal_tag" rel="tag" title="Posts tagged with CURL">curl</a> just to get the <a href="http://shaiperednik.com/tag/curl/" class="st_tag internal_tag" rel="tag" title="Posts tagged with CURL">curl</a>_init() function installed</span></p><blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">sudo apt-get php5-curl</span></p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">sudo  /etc/init.d/apache2 restart</span></p></blockquote><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;">Hopefully this helps someone</span></p><p><span style="font-family: Verdana, Arial, Tahoma; line-height: normal; font-size: 12px; background-color: #ffffff;"><br /> </span></p><p><a href="http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/" rel="bookmark">Enable mod_rewrite in APACHE</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on August 21, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/08/enable-mod_rewrite-in-apache/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Get “real” IP address with vb .net?</title><link>http://shaiperednik.com/2009/08/get-%e2%80%9creal%e2%80%9d-ip-address-with-vb-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-%25e2%2580%259creal%25e2%2580%259d-ip-address-with-vb-net</link> <comments>http://shaiperednik.com/2009/08/get-%e2%80%9creal%e2%80%9d-ip-address-with-vb-net/#comments</comments> <pubDate>Fri, 14 Aug 2009 23:29:38 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[blockquote]]></category> <category><![CDATA[IO]]></category> <category><![CDATA[module]]></category> <category><![CDATA[php]]></category> <category><![CDATA[vb.net]]></category><guid isPermaLink="false">http://shaiperednik.com/2009/08/get-%e2%80%9creal%e2%80%9d-ip-address-with-vb-net/</guid> <description><![CDATA[I saw this post @ stackoverflow.com, I was trying to do the same. So I thought I&#8217;d post a complete solution. See this link above or the code below To Combine the answers above&#8221; Create a php file and paste this in it: &#60;?php echo $_SERVER['REMOTE_ADDR']; ?&#62; save it as curip.php and upload it to [...]]]></description> <content:encoded><![CDATA[<p>I saw this <a href="http://stackoverflow.com/questions/1242484/get-real-ip-address-with-vb-net/1280657#1280657">post</a> @ <a href="stackoverflow.com">stackoverflow.com</a>, I was trying to do the same.  So I thought I&#8217;d post a complete solution.  See this <a href="http://stackoverflow.com/questions/1242484/get-real-ip-address-with-vb-net/1280657#1280657">link</a> above or the code below</p><p>To Combine the answers above&#8221;</p><p>Create a <a href="http://shaiperednik.com/tag/php/" class="st_tag internal_tag" rel="tag" title="Posts tagged with php">php</a> file and paste this in it:</p><blockquote><p>&lt;?php</p><p>echo $_SERVER['REMOTE_ADDR'];</p><p>?&gt;</p></blockquote><p>save it as curip.php and upload it to your server.</p><p>In your <a href="http://shaiperednik.com/tag/vb-net/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vb.net">VB.net</a> project create a <a href="http://shaiperednik.com/tag/module/" class="st_tag internal_tag" rel="tag" title="Posts tagged with module">module</a>.</p><p>Declare the imports section at the very top</p><blockquote><p>Imports System.Net</p><p>Imports System.<a href="http://shaiperednik.com/tag/io/" class="st_tag internal_tag" rel="tag" title="Posts tagged with IO">IO</a></p></blockquote><p>And create your function:</p><blockquote><p>Public Function GetIP() As String</p><p>Dim uri_val As New Uri(&#8220;http://yourdomain.com/curip.php&#8221;)</p><p>Dim request As HttpWebRequest = HttpWebRequest.Create(uri_val)</p><p>request.Method = WebRequestMethods.Http.Get</p><p>Dim response As HttpWebResponse = request.GetResponse()</p><p>Dim reader As New StreamReader(response.GetResponseStream())</p><p>Dim myIP As String = reader.ReadToEnd()</p><p>response.Close()</p><p>Return myIP</p><p>End Function</p></blockquote><p>Now anywhere in your code you can issue</p><blockquote><p>Dim myIP = GetIP()</p></blockquote><p>and use the value from there as you wish.</p><p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="background-color: #ffffff; line-height: 18px; white-space: pre; "> </span></span></p><p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"></p><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;?php</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">echo $_SERVER['REMOTE_ADDR'];</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">?&gt;</div><p></span></p><p><a href="http://shaiperednik.com/2009/08/get-%e2%80%9creal%e2%80%9d-ip-address-with-vb-net/" rel="bookmark">Get “real” IP address with vb .net?</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on August 14, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/08/get-%e2%80%9creal%e2%80%9d-ip-address-with-vb-net/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>JavaScript MailTo Link Generator</title><link>http://shaiperednik.com/2009/07/javascript-mailto-link-generator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-mailto-link-generator</link> <comments>http://shaiperednik.com/2009/07/javascript-mailto-link-generator/#comments</comments> <pubDate>Mon, 13 Jul 2009 20:19:27 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[email]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[mailto]]></category><guid isPermaLink="false">http://shaiperednik.com/?p=319</guid> <description><![CDATA[Very usefull javascript generator for creating complex mailto links. jsCode.com :: JavaScript MailTo Link Generator.]]></description> <content:encoded><![CDATA[<p>Very usefull <a href="http://shaiperednik.com/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Javascript">javascript</a> generator for creating complex <a href="http://shaiperednik.com/tag/mailto/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mailto">mailto</a> links.</p><p><a href="http://www.jscode.com/generators/mailto_generator.shtml">jsCode.com :: JavaScript MailTo Link Generator</a>.</p><p><a href="http://shaiperednik.com/2009/07/javascript-mailto-link-generator/" rel="bookmark">JavaScript MailTo Link Generator</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on July 13, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/07/javascript-mailto-link-generator/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>VB.NET &#8211; Date Time Picker &#8211; How Can I Choose BOTH A Date And A Time?</title><link>http://shaiperednik.com/2009/07/vb-net-date-time-picker-how-can-i-choose-both-a-date-and-a-time/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vb-net-date-time-picker-how-can-i-choose-both-a-date-and-a-time</link> <comments>http://shaiperednik.com/2009/07/vb-net-date-time-picker-how-can-i-choose-both-a-date-and-a-time/#comments</comments> <pubDate>Wed, 08 Jul 2009 14:53:08 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[vb.net]]></category><guid isPermaLink="false">http://shaiperednik.com/?p=281</guid> <description><![CDATA[The dateTimePicker can indeed do time. Hence the name Just change the Format property to time, and the ShowUpDown to True. Either in the editor, or in code like CODE dateTimePicker1.Format = Time dateTimePicker1.ShowUpDown = True via VB.NET &#8211; Date Time Picker &#8211; How Can I Choose BOTH A Date And A Time? &#124; DreamInCode.net.]]></description> <content:encoded><![CDATA[<p>The dateTimePicker can indeed do time. Hence the name</p><p>Just change the Format property to time, and the ShowUpDown to True.</p><p>Either in the editor, or in code like</p><p>CODE</p><p>dateTimePicker1.Format = Time</p><p>dateTimePicker1.ShowUpDown = True</p><p>via <a href="http://www.dreamincode.net/forums/showtopic39512.htm">VB.NET &#8211; Date Time Picker &#8211; How Can I Choose BOTH A Date And A Time? | DreamInCode.net</a>.</p><p><a href="http://shaiperednik.com/2009/07/vb-net-date-time-picker-how-can-i-choose-both-a-date-and-a-time/" rel="bookmark">VB.NET &#8211; Date Time Picker &#8211; How Can I Choose BOTH A Date And A Time?</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on July 8, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/07/vb-net-date-time-picker-how-can-i-choose-both-a-date-and-a-time/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Good Coding Practices</title><link>http://shaiperednik.com/2009/06/good-coding-practices/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=good-coding-practices</link> <comments>http://shaiperednik.com/2009/06/good-coding-practices/#comments</comments> <pubDate>Fri, 19 Jun 2009 21:49:08 +0000</pubDate> <dc:creator>Shai Perednik</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[XP]]></category><guid isPermaLink="false">http://shaiperednik.com/?p=189</guid> <description><![CDATA[Reading through some coding expamples I came upon this well commented code.  The info is in XML format and makes perfect sence for any reader. I&#8217;m going to start using this method from now on. VB.net ''' &#60;summary&#62; ''' Checks to see if a table exists in Database or not. ''' &#60;/summary&#62; ''' &#60;param name="tblName"&#62;Table [...]]]></description> <content:encoded><![CDATA[<p>Reading through some coding expamples I came upon this well commented code.  The info is in XML format and makes perfect sence for any reader.</p><p>I&#8217;m going to start using this method from now on.</p><p><a href="http://shaiperednik.com/tag/vb-net/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vb.net">VB.net</a></p><p><span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: normal;"> </span></p><pre id="pre0" style="background-color: #fbedbb; font: normal normal normal 9pt/normal 'Courier New', Courier, mono; white-space: pre; overflow-x: auto !important; overflow-y: auto !important; margin-top: 0px; padding: 7pt;" lang="vbnet"><span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> <span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">summary</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span></span>
<span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> Checks to see if a table exists in Database or not.</span>
<span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> <span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">/</span><span class="code-SummaryComment" style="color: #808080;">summary</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span></span>
<span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> <span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">param</span> <span class="code-SummaryComment" style="color: #808080;">name="tblName"</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span>Table name to check<span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">/</span><span class="code-SummaryComment" style="color: #808080;">param</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span></span>
<span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> <span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">param</span> <span class="code-SummaryComment" style="color: #808080;">name="cnnStr"</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span>Connection String to connect to<span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">/</span><span class="code-SummaryComment" style="color: #808080;">param</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span></span>
<span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> <span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">returns</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span>Works with Access or SQL<span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">/</span><span class="code-SummaryComment" style="color: #808080;">returns</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span></span>
<span class="code-SummaryComment" style="color: #808080;">'''</span><span class="code-comment" style="color: #008000; font-style: italic;"> <span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">remarks</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span><span class="code-SummaryComment" style="color: #808080;">&lt;</span><span class="code-SummaryComment" style="color: #808080;">/</span><span class="code-SummaryComment" style="color: #808080;">remarks</span><span class="code-SummaryComment" style="color: #808080;">&gt;</span></span></pre><p><a href="http://shaiperednik.com/tag/php/" class="st_tag internal_tag" rel="tag" title="Posts tagged with php">PHP</a></p><pre id="pre0" style="font: normal normal normal 9pt/normal 'Courier New', Courier, mono; background-color: #fbedbb; white-space: pre; overflow-x: auto !important; overflow-y: auto !important; margin-top: 0px; padding: 7pt;" lang="vbnet"><span style="color: #808080;">//&lt;summary&gt;
//checks to see if a table exists in Database or not.
//&lt;/summary&gt;
//&lt;param name="tblName"&gt;Table name to check&lt;/param&gt;
//&lt;param name="cnnStr"&gt;Connection String to connect to&lt;/param&gt;
//&lt;returns&gt;Works with Access or SQL&lt;/returns&gt;
//&lt;remarks&gt;&lt;/remarks&gt;</span></pre><p>via <a href="http://www.codeproject.com/KB/database/checkdatabase.aspx">CodeProject: Check if a table or field exists in a database. Free source code and programming help</a>.</p><p><a href="http://shaiperednik.com/2009/06/good-coding-practices/" rel="bookmark">Good Coding Practices</a> originally appeared on <a href="http://shaiperednik.com">Shai Perednik.com</a> on June 19, 2009.</p> ]]></content:encoded> <wfw:commentRss>http://shaiperednik.com/2009/06/good-coding-practices/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/43 queries in 0.024 seconds using disk: basic
Object Caching 1638/1725 objects using disk: basic

Served from: shaiperednik.com @ 2012-02-08 05:02:45 -->
