發表文章

目前顯示的是 七月, 2012的文章

ProcessInfo 1.5 is released with Win64 support

想取得程序的Handle等其它資訊還蠻好用的

ProcessInfo 1.5 is released with Win64 supportPosted on September 12th, 2011Ali Keshavarz5 comments ProcessInfo 1.5 is released. The changes in this release are:
Added support for Win64 and Delphi XE2. Added TProcessItem.CloseProcess method to close a process normally (not forcefully). Added TProcessItem.CurrentProcess property. This property always refers to the current process in the list of running processes.Added PrivateWorkingSetSize property to TProcessItem.MemoryInfo. Added global  ProcessInformation function. This function returns a global instance of TProcessInfo. The instance will be freed when the application is terminating. Fixed a few minor bugs. To download ProcessInfo 1.5, please go to ProcessInfo page.


SQL Server月份相減跨年度的計算方法

SET @YY='2012'
SET @MM='03'
SET @MM=@MM - 5

  IF @MM <= 0
  BEGIN
      SET @YY=@YY - 1
      SET @MM=@MM + 12
  END

雖然好像有更好的作法,但找到之前還是將就點吧

Open dbExpress 安裝

圖片
http://sourceforge.net/projects/open-dbexpress/files/dbxoodbc%202012%20-%20dbx%20ODBC%20driver/dbxoodbc_3_2012_0716dev.7z/download

一、首先是先安裝bpl到RAD Studio裡面
dbxoodbc\lib\{%DelphiVersion%}\dbxoodbc*.bpl
以XE2來看的話,就會是在「dbxoodbc\lib\delphi-2012(16)XE2\win32」(32bit)目錄裡面

二、接下來再把dbxoodbc\lib\dbxoodbc_driver\(%Platform%)\release目錄裡的相關檔案複製到系統路徑
以Win32系統為例,就是把「dbxoodbc\lib\dbxoodbc_driver\win32\release」複製到Delphi安裝目錄裡的bin資料夾下,也就是「{%DELPHI}\Bin」

三、接下來是要註冊 dbxconnections.ini 及 dbxdrivers.ini
說真的,這兩個檔案不是放在特定資料夾中,常常會找不到它們
以我的XE2為例,它們是放置在「c:\users\public\documents\RAD Studio\dbExpress\9.0」目錄中,如果你的電腦沒有的話,可以在底下的機碼中尋找「[HKEY_CURRENT_USER\Software\Embarcadero\BDS\9.0\DBExpress」

台灣大多數的人都是用SQL Server,所以我們就以它的設定為範本:
===dbxconnections.ini===
;--------------------------------------------------------------------------------------------------
[dbxoodbc_SS_DirectMode]
DriverName=DbxSQLServer
GetDriverFunc=getSQLDriverODBCW
VendorLib=sqlsrv32.dll;sqlncli10.dll;sqlncli.dll;odbc32.dll
Trusted_Connection=No
User_Name=…