2009年10月29日 星期四

outlook 2007 中的連結無效

有一天, 小黑的 outlook 2007, 郵件里頭的網頁連結,點下去之後變成跳出選擇開啟程式的視窗
如果選用ie開啟, 並設為永遠用這個程式開啟, 下次再進來,還是一樣會彈出選擇開啟程式的視窗.

MSN中,別人傳來的連結,點下去,完全沒反應...

怪哉.

最後, 找到原因, 在ie的網際網路設定, 程式集頁籤下, 把ie設為預設的瀏覽器就ok了

informix unload後, 置換衝碼的中文字

unload出來的內容,如果帶有衝碼中文字, 例 , 則這個中文字後面會多一個 \
1. 透過vi 方式置換 , $s/\\\\/\\/g
2.如果檔案很大, vi 打不開,
sed '1,$s/\\\\/\\/g' unload.txt > unlodaNew.txt

Excel openrowset 奇怪的問題

在某台機器上,利用openrowset讀取Excel出現以下錯誤, sql server 2005上surface area configuration的ad hoc remote query也啟用了,但就是不work...
重裝service pack後問題就解決, 但只要重新開機, 問題又來了,而且只有某台機器才會這樣,奇怪奇怪真奇怪...

已获得 OLE DB 记录。源:“Microsoft SQL Native Client” Hresult: 0x80040E14 说明:“无法初始化链接服务器 "(null)" 的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 的数据源对象。”。
已获得 OLE DB 记录。源:“Microsoft SQL Native Client” Hresult: 0x80040E14 说明:“链接服务器"(null)"的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 返回了消息 "未指定的错误"。”。

An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.".

最後找到方法, 設定 registry key,
HKLM\SOFTWARE\Microsoft\Microsoft Sql Server\\Providers\Microsoft.Jet.OLEDB.4.0
AdHocAccess = 0

原文參考 Jet.OLEDB.4.0 and Linked Servers
Check Disallow AdHoc Access, this will create the right key with the wrong value (1 instead of the correct 0). Unchecking this option will remove the key and the value, this is interpreted as 'value = 1'. This 'Removing' in combination with the standard-value 1 (if no key exists) is the bug.
Close the Sql-Management-Studio, open RegEdit and search for the specific key. If you have more than one instance, use the right internal name (MSSQL.1 / MSSQL.2 etc.).
Change the value to 0
Restart your MS-SqlServer. Using Reconfigure doesn't help.


VSTO ActionsPane 看不到

OFFICE 2003 Professional SP3以上,開啟word後, vsto 的action pane看不到.

因為安裝了安全性更新,要刪除 registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility\{5f61f809-422a-4152-91f5-9ec1b935efd7}

ps. VSTO在 OFFICE 2003 Standard版本沒法執行,只能在 OFFICE 2003 Professional 以上的版本上執行, 但 OFFICE 2007不限.

解決方法參考

Office 2003 SP3 : ActionsPane's content does not appears

2009年10月28日 星期三

SQLServer 2005 找db 所有欄位及屬性

use youDBName
GO
select * from sys.tables a inner join sys.columns b
on a.object_id = b.object_id left outer join sys.extended_properties c
on b.object_id = c.major_id and b.column_id = c.minor_id
and c.major_id > 0 left outer join sys.systypes d
on b.system_type_id = d.xtype
order by b.column_id
GO

2009年10月27日 星期二

在SSIS 使用自訂的DLL方法

1.開發的dll需要簽署
2.複製dll到 C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents(此步驟可以省略)
3.複製dll到 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
4.拖曳dll到 C:\WINDOWS\assembly
5.SSIS中在 Script Task 加入dll參考

如何共用單一個 dtsConfig

多個package要共用同一個dtsConfig時,如果package的參數不是共通的,就要分開設定不同的dtsCOnfig.
但如果只想要共用一個,這樣比較好維護呢?

Step 1: 首先,先設好一個完整且含有每個package會用到的參數dtsConfig檔

Step 2: 然後view code by 每個.dtsx , 在code中手動加入一個Configuration tag

<dts:configuration><dts:property name="ConfigurationType">1</DTS:Property><dts:property name="ConfigurationString">c:\test\CRIMBIS.dtsConfig</DTS:Property><dts:property name="ConfigurationVariable"></DTS:Property><dts:property name="ObjectName">TestConfig</DTS:Property><dts:property name="DTSID">{E54F62C7-C936-4E2E-903C-0694706E7C96}</DTS:Property><dts:property name="Description"></DTS:Property><dts:property name="CreationName"></DTS:Property></DTS:Configuration>

Step3: 將package 的屬性 SupressConfigurationWarnings 設為 True.這樣當這個dtsConfig中的參數未出現在這個package時,開啟package就不會有錯誤跑出來了

來自 dtsConfig Sharing - Suppress Configuration Warnings

里面有很多ssis 的小撇步,推

編譯器錯誤訊息: CS0016: 無法寫入輸出檔

有一天, 網站執行時會出現編譯錯誤

編譯器錯誤訊息: CS0016: 無法寫入輸出檔 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\asp\3431bdf7\e3641c1\App_Web_default.aspx.cdcab7d2.rsphwbc0.dll' — '存取被拒。 '

試了幾個步驟:

爬文查了些資料後, C:\WINDOWS\TEMP 目錄加入networkservice的安全性即可,xp應該是要加aspnet吧

想了一下,好像 做完磁碟清理後 , 都會有這種狀況...

System.Data.OracleClient 需有 Oracle 用戶端軟體版本 8.1.7 或以上版本

連結oracle 資料庫, 在SSRS design環境可以執行報表,但deploy後,發生以下問題
System.Data.OracleClient 需有 Oracle 用戶端軟體版本 8.1.7 或以上版本。
描述: 在執行目前 Web 要求的過程中發生未處理的例外情形。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。


例外詳細資訊: System.Exception: System.Data.OracleClient 需有 Oracle 用戶端軟體版本 8.1.7
或以上版本。

解決方法
在Reporting Server所在的主機, 其 Oracle\product\10.1.0 的安裝目錄, 加入network service 及asp.net 的修改讀取權限即可

解決 TSVNCache.exe 佔住 CPU 的問題

原文來自 Huan-Lin 學習筆記 on DotBlogs
TortoiseSVN: 解決 TSVNCache.exe 佔住 CPU 的問題

我跟著設定後, 哇咧, 小黑的速度瞬時間飛快.

摘錄其中:

打開TortoiseSVN的 【設定視窗(Settings)→視覺樣式(Look and Feel)→圖示覆蓋(Icon Overlays)】,右邊第一個Radio Group名稱「圖示覆蓋/狀態列」的英文是「Icon Overlays/Status Columns」,其中的Status Columns應譯成狀 態欄才對,它指的是在檔案總管裡把顯示模式切換成詳細資料時, 標題欄位裡的Subversion欄位是否要同步更新狀態。如果你只會在檔案總管裡操作Subversion狀態的話,應該把「僅在檔案總管中顯示圖示覆 蓋」打勾,以免除另存新檔、開啟檔案等對話窗也更新圖示狀態。但我有時會在Total Commander裡操作Subversion,因此就不能勾選。
右邊第二個Radio Group名稱譯成「狀態列」,讓人誤解成以為是顯示訊息的狀態列設 定,但其實英文是Status Cache-狀態快取設 定,指的是資料夾與檔案圖示的SVN小圖示的覆蓋狀態的處理模式。Status Cache有3個選項:

Default
預設的快取設定,使用TSVNCache.exe 來定時掃描檔案系統,找到要變動的檔案後發出更新圖示的通知給作業系統

Shell
在Shell extension裡,只針對目前所在資料夾做圖示異動更新;只佔用1MB記憶體,但因只快取一個資料夾,當Working copy內容較多時會花較多時間才能更新完畢

None
不做任何圖示覆蓋快取,因此圖示更新速度較慢

client found response content type of text/html...

架設一個內部網站,出現這個錯, 很怪...
client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. the request failed with the error message:
...
section or group name 'system.web.extensions' is already defined. updates to this may only occur at the configuration level where it is defined.

最後找到原因
是iis root 的目錄下放一個web.config, 大概是衝到了吧...

VB IIF in C#

Row.Cells[2].Text == "abc" ? "ok" : "not ok";

或加入Microsoft.VisualBasic 參考使用 vb namespace

using Microsoft.VisualBasic.Strings.Format();
using Microsoft.VisualBasic.Interaction.IIf();
Microsoft.VisualBasic.Interaction.IIf( Row.Cells[2].Text="abc", "ok", "not ok");

.net 用css 將gridview 的表頭釘住

定CSS語法:

.FixHeaderSyle
{
background-position: top;
background-repeat: repeat-x;
background-color: #d1dbe0;
position:relative ;
top:expression(this.offsetParent.scrollTop -1);
z-index: 10;
}

.PnlGrid
{
position: relative;
z-index: 1;
top: 0px;
}

ASP.NET 中, GridView要放在 Panel中

Panel ScrollBars="Both" CSS的Style="pnlGrid"

GridViewHeaderSytle設定:"FixHeaderStyle "

不過,scroll時, 表頭那一塊沒法貼齊panel,留下一點空隙

2009年10月26日 星期一

為你的SSMS專案排序吧

SSMS里頭有很多PROJECT很多ITEM,久了,ITEM的名稱都沒按排序放,
透過這個EXTERNAL TOOL的安裝, 就可以升冪降冪排序了
包括.ssmssln及BI的專案都可以用

補上自已的圖說明一下
Title: 自已隨便輸入一個尬意的名稱
Arguments: $(SolutionFileName) Desc
如果你想要依不同類型排序,可以點選右方的小圖示有許多選項
 Initial directory: $(SolutionDir)



Sorting SQL Project Files in SQL Server Management Studio

Excel2003無法顯示造字

excel2003 無法正常顯示造字, 都變成韓文了,但在Excel2007是正常的
只要將C:\WINDOWS\Fonts 下的 New Gulim (ngulim.ttf ) 檔刪除即可

如果要確保輸入的是big5的造字,那就在輸入法的浮動視窗最左邊,按滑鼠右鍵選內容,然後將只顯示BIG5字集的選項打勾吧.

publish error allowDefinition='MachineToApplication'

一個老舊的aspx web form專案,調了一些功能建置成功,但進行部署時顯示以下錯誤。 在應用程式層級之外使用註冊為 allowDefinition='MachineToApplication' 的區段發生錯誤。錯誤的原因可能是虛擬目錄尚未在 IIS 中設定為...