Thursday, February 28, 2008

VB String Functons

Function Description
InStr
Returns the position of the first occurrence of one string within another. The search begins at the first character of the string

InStrRev Returns the position of the first occurrence of one string within another. The search begins at the last character of the string

LCase Converts a specified string to lowercase

Left Returns a specified number of characters from the left side of a string

Len Returns the number of characters in a string

LTrim Removes spaces on the left side of a string

RTrim Removes spaces on the right side of a string
Trim Removes spaces on both the left and the right side of a string

Mid Returns a specified number of characters from a string Replace Replaces a specified part of a string with another string a specified number of times Right Returns a specified number of characters from the right side of a string
txt="This is a beautiful day!"

document.write(Right(txt,11))Output:utiful day!

Space Returns a string that consists of a specified number of spaces StrComp Compares two strings and returns a value that represents the result of the comparison String Returns a string that contains a repeating character of a specified length StrReverse Reverses a string UCase Converts a specified string to uppercase

Vexed with "Stack overflow at line: 0" Error

Hi ,

Stack overflow at line: 0 Error really troubing me lot form several days..
I am unable to debug it..even..
I dont know how but when i removed Smartnavigation=true from my web config file it started working..

Dont ask me the reasons why??but it worked.

Monday, February 18, 2008

Sending EMails using CDO's

CDO 's are command data objects used to send Emails from SMTP server.
Before using this objects ,we need to configure the SMTP server .
Using CDO objects
Simple EMail
Set myMail=CreateObject("CDO.Message") myMail.Subject=ReportName myMail.From="HarikaWorks" myMail.To="harika.04@Gmail.com" mymail.cc="OtherReceipints@abc.com" myMail.Bcc= "OtherReceipints1@abc.com" myMail.Replyto="admin@abc.com" mymail.send()



Email with attachments
Set myMail=CreateObject("CDO.Message") myMail.Subject=ReportName myMail.From="HarikaWorks" myMail.To="harika.04@Gmail.com" mymail.cc="OtherReceipints@abc.com" myMail.Bcc= "OtherReceipints1@abc.com" myMail.Replyto="admin@abc.com" myMail.AddAttachment "D://Images/image1.gif" mymail.send()


Zip attachments in Email
Set myMail=CreateObject("CDO.Message") myMail.Subject=ReportName myMail.From="HarikaWorks" myMail.To="harika.04@Gmail.com" mymail.cc="OtherReceipints@abc.com" myMail.Bcc= "OtherReceipints1@abc.com" myMail.Replyto="admin@abc.com"
Scurdir=oFs.GetAbsolutePathName("") strcommand="winzip32.exe" Set objShell=CreateObject("WScript.Shell") strpath= "D:\\images\charts\Reports.zip" strdestination= ScurDir & "\" & sFullFileName
strcommand= strcommand & " " & " -a" & " " & strpath & " " & strdestination objShell.Run strCommand, 0, True 'wait! myMail.AddAttachment "D://Images/image1.gif" mymail.send()