日記

Access 切り上げRoundUp 切り捨てRoundDown 四捨五入Round

1 Mins read

久しぶりにAccess触ったら嵌ったので・・・・

なんだこのVBA関数は・・・まともに動かん


'*******************************************************************************************
'注意!!!!!!!!!
'AccessのRound,Int,FIx関数はバグっているので、自ら作成する!
'*******************************************************************************************
'切り上げ
Public Function com_RoundUp(X As Currency, S As Integer) As Currency
 
Dim W As Currency
 
W = 10 ^ Abs(S)
If S > 0 Then
com_RoundUp = Int(X * W + 0.999) / W
Else
com_RoundUp = Int(X / W + 0.999) * W
End If
 
End Function
 
'切り捨て
Public Function com_RoundDown(X As Currency, S As Integer) As Currency
 
Dim W As Currency
 
W = 10 ^ Abs(S)
 
If S > 0 Then
com_RoundDown = Int(X * W) / W
Else
com_RoundDown = Int(X / W) * W
End If
 
End Function
 
'四捨五入
Public Function com_Round(X As Currency, S As Integer) As Currency
Dim t As Integer
 
t = 10 ^ Abs(S)
 
If S > 0 Then
com_Round = Int(X * t + 0.5) / t
Else
com_Round = Int(X / t + 0.5) * t
End If
 
End Function

MSからGetだけ。。。ど(^^;)

Read more
ApacheLinuxMySQL

Redmine 1.3 Subversion 1.6.11 連携 Basic認証エラー mod_auth_mysql

1 Mins read

環境、CentOS6.2、Apache2.2.15、Redmine1.3、Subversion1.6.11、Mysql5.5.20

Redmine1.3を使用しRedmineのユーザーをWebBasic認証(mod_auth_mysql)とリンクさせて使用する際にエラーとなったので覚書しとく

基本的に上位アプリは正しくセットアップされて単独で動く状態からの処理となる

原因はRedmine1.2よりパスワード保持方法が変更となった、この変更にmod_auth_mysqlがついていけないことが原因。(SHA1+saltとなった)

1.mod_auth_mysqlのソースをここからDownload

2.Mysql5.0系用のpacheをDownし「1」のソースファイル当てる

3.Redmineで使用している認証方法をここからDownし「2」のソースファイル当てる

これでソースのある下位層まで「cd」してコンパイル開始Go!

/usr/sbin/apxs -ci -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lz -lm mod_auth_mysql.c

・・・

「make_scrambled_password error」となりコンパイルが通らない・・・

どうやら「make_scrambled_password」用のシンボリックリンクが見つからないらしい、Mysqlのソースを追加すれば行けそうだけど、そもそも「make_scrambled_password」を使用する気はないので、コメントアウトとする。

make_scrambled_password関連個所のソースをコメントにし、再度コンパイル・・・

無事に「mod_auth_mysql.so」完成!

使ってみる・・・OKそう

AuthMySQLEnable On
AuthMySQLSocket /var/lib/mysql/mysql.sock
AuthMySQLHost [DB Host名]
AuthMySQLUser [DB接続User名]
AuthMySQLPassword [DB接続PW]
AuthMySQLDB [接続DB名]
AuthMySQLUserTable [確認Table名]
AuthMySQLNameField [確認IDフィールド名]
AuthMySQLPasswordField [確認PWフィールド名]
AuthMySQLSaltField salt
AuthMySQLPwEncryption sha1-rm
AuthMySQLNoPasswd Off
#AuthMySQLCharacterSet UTF-8
 
#AuthGroupFile /dev/null
AuthType Basic
AuthName "Authorization SVN"
Require valid-user

編集ソースとコンパイル後のファイルを置いておきますが、何が起こっても自己責任でお願いしますね。

Read more
ASP.NETPHPWindows Server

Team Foundation Server 2010 Install

1 Mins read

Team Foundation Server 2010、テスト導入してみたよ!

以下の順番でインストール

1.SQL Server 2008R2 Standard(x64)

2.Sharepoint Server 2010 with sp1(x64)

3.Team Foundation Server 2010(x64)

4.Team Foundation Server 2010 sp1

これでTeam Foundation Serverマネージャーで構成開始

うまくダッシュボード上のグラフが表示されない・・・はて

Windows UpdateやったらOfficeのOWCコンポーネントがUpdateされて、表示OKに!
そういえばOWC11以降は無くなるような記事が出てたけど・・・

VSSにバイバイできるかなぁ

Read more