Full text search time out problem

May 3, 2010

This is a MS SQL 2005 server. The full text search seems time out after some idle time. Interestingly, this time out only happens to ASP.NET connections. Query Analyzer never timed out no matter what login name used.  This MS KB link explains it:

http://support.microsoft.com/?scid=kb%3Ben-us%3B915850&x=15&y=8

However, my server DOES have internet conneciton. Nevertheless, this command still fixed the problem:

sp_fulltext_service 'verify_signature', 0;

Even Microsoft says there are securities concerns but it doesn’t seem there is an option. To check the current configuration value without changing it, run

sp_fulltext_service 'verify_signature'

I had to restart SQL service for it to take effect.


Sending email with Unicode in subject and content

December 2, 2009

http://www.cnode.cn/article.asp?id=283

CDO.Message是Windows 2003系统自带的一个邮件发送组件。往往大多数发送邮件都是邮件的内容体乱码,要解决这种问题只需要注意一下内容的编码方式以及为发送邮件的代码指定编码方式。而我遇到的这个问题倒是不常见,邮件的内容倒是没有产生乱码,而标题始终显示乱码。我在网上找了半天的资料也没有看到哪个参数是关于设置标题编码的。
在老沙同学的帮助下,终于找到可以调整标题编码的,在这里记录一下这次成功的经验。

程序代码
Public Sub SendCDO(ByVal IEmail,ByVal ITopic,ByVal ICont)
On Error Resume Next
Dim objCDO,objConfig,objConfigURL,objCDO_IBodyPart
Set objCDO=Server.CreateObject(“CDO.Message”)
Set objConfig=Server.CreateObject(“CDO.Configuration”)
objConfigURL=”http://schemas.microsoft.com/cdo/configuration/
With objConfig
.Fields(objConfigURL&”smtpserverport”)    = 25
.Fields(objConfigURL&”sendusing”)        = 2
.Fields(objConfigURL&”smtpserver”)        = SendServer
.Fields(objConfigURL&”smtpauthenticate”)= 1
.Fields(objConfigURL&”sendusername”)    = EmailUser
.Fields(objConfigURL&”sendpassword”)    = EmailPass
.Fields(objConfigURL&”languagecode”)    = CDO_Language
.Fields.Update()
End With
objCDO.Configuration= objConfig
objCDO.From         = SendEmail    ’发送者邮箱地址
objCDO.To            = IEmail    ’接收者邮箱地址
objCDO.Subject        = ITopic    ’邮件标题
objCDO.HtmlBody        = ICont        ’邮件主体内容
objCDO.BodyPart.Charset = EmailCode
objCDO.HTMLBodyPart.Charset = EmailCode
Set objCDO_IBodyPart = objCDO.HtmlBodyPart
objCDO_IBodyPart.GetDecodedContentStream
If Err<>0 Then
ErrCode=4
Else
objCDO.Send()
If Err <> 0 Then ErrCode=4
End If
Set objCDO = Nothing
End Sub

关键的代码是下面的两句,第一句是设置全局的。如果只指定第一句的话那内容会显示乱码,而第二句只是设置邮件内容体的编码的。两句一起使用才解决了乱码问题。

objCDO.BodyPart.Charset = EmailCode
objCDO.HTMLBodyPart.Charset = EmailCode


Crystal Report viewer Reditributable for Visual Studio 2008

June 25, 2009

I developed a Crystal Report viewer windows application however I can’t find the correct redistribution package for client installation (BTW the SAP’s website really really S**ks!).

Finally I found it here:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5\

And it worked like a charm.


A few tricks working with Crystal Report Designer

February 24, 2009
  • Holding CTRL key, you can select multiple objects and copy/move then as a whole group.  This is very useful when you have to make more space to add more columns, or copy columns from another report.
  • Sometimes after the data is exported to Excel, some (newly added) columns will mysteriously appear at the end of the Excel file, instead of in their intended location in design view. To fix it,  select these column headers, use UP arrow key to move them out the page header, then move back so that there is 0 top margin.
  • When export to Excel file in data only format, always uncheck “Simplify page headers”, otherwise some column headers will disappear.

Inserting background picture to Crystal Report

January 14, 2009

I don’t know if this is only my dev machine – the background picture disappears after I reopen the report.

There are a few jpg files I want to use as the background of my report. I used Insert->Picture, then select the file. Everything looks good (move to back). However after I close and re-open the report, the picture is blank. I can tell the object is still there (by the blue
border when move mouse over) however it’s just blank. Double clicking won’t activate the edit mode.

I found that, in order for this picture to retain, I have to insert the picture to a Word file first then copy it in memory from Word. Copying from MSPaint doesn’t work. Has to be Word. After inserting I had to adjust the size a little bit and the report file size is also much smaller than the version which I directly inserted picture file to.


Follow

Get every new post delivered to your Inbox.