投稿

4月, 2013の投稿を表示しています

MS Access 2010 の VBA にて プリンタ枚数 を指定しても反映されない

症状 Private Sub PrintReport(inReportName As String, inPrinter As Printer, inCopiesNumber As Integer) DoCmd.OpenReport inReportName, acViewDesign, , , acHidden
Set Application.Printer = inPrinter
Application.Printer.Copies = inCopiesNumber
DoCmd.OpenReport inReportName
DoCmd.Close acReport, inReportName, acSaveNo
Set Application.Printer = Nothing End Sub  対処  Private Sub PrintReport(inReportName As String, inPrinter As Printer, inCopiesNumber As Integer)
DoCmd.OpenReport inReportName, acViewPreview DoCmd.SelectObject acReport, inReportName, False
Set Application.Printer = inPrinter
DoCmd.PrintOut , , , , inCopiesNumber
DoCmd.Close acReport, inReportName
Set Application.Printer = Nothing End Sub 参考 http://support.microsoft.com/kb/2627824

vagrant up error occurred ”Failed to connect to VM!"

症状  $ vagrant up [default] VM already created. Booting if it's not already running...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] Failed to connect to VM!
Failed to connect to VM via SSH. Please verify the VM successfully booted
by looking at the VirtualBox GUI. 対処 ダウンロードしてくるboxを x86_64 ではなく、i386 のboxにしてみる。

PostgreSQL ALTER COLUMN TYPE with time zone -> timestamp without time zone

CREATE TABLE public.sampletable(d timestamp(0) with time zone);
INSERT into sampletable VALUES('2013-04-18 13:00');


SELECT * FROM sampletable

d timestampe(0) with time zone
---------------------------
"2013-04-18 13:00:00+09"

ALTER TABLE sampletable
    ALTER COLUMN d TYPE timestamp(0) without time zone
        USING d AT TIME ZONE '-9:00:00';

About '-9:00:00' :
   Select -1 * (current_timestamp - current_timestamp AT TIME ZONE 'UTC') As TimeZoneOffSet

SELECT * FROM sampletable

d timestampe(0) with time zone
---------------------------
"2013-04-18 13:00:00"

Windows環境のPythonでAttributeError 「module' object has no attribute 'client'」 が発生

症状 >>> import win32com
>>> xlApp = win32com.client.Dispatch("Excel.Application")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'client'

対処 >>> import win32com.client

knife solo init で起こるエラー uninitialized constant KnifeSolo::Pathname (NameError)

症状  $ knife solo init chef-repo
Creating kitchen...
Creating knife.rb in kitchen...
ERROR: knife encountered an unexpected error
This may be a bug in the 'solo init' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NameError: uninitialized constant KnifeSolo::Pathname 対処 sudo find / -name knife-solo.rb で見つかったファイルに対して、

require 'pathname'を追加する。 詳細  $ knife solo init chef-repo -VV
Creating kitchen...
Creating knife.rb in kitchen...
/usr/lib/ruby/gems/1.8/gems/knife-solo-0.3.0.pre3/lib/knife-solo.rb:5:in `resource': uninitialized constant KnifeSolo::Pathname (NameError)
        from /usr/lib/ruby/gems/1.8/gems/knife-solo-0.3.0.pre3/lib/chef/knife/solo_init.rb:62:in `create_config'
        from /usr/lib/ruby/gems/1.8/gems/knife-solo-0.3.0.pre3/lib/chef/knife/solo_init.rb:28:in `run'
        from /usr/lib/ruby/gems/1.8/gems/chef-11.4.0/lib/chef/knife.rb:460:in `run_with_pretty_except…

CentOS 6.3 に Virtual-Boxを入れる

手順 1. ダウンロード wget http://download.virtualbox.org/virtualbox/4.2.10/VirtualBox-4.2.10-84104-Linux_amd64.run 2. 実行できるようにパーミッション変更 chmod 777 ./VirtualBox-4.2.10-84104-Linux_amd64.run  3. 実行  sudo ./VirtualBox-4.2.10-84104-Linux_amd64.run
4. OS再起動 reboot reboot
エラー  Please install the build and header files for your current Linux kernel. の場合 sudo yum install gcc kernel kernel-devel