2019年7月1日 星期一

做過的事,很快就忘..<是該記錄一下!!>.


今天要做一個過濾的動作,將新的暫存 Table (A)  及舊的Table (B) 做一個過濾的動作,取得存在於暫存Table 但不在舊 Table 上的新資料。
找到有人整理清析的說明圖,一目了然!

Select <xxx>
From Table A (從暫存Table A中)
Left Join Table B (加入舊Table B的項目)
on A.key = B.key (設定 A、B Table 相等的是Key )
Where B.key is null (只取 B  Table Key 值是空的,即刪除A、B重疊的項目的意思)





完整參考如下:
https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins

2015年5月4日 星期一

Domino Mail Box issue : The database is taken offline and cannot be opened

今天第一次遇到Domino Server 的Database 變為離線,紀錄一下 :

嘗試開啟資料庫,會出現錯誤訊息:

"database is being taken offline and cannot be opened"


也不能在Server Console 下load fixup/compact/updall  等 command,

測試將資料庫移動到其他目錄,可在 Server 的 命令提示字元 下,nfixup/ncompact/nupdall 等command.

最後, 找到這篇 Petter Blog

做一個Agent , 並Run 在Server 上. (tell agent run "agent_database.nsf" 'agent_name')

Option Public
Option Declare

Declare Private Function NSFBringDatabaseOnline Lib "nnotes" Alias "NSFBringDatabaseOnline" (  Byval dbPath As String, Byval Z As Long) As Integer

Sub Initialize

Call NSFBringDatabaseOnline("mail/abc.xyz.nsf",0) -> abc.xyz.nsf 更換為異常的資料庫

End Sub

2014年11月25日 星期二

VB.Net 的 路徑 在 Schedule Job 與 Command Prompt 差在哪?

執行 這篇 的說明, 得到下面的值.. 紀錄一下.. 否則看xxx 的說明, 也會曲解意思.. 

Schedule Tasks (排程)下的執行結果: 
1.取得和設置當前目錄(即該進程從中啟動的目錄)的完全限定路徑。 
System.Environment.CurrentDirectory: 
結果:C:\Windows\system32 

2.取得啟動了應用程序的可執行文件的路徑,不包括可執行文件的名稱。 
System.Windows.Forms.Application.StartupPath: 
結果:D:\EvnPathTest\EvnPathTest\bin\Debug 

3.取得應用程序的當前工作目錄。 
System.IO.Directory.GetCurrentDirectory(): 
結果:C:\Windows\system32 

4.取得當前 Thread 的當前應用程序域的基目錄,它由程序集衝突解決程序用來探測程序集。 
System.AppDomain.CurrentDomain.BaseDirectory: 
結果:D:\EvnPathTest\EvnPathTest\bin\Debug\ 

5.取得和設置包含該應用程序的目錄的名稱。 
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase: 
結果:D:\EvnPathTest\EvnPathTest\bin\Debug\ 

6.取得啟動了應用程序的可執行文件的路徑,包括可執行文件的名稱。 
System.Windows.Forms.Application.ExecutablePath: 
結果:D:\EvnPathTest\EvnPathTest\bin\Debug\EvnPathTest.exe 

7.取得當前執行的exe的文件名。 
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName: 
結果:D:\EvnPathTest\EvnPathTest\bin\Debug\EvnPathTest.exe 

8.取得當前進程的完整路徑,包含文件名。 
Me.GetType().Assembly.Location: 
結果:D:\EvnPathTest\EvnPathTest\bin\Debug\EvnPathTest.exe 


命令提示字元(Command Prompt)下的執行結果: 
1.取得和設置當前目錄(即該進程從中啟動的目錄)的完全限定路徑。 
System.Environment.CurrentDirectory: 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug 

2.取得啟動了應用程序的可執行文件的路徑,不包括可執行文件的名稱。 
System.Windows.Forms.Application.StartupPath: 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug 

3.取得應用程序的當前工作目錄。 
System.IO.Directory.GetCurrentDirectory(): 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug 

4.取得當前 Thread 的當前應用程序域的基目錄,它由程序集衝突解決程序用來探測程序集。 
System.AppDomain.CurrentDomain.BaseDirectory:
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug\ 

5.取得和設置包含該應用程序的目錄的名稱。 
System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase: 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug\ 

6.取得啟動了應用程序的可執行文件的路徑,包括可執行文件的名稱。 
System.Windows.Forms.Application.ExecutablePath: 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug\EvnPathTest.exe 

7.取得當前執行的exe的文件名。 
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName: 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug\EvnPathTest.exe 

8.取得當前進程的完整路徑,包含文件名。 
Me.GetType().Assembly.Location: 
結果:D:\Work\VBWork\EvnPathTest\EvnPathTest\bin\Debug\EvnPathTest.exe 


由結果來看, 系統排程與手動執行差在 :GetCurrentDirectory 及 CurrentDirectory 

2014年5月9日 星期五

以 lmhosts 指定網域控制器位置

有點困擾的問題.. 紀錄一下.. 

最近有一個 單一認證服務(SSO) 的網站 , 有加入網域, DNS 伺服器是指向網域控制器(DC)

但是因為某種原因,DNS必須指到外部DNS 。

這個改變造成 網站無法單一登入。

覺得應該是外部DNS 不知道 網域控制器在哪兒,因此需用於 lmhosts 來另外指定。

參考這份參考文件  ,第一行指定"網域名稱"(需大寫),第二行指定網域控制器是哪一台機器名稱

如有兩台以上的網域控制器,可往下加。

設定好後,用 

C:\> nbtstat -R => 清除並重新載入NetBIOS cache

C:\> nbtstat -c => 列出 NetBIOS Cache name table. 






2014年4月24日 星期四

Free 且可設定PDF 文件到期日的PDF保全軟體

找到好東西,紀錄一下....

目前Office 2010/2013 可以將文件於另存新檔時,轉存成PDF格式。方便好用,但缺點是缺少一般安全性的功能。 

一般Free 免費的PDF製作軟體,如: doPDF, PDF Creator 等,是透過安裝成虛擬印表機的方式,於文件列印時,透過虛擬印表機列印製作成PDF,能做到一般的禁止列印、禁止擷取或開啟需密碼等,但不能做到設定文件過期的功能。

今天找到一套 Free 的,可以設定 "文件期限"(Document Expired Time )的PDF 保全軟體(PDF Security OwnerGuard )。

以下是12.7.8 個人版的畫面,

1. 建立新計畫:
    第一步:點選 "Create New Project" 建立計畫名稱

  第二步:設定時間限制 (Time Limitation ) 的到期日。

2. 開始加密PDF: 點選主頁面的 【Protect Your File】
    第一步:挑選檔案:  


    第二步:挑選專案(Project):  

     第三步:設定開啟密碼

    第四步:挑選浮水印的檔案: 只有第一頁會被當成浮水印..  ,否則就用預設,無浮水印(No Watermark)

    第五步:設定匯出目錄:   並點選【Protect Security Files】來進行轉出。

這樣就完成了~



2014年1月17日 星期五

救回遺失Windows 2008R2 的100MB :Bootmgr is missing

話說今天一台Windows 2008 R2機器發生硬體(磁碟)問題,作業系統無法運作,臨時倒備份的IMAGE,才發現缺少關鍵的系統保留碟(System Reserved)。

開機後,停在BOOTMGR is missing 的字樣,未免忘記,將查到的做法紀錄一下!

 1. Boot from your Windows Server 2008 R2 x64 DVD.
2. Repair
3. Command Prompt
4. rename c:\boot\BCD bcd.old 
5. Bootrec /RebuildBcd  以下設定系統保留碟為系統啟動的第一個磁區。
6. diskpart
 7. select disk 0  (可先用 list 來確認有幾棵disk)
8. select partition 1 (the 100MB partition) (可先用 list 來確認 100MB partition 在第幾個序號)
 9. active 設定完畢
10. exit
11. reboot server and remove DVD 來源連結

2013年12月29日 星期日

遇到MS Office 2010 無法安裝問題

今天遇到『Microsoft Office 2010 不支援從 Microsoft Office 2010 的Prerelease版本升級。您必須先解除安裝任何Microsoft Office 2010 產品及相關技術的Prerelease版本。』的問題

新增/移除程式內已無Office 相關的Program. 就是無法裝,使用 Windows Installer CleanUp 也沒找到。
最後,看到這篇,最後刪 register 才解決。 http://support.microsoft.com/KB/928218
注意 在下列登錄機碼中,星號字元 (*) 代表子機碼名稱中一或多個字元。