ASP(Active Server Pages) ソースコード公開
WEB DE 顧客管理はすべてのソースコードが公開されています。
ソースはカスタマイズしやすくコメントが随所に記されています。
|
<% Const blnDEMO = True ' デモフラグ 閲覧のみになります。 Const blnAllView = False ' 起動時にすべての顧客を表示するかどうか Const intMax = 10 ' 顧客一覧で表示する1ページあたりのレコード数 Const intTimeout = 60 ' 指定された時間操作がない場合ログインは無効 Const strValidPWD = "guest" ' ログインパスワード Const strAdminPWD = "admin" ' 管理用パスワード Const blnNeedLogin = True ' ログイン要・不要 フラグ Const strDateQT = "#" ' 日付引用符 [#]-MDB [']-Oracle, SQL Server Const APPINDEXHTM = "index.htm" ' インデックスファイル Const APPINDEXASP = "index.asp" ' 初期処理 Const APPCUSLIST = "cuslist.asp" ' 顧客一覧 Const APPCUSEDIT = "cusedit.asp" ' 顧客マスタ編集 Const APPNOTELIST = "notelist.asp" ' 対応記録一覧 Const APPNOTEEDIT = "noteedit.asp" ' 対応記録編集 Const APPSALESLIST = "saleslist.asp" ' 購入履歴一覧 Const APPOPENQRY = "openqry.asp" ' ユーザークエリー実行 Const APPQRYLIST = "qrylist.asp" ' ユーザークエリー一覧 Const APPQRYEDIT = "qryedit.asp" ' ユーザークエリー編集 |
汎用性を高めるために処理ごとにプロシージャにまとめられています。
|
Private Function GetAppPath() '// スクリプトの物理パスを取得する Dim strTempDir strTempDir = Request.ServerVariables("SCRIPT_NAME") strTempDir = StrReverse(strTempDir) strTempDir = Mid(strTempDir, InStr(1, strTempDir, "/")) strTempDir = StrReverse(strTempDir) GetAppPath = Server.MapPath(strTempDir) & "\" End Function Private Function GetIncrement(strTable, strField) '// インクリメント値を取得する ' strTable テーブル名 ' strField フィールド名 Dim strSQL, rsTemp strSQL = "select MAX(" & strField & ") from " & strTable Set rsTemp = cn.Execute(strSQL) If rsTemp.EOF Then GetIncrement = 0 ElseIf IsNull(rsTemp.Fields(0).Value) Then GetIncrement = 0 Else GetIncrement = rsTemp.Fields(0).Value + 1 End If End Function |
©2001 Inside Soft Design. All rights
reserved.