2008/06/20

[KB][SPS2007]Microsoft.Office.Server.Internal.UI.SharedServicesAdminDefaultPage is not allow for this page

出現這個錯誤已經好幾次,都忘記寫下來。

錯誤訊息為:

The base type 'Microsoft.Office.Server.Internal.UI.SharedServicesAdminDefaultPage' is not allow for this page.

This type is not registered as safe.

通常會遇到這個問題都是客製作 default.master 造成的。

先做了客製作之後,再連接至 admin or ssp 網站就會造成。

解決的方式就是

1.先還原 default.master

2.至admin or ssp 網站的 /_catalogs/master ,將 default.aspx 重設網站定義即可。

[FIX][IIS6] The path specified cannot be used at this time

當開啟 Internet Information Service 時,就會出現這個錯誤

 

The path specified cannot be used at this time.

image

 

很奇怪的是,在 EventLog 上 也出現以下的訊息

 

Event Type:    Error
Event Source:    Office SharePoint Server
Event Category:    Office Server 共用服務
Event ID:    6482
Date:        2008/6/20
Time:        上午 10:37:20
User:        N/A
Computer:   
Description:
服務執行個體 Microsoft.Office.Server.Search.Administration.SearchAdminSharedWebServiceInstance (82d1a3e4-bbc4-4589-b114-1e3e49a50237) 的應用程式伺服器管理工作失敗。

原因: The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)

技術支援詳細資料:
System.Runtime.InteropServices.COMException (0x80070094): The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)
   at System.DirectoryServices.DirectoryEntry.CommitChanges()
   at Microsoft.SharePoint.Metabase.MetabaseObject.Update()
   at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ApplyIisVirtualDirectorySettings(VirtualDirectory virtualDirectory, String path, AccessFlags accessFlags, String applicationName, String applicationPoolId, String[] scriptMaps)
   at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionIisRootVirtualDirectory(WebSite webSite, String path, AccessFlags accessFlags, String applicationName, String applicationPoolId, String[] scriptMaps)
   at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionIisWebSite(String serverComment, String[] serverBindings, String[] secureBindings, AuthenticationMethods authenticationMethods, String[] authenticationProviders, String path, AccessFlags accessFlags, String applicationName, String applicationPoolId, String[] scriptMaps, String sslCertificateSubjectName)
   at Microsoft.SharePoint.Administration.SPMetabaseManager.ProvisionIisWebSite(String serverComment, String[] serverBindings, String[] secureBindings, Int32 authenticationMethods, String[] authenticationProviders, String path, Int32 accessFlags, String applicationName, String applicationPoolId, String[] scriptMaps, String sslCertificateSubjectName)
   at Microsoft.Office.Server.Administration.SharedWebServiceInstance.Synchronize()
   at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)

Event Type:    Error
Event Source:    Windows SharePoint Services 3
Event Category:    計時器
Event ID:    6398
Date:        2008/6/20
Time:        上午 10:30:50
User:        N/A
Computer:   
Description:
工作定義 Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob (識別碼 ce316348-a374-4dc2-ad07-e3328c4868ca) 的 Execute 方法發生例外狀況。其他資訊如下。

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

 

我發現微軟有一個 KB 在說明這個問題,並且在右上角提供索取 hotfix 的方法(小熊子大眼睛沒看到,謝謝黑暗大哥)

http://support.microsoft.com/kb/946517

以下是 KB946517 的內容,提供參考

安裝完後, IIS 管理界面就開得起來囉~

================================================================================================================

SYMPTOMS

Consider the following scenario. You have a process that has more than one thread. Additionally, the process uses the Internet Information Services (IIS) Active Directory Service Interfaces (ADSI) provider to access IIS 6.0. Two threads access IIS 6.0 at the same time. In this scenario, you may be unable to manage IIS 6.0 by using Server Manager.
When this problem occurs, you must restart IIS 6.0, or you must restart the process that uses the IIS ADSI provider.
This problem is likely to occur for the SharePoint Timer service (OWSTimer.exe) in Microsoft Office SharePoint Server 2007. When this problem occurs for the SharePoint Timer service, you may experience the following symptoms:


In SharePoint Server 2007, tasks that are scheduled do not run.


On the SharePoint Web front-end server, you see repeated errors in the Application log in Event Viewer. These errors usually include one of the following three events:


Event ID 6398


Event ID 6482


Event ID 7076

For example, you may see an error message that resembles the following:

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: (964)
Event ID: 6398
Date: 11/7/2007
Time: 5:45:38
PM User: N/A
Computer: 44MOSSAGRUK
Description:
The Execute method of job definition Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob
(ID 02b5e3f2-21e3-4552-bf1d-6e152749458a) threw an exception. More information is included below.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


When you try to manage IIS 6.0 by using Server Manager, you receive a blank page, or you receive the following error message:

the path specified cannot be used at this time

2008/06/05

[KB] 組態檔的 processModel 區段中提供了無效的使用者名稱和 (或) 密碼,所以無法啟動 aspnet_wp.exe 程式

 

事件類型: 錯誤
事件來源: ASP.NET 1.1.4322.0
事件識別碼: 1084
描述:
無法啟動 aspnet_wp.exe。這項失敗的錯誤碼為 80004005。當背景工作處理序帳戶沒有足夠權限讀取 .NET Framework 檔案時就可能會發生這項錯誤。請確定 .NET Framework 安裝正確,而且安裝目錄上的 ACL 允許存取設定的帳戶。

 

事件類型:    錯誤
事件來源:    ASP.NET 1.1.4322.0
事件識別碼:    1007
描述:
由於在組態檔的 processModel 區段中提供了無效的使用者名稱和 (或) 密碼,所以無法啟動 aspnet_wp.exe 程式。

 

我的解決方式為:

  • 開啟 %windir%\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config
    找到 <processModel> 確定 userName 是 machine,password 是 AutoGenerate (<==大小寫有分哦)
  • 重新安裝 aspnet
    • 移除ASPNET的帳號
    • 執行 %windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i
    • 執行 %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i  (optional)
    • 執行 iisreset

 

可能可以先用 ProcMon 找 aspnet_wp.exe 的 Access Denied 事件

2008/05/08

[FIX]VSS 2005 與 PDF 不相容問題(2008-05-08 Updated)

最近將企劃美編人員與開發人員共用維護的網站,利用 VSS 2005 來做一個版本控管,以前用 VSS 6.0(a/b/c/d)都沒什麼事,想當然爾就是 OK 的,

就直接 check-in 後就可以用了,過了幾天,發現事情不妙了, PDF 的檔案格式 check-out 後有問題,而且是一定要再 Get Latest Version 才會出包。

看來一下 byte 數,check-in 前與 Get Latest Version後竟然差了1~2 bytes,-_-

後來發現檔案不太一樣,用二位進比對後發現會有折行發生,很像以前 ftp 時,沒有指定 Binary or ASCII 的狀況。

image

上網找了一下問題,結果發現是微軟的 BUG.... @%$#$^%$#!@#$@!%$^&%&%~

 

===============================================================================

底下是微軟 KB 的片段 http://support.microsoft.com/kb/923434/en-us/

===============================================================================

FIX: The PDF file becomes corrupted after you check in the PDF file in Visual SourceSafe 2005

SYMPTOMS

After you check in a Portable Document Format (PDF) file in Microsoft Visual SourceSafe 2005, the PDF file becomes corrupted. Additionally, you do not receive any error messages. You may experience this problem if the following conditions are true:


You select the Auto-detect encoding of local file check box on the General tab.
Note To access the General tab, click Properties on the File menu.


In the Options dialog box, you select Binary file on the File types tab.
Note To open the Options dialog box, click Options on the Tools menu.

 

CAUSE

This problem occurs when the autodetect feature switches the file from the binary format to the ANSI format.

 

RESOLUTION

Download information

The following file is available for download from the Microsoft Download Center:
DownloadDownload the 284443_ENU_i386_zip.exe package now. (https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=7257)
Release Date: 6/20/2007

 

 

 

 

2008-05-08 更新:

發現微軟有一個 FIX package : List of bugs that are fixed in the Visual SourceSafe 2005 Update (2007/12/13 v2.1)

http://support.microsoft.com/kb/943847/

===============================================================================

Bugs that are fixed in the Visual SourceSafe 2005 Update
For more information about the bugs that are fixed in this update, click the following article numbers to view the articles in the Microsoft Knowledge Base:

916688 (http://support.microsoft.com/kb/916688/) FIX: Error message when you try to use the Visual SourceSafe 2005 LAN booster service together with Visual Studio 2005 on a server that is running Windows 2000:"Unable to use SourceSafe LAN service"

917491 (http://support.microsoft.com/kb/917491/) FIX: The Analyze.exe utility may incorrectly remove files and projects in Visual SourceSafe 2005 when you run the utility by using the - d switch

923434 (http://support.microsoft.com/kb/923434/) FIX: The PDF file becomes corrupted after you check in the PDF file in Visual SourceSafe 2005

924702 (http://support.microsoft.com/kb/924702/) FIX: You cannot compare the latest version of a file to any earlier versions of that file after you change the file type to the UTF8 file type in Visual SourceSafe 2005

923842 (http://support.microsoft.com/kb/923842/) FIX: Error message in the Analyze.log file when you run the Analyze.exe utility in Visual SourceSafe 2005: "The file 0\DATA\\ is not a valid SourceSafe physical database file"

927004 (http://support.microsoft.com/kb/927004/) FIX: After you perform a merge operation on a file in Visual SourceSafe 2005, only three accounts can access the merged file

925234 (http://support.microsoft.com/kb/925234/) FIX: When you check out and then try to open a PDF file, the file may not open if the file was checked in by using Visual SourceSafe 2005

925275 (http://support.microsoft.com/kb/925275/) FIX: When you generate a report to show the history of a source file, Visual SourceSafe 2005 may stop unexpectedly

927887 (http://support.microsoft.com/kb/927887/) FIX: Error message when you use the Get Latest Version option in Visual SourceSafe 2005 to try to obtain the latest version of an XML file: "SourceSafe was unable to finish writing a file"

928392 (http://support.microsoft.com/kb/928392/) FIX: Error message when you try to check in a file that has a comment template and the comment template has more than three lines in Visual SourceSafe 6.0: "Error reading from file"

930573 (http://support.microsoft.com/kb/930573/) FIX: Visual SourceSafe 2005 may stop responding when you generate a report in the "Show History" dialog box

932058 (http://support.microsoft.com/kb/932058/) FIX: Error message when you try to set the value of the IVSSItem.AutoDetectEncoding property to "false" if the item is checked out in Visual SourceSafe 2005: "System.Runtime.InteropServices.COMException (0x8004D67F)"

934723 (http://support.microsoft.com/kb/934723/) FIX: You may receive an error message when you use Ole Automation to programmatically retrieve a specific version of a file from the history in Visual SourceSafe 2005

932874 (http://support.microsoft.com/kb/932874/) FIX: Visual SourceSafe 2005 may stop responding (hang) when you check in a large binary file

938607 (http://support.microsoft.com/kb/938607/) FIX: Error message when you try to add files to a Visual SourceSafe 2005 database or when you try to retrieve files from a Visual SourceSafe 2005 database by using Web access through HTTP: "Operation timed out"

 

How to obtain the Visual SourceSafe 2005 Update

The following file is available for download from the Microsoft Download Center:
DownloadDownload the VS80-KB943847-X86-INTL.exe package now.

(http://download.microsoft.com/download/7/1/f/71fdb660-4e69-471a-ad58-d984b45cc140/vs80-kb943847-x86-intl.exe)
Release Date: December 11, 2007

2008/05/07

[SSIS]Failed to decrypt protected XML node "DTS:Password" Exception when opening SSIS package

 

Error loading BlahBlah.dtsx:

Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.".

You may not be authorized to access this information. This error occurs when there is a cryptographic error.

Verify that the correct key is available.

 

 

Possible options are (see MSDN):

  • DontSaveSensitive: Sensitive data is not saved at all (replaced with blanks). It has to be re-entered each time the package is opened. Every logged-on user can open/execute the package.
  • EncryptAllWithPassword: The whole package is encrypted using the password given in the "PackagePassword" property of the package. The package cannot be opened/executed without this password, but every logged-on user who knows it can open/execute the package.
  • EncryptAllWithUserKey: The whole package is encrypted using a key calculated from the creator's user profile. The package can only be opened and executed from the creator windows user.
  • EncryptSensitveWithPassword: Not whole package, but only sensitive data is encrypted using the password given in "PackagePassword" property. When opening/executing the package, you have to specify the password to decrypt the sensitive data (if not the package can be opened anyway, but sensitive data is not available).
  • EncryptSensitiveWithUserKey (default): Same as above, but instead of PackagePassword user profile is used as key. Other logged-on windows users can open the package in VS but sensitive data must be re-entered. The package can only be executed by the creator windows user.
  • ServerStorage: Protects the whole package using SQL Server database roles. This option is supported only when a package is saved to the SQL Server msdb database. It is not supported when a package is saved to the file system from Business Intelligence Development Studio.

Sensitive data are:

  • The password part of a connection string.
  • The task-generated XML nodes that are tagged as sensitive. The tagging of XML nodes is controlled by Integration Services and cannot be changed by users.
  • Any variable that is marked as sensitive. The marking of variables is controlled by Integration Services.

 

 

參考資料:

http://www.cubido.at/Blog/tabid/176/EntryID/155/Default.aspx ( thanks m.unterauer)

2008/04/18

[VSS] 忘記 Admin 密碼怎麼辦?

最近遇到 VSS 的管理者忘記密碼,VSS 要加新的人員及權限設定都要靠他,怎麼辦??

Hack VSS!!

網路上找到一個方式,真的可以在 VSS 2005 運作。

不過也很擔心的是…以檔案為基礎的 VSS ,如果沒有仔細設定好,

任何人只要能存取 VSS Database 就可以自己提昇權限或更改 Admin 密碼做壞事後再還原。

 

1.找到 <VSS DB>\data\um.dat ,並先備份(極重要)

2.使用 HEX Editor ( e.g. UltraEditor )開啟 um.dat

3.找到 41 64 6d 69 6e 字串,此為 "Admin" 的 16 進位碼,然後看著下方總共 80 bytes ,將自己的 um.dat 調整成一樣

55 55 bc 7f 41 64 6d 69 6e 00 00 00 00 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00 00 00 00 90 6e 00 00 a8 01 00 00 00 00 00 00

[好像回到以前打 Game 的時代,將三國志的諸葛亮武力調整 256 (ff) ]

4.存檔後,再用 Visual Source Safe Admin ,密碼是空白登入,大功告成!!

5.記得趕快更改 Admin 密碼哦。

 

 

關於 VSS 安全性有兩個地方要注意:

1.Tools->Options->General->Use Network Name for Automatic User Login In 選項要特別注意:

詳情請看黑暗大師的文章 http://blog.darkthread.net/blogs/darkthreadtw/archive/2007/12/04/wtf-vss-option.aspx

2. um.dat 由於 Users 需有修改權限,也不能讓一般 User 無修改權限,意即是…VSS 裡面沒有秘密可言。

 

 

 

 

參考文章:

Forgot SourceSafe Admin Password

Lost the Admin Password of Visual SourceSafe v6.0x

http://www.interdimension.org/en/it/vss_lost_admin_password.htm

VSS(Visual Source Safe)有安全性可言吗?

http://www.witsun.net/blog/article.asp?id=164

SourceSafe Password Recovery Made Easy

http://www.c6software.com/articles/sourcesafepassword.aspx

2008/03/31

[SSIS]小數位數不見了?

最近使用 SSIS 將 Oracle 資料轉換,實際測試後卻發現小數位數不見了?

經過交叉測試發現是 SSIS 在 OLEDB Source 轉換時,自行猜測資料型別時出了問題。

如下圖所示,原本 NUMBER(16,6) 進到 SSIS 後,變為 NUMERIC(38,0) 就會造成小數位數不見了,

這時要手動調整,點選 OLE DB Source ,按下右鍵 Show Advance Editor,將 Output Columns 調整一下就 OK.

 

image

2008/03/26

[SSIS]Script Task Add Reference Issue

在 Script Task 中,使用 VSA(*註一) 語法時,遇到兩個問題

Q1:Add Reference 一直找不到 Assemblies 組件?

Q2:找到了 Assemblies 後,Design Script 可以過,但是 Runtime 無法找到組件

後來發現 Kirk Haselden 這篇文章(http://www.sqljunkies.com/WebLog/knight_reign/archive/2005/07/07/16018.aspx)

歸納幾點結論:

  • Reference Strong Name Assemblies ,只有強式名稱組件能被 Runtime 執行
  • Reference Assemblies in GAC & %windir%\Microsoft.NET\Framework\v2.0.50727\

 

*註一:VSA-Visual Studio for Applications

2008/03/18

[Oracle][KB]ORA-04091 table string.string is mutating, trigger/function may not see it

第一次寫 Oracle Trigger 就遇到這種怪問題,其實 Trigger 寫的也很簡單

這是 Sample 的 Trigger

   1:   
   2:   
   3:  select count(*) into v_cnt from tableA where xxxx
   4:   
   5:  if (v_cnt>0) then
   6:   
   7:  ...........
   8:   
   9:  end;

 

結果遇到 TableA 的 Trigger 要再去存取 TableA 時,會出現以下錯誤訊息

 

ORA-04091 table string.string is mutating, trigger/function may not see it

Cause: A trigger (or a user defined PL/SQL function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it.

Action: Rewrite the trigger (or function) so it does not read that table.

 

後來找到在 Trigger 使用 pragma autonomous_transaction 可以避免一些 Transaction 問題,

加上去後,果然是可以順利的觸發 Trigger , Thanks Google.

 

另外在補充一點,不只是 Trigger 可以使用  ,例如像自行定義的給號 Oracle Function 也可以加上去,

可以讓很單純的給號程式,可以直接在 Insert 指令做完,例如

Select GetSeqno('活動序號')  from dual
Insert Into Actioin (Seqno,ActionName) values ( GetSeqno('活動序號'),'到訪1萬人次活動');
 

[SSIS] The RPC server is unavailable

從遠端用 SQL 2005 Management Studio 連接 SSIS 服務時,遇到了 The RPC server is unavailable 問題,

 

後來發現是防火牆的問題,查到 SQL 2005 Book 的 HOW TO ,順便引用一下,也提醒一下自己

 

How to: Configure a Windows Firewall for Integration Services Access

To configure the Windows XP Firewall or Windows Server 2003 Firewall

  1. In the Control Panel, double-click Windows Firewall.

  2. In the Windows Firewall dialog box, click the Exceptions tab and then click Add Program.

  3. In the Add a Program dialog box, click Browse, navigate to the Program Files\Microsoft SQL Server\90\DTS\Binn folder, click MsDtsSrvr.exe, and then click Open. Click OK to close the Add a Program dialog box.

  4. On the Exceptions tab, click Add Port.

  5. In the Add a Port dialog box, type RPC(TCP/135) or another descriptive name in the Name box, type 135 in the Port Number box, and then select TCP.

    Important:

    Integration Services service always uses port 135. You cannot specify a different port.

  6. In the Add a Port dialog box, you can optionally click Change Scope to modify the default scope.

  7. In the Change Scope dialog box, select My network (subnet only) or type a custom list, and then click OK.

  8. To close the Add a Port dialog box, click OK.

  9. To close the Windows Firewall dialog box, click OK.

http://msdn2.microsoft.com/en-us/library/ms141198.aspx

2008/03/05

Tips-如何開啟 TOAD 背景執行指令功能?

這個是 TOAD 殺手級必要設定的選項,可以讓你的 TOAD 不會卡住,趕快找出來勾起來吧!!

clip_image002

2008/01/25

[prototype.js] AJAX and SJAX Cool~

很久以前,公司有一個系統是用 Microsoft JVM 拿 Remote Scripting 做 Web 2.0 應用,

後來,慘了,Microsoft JVM 侵權,而且後來的 Sun JVM 又不支援,這個系統就一直被吊起來,

每次檢討會都是躂伐的重點項目,後來拿了 Filddler 仔細的研究了一下,其實應用到真正 Remote Scripting

還有一段距離,原理就不多說了,一句話,就是用 RSExecute(url,method,params a,b,c,d,e,.....) 來回傳 Server 物件。

後來研究了 Microsoft Altas (ASP.NET Ajax Extension) 及 Prototype Framework (prototype.js;http://www.prototypejs.org/)後,

決定使用 Prototype Framework,原因無他,還是一句話,支援 AJAX & SJAX !!!!

開始動心臟手術吧…

↓這是 Remote Scripting 的入口程式,從這邊動手先,將裡面的 invokeMethod 換掉!!

   1: function RSExecute(url,method)
   2: {
   3:     var cb, ecb, context;
   4:     var params = new Array;
   5:     var pn = 0;
   6:     var len = RSExecute.arguments.length;
   7:     for (var i=2; i < len; i++)
   8:         params[pn++] = RSExecute.arguments[i];
   9:     
  10:     return invokeMethod(url,method,params);
  11: }

↓這是改換成 Prototype ,換完後,就快了,很像 Remote Scripting 皮 Prototype 骨。

   1: function invokeMethod(url,method,params)
   2: {
   3:     var rtnValue=null;
   4:         if (url.length=0) {return;}
   5:         var action_url=buildURL(url,method,params);
   6:         var objAjax =new Ajax.Request(action_url, {
   7:           method: 'get',asynchronous:false,
   8:           onSuccess: function(transport) {
   9:             rtnValue = transport
  10:           }
  11:         });
  12:         return rtnValue;
  13: }

要注意 Line 7 中,有一個 Option 為 asynchronous:false,這是一個關鍵,這可以變成 SJAX 可以在 RSExecute 時回傳 Server 處理結果。

哇哈哈~這樣子就可以告別 Microsoft JVM 的毒害了。

謝謝收看。

 

相關文章:

黑暗大哥也提供 Altas SJAX version

http://www.ridgway.co.za/archive/2007/10/30/using-synchronous-asp.net-ajax-web-service-calls-and-scriptaculous-to.aspx

2008/01/24

[SSIS] Microsoft OLEDB for Oracle and SQL Command with Parameters Issue

之前在設定與 Oracle 轉檔時,使用 Microsoft OLEDB for Oracle ,當要使用參數傳入時,卻出現以下訊息:

Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" access mode, in which the entire SQL command is stored in a variable.

提供者無法衍生參數資訊且 SetParameterInfo 未被呼叫。 (Microsoft OLE DB Provider for Oracle)

 

在 DataFlow 的 OLE Source 中,Build Query 都是成功的,但是要按下 Paramenters 按鈕時,就會出現這些問題。

例如,想要將某個區間的資料,轉入系統,通常會寫

select * from MichaelData where StartDT between :sdt and :edt

解決方式如下:

  • 移至 Control Flow 頁籤中,設定變數 string temp_insert_sql , string startYMD , string endYMD
    並點選變數視窗中的 temp_insert_sql 變數(很重要,我也找了好久),按下 F4 跳出內容視窗,在 Expression 輸入
    "SELECT * FROM  MichaelData WHERE StartYMD BETWEEN '"+ @[User::startYMD] +"' AND '"+ @[User::endYMD] +"') and ....."
     
  • 新增一個 Scripting Task,在執行 DataFlow 之前,用來填入 sql command,進入 Edit 時,輸入 ReadWriteVariables = strYMD,endYMD
    SNAG-01-24-01
  • 再點入下方 Design Script...
    Dim bt(0) As Byte
    If Dts.Variables("startYMD").Value.ToString() = "" Or Dts.Variables("endYMD").Value.ToString() = "" Then
        Dts.Variables("startYMD").Value = DateTime.Now.AddDays(-7).ToString("yyyyMMdd")
        Dts.Variables("endYMD").Value = DateTime.Now.ToString("yyyyMMdd")
    End If
    
    Dts.Log("startYMD:" & DateTime.Now.AddDays(-7).ToString("yyyyMMdd"), 0, bt)
    Dts.Log("endYMD:" & DateTime.Now.ToString("yyyyMMdd"), 0, bt)
    
    Dts.TaskResult = Dts.Results.Success
     
  • 這樣子 Scripting Task 就完成了,可以再回頭來做 DataFlow 中的 OLE Source 設定
    SNAG-01-24-02

 

這樣子就 OK 囉,不會出錯了。

2008/01/18

[SSIS][KB]DefaultCodePage Problem

[OLE DB Source [1343]]: Cannot retrieve the column code page info from the OLE DB provider.  If the component supports the "DefaultCodePage" property, the code page from that property will be used.  Change the value of the property if the current string code page values are incorrect.  If the component does not support the property, the code page from the component's locale ID will be used.

 

在 SSIS 中使用 Microsoft OLEDB for Oracle ,通常就會遇到這個問題,找了很多討論區,都說...

AlwaysUseDefaultCodePage = true 就ok....但是我就是一直找不到…

 

後來發現在 OLEDB Source 點一下後,選 Properities (不是選 Edit),如下圖,就會出現了

SNAG-01-18-02

另外也有人說到,這個選項可能在 SQL 2005 RTM 版本沒有,至少要到 Service Pack1 才看得到。

 

參考文章

http://forums.microsoft.com/msdn/showpost.aspx?postid=117014&siteid=1

[SSIS][KB]Column xxx cannot convert between unicode and non-unicode string data types

在 SSIS 轉檔時,遇到這樣子的錯誤訊息。

環境:

Source : Microsoft OLEDB For Oracle

Dest : Oracle OLEDB

解決方式應該有很多種:

方式一:

Dest 改為 Microsoft OLEDB For Oracle 即可

 

 

.... 待續