vmwareでcentosを起動に失敗する。
/dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
がFAILEDで起動しない。
画面に表示されているメッセージに従ってrootのパスワードを入力する。
fsck -t ext3 /dev/sda1
を実行。
終わったら再起動する。
/dev/sda2と/dev/sda5も同じエラーが出たのでfsckをして再起動する。
2014年4月15日火曜日
2014年4月12日土曜日
access でフォーム・レポートのコントロールソースとクエリをすべて書き出す
アクセスに変更を加えたいが、どこのコントロールで使用しているか分からないときに、すべてを取得してファイルに書き出すして検索。
ついでにクエリのsqlも検索できるように書き出す。
Public Sub CreateAllControlSource()
Dim objFile As Object
Dim strProjectPath As String
Dim strFilePath As String
Dim objWrite As Object
Dim accObj As AccessObject
Dim ctl As Control
Dim Dbs As DAO.Database
Dim Qdf As DAO.QueryDef
Set objFile = CreateObject("Scripting.FileSystemObject")
'ファイルの書き出し
strProjectPath = CurrentProject.Path
strFilePath = objFile.BuildPath(strProjectPath, "WriteData.txt")
Set objWrite = objFile.OpenTextFile(strFilePath, 2, True)
objWrite.WriteLine "----------------- フォーム ---------------------"
'フォームを書き込み
For Each accObj In CurrentProject.AllForms
objWrite.WriteLine accObj.Name
' Debug.Print accObj.Name
DoCmd.OpenForm accObj.Name, acDesign, , , , acHidden
'コントロールを書き込み
objWrite.WriteLine " レコードソース " & Forms(accObj.Name).RecordSource
For Each ctl In Forms(accObj.Name).Controls
If ctl.ControlType = acTextBox Then
'コントロールソースの書き込み
objWrite.WriteLine " " & ctl.Name & " " & ctl.ControlSource
End If
' Debug.Print ctl.Name
Next ctl
DoCmd.Close acForm, accObj.Name
Next accObj
objWrite.WriteLine "----------------- レポート---------------------"
For Each accObj In CurrentProject.AllReports
' Debug.Print accObj.Name
objWrite.WriteLine accObj.Name
' Debug.Print accObj.Name
DoCmd.OpenReport accObj.Name, acDesign, , , , acHidden
'コントロールの書き込み
objWrite.WriteLine " レコードソース " & Reports(accObj.Name).RecordSource
For Each ctl In Reports(accObj.Name).Controls
If ctl.ControlType = acTextBox Then
'コントロールソースの書き込み
objWrite.WriteLine " " & ctl.Name & " " & ctl.ControlSource
End If
' Debug.Print ctl.Name
Next ctl
DoCmd.Close acReport, accObj.Name
Next accObj
'データベースセット
Set Dbs = CurrentDb
'クエリ分ループ
For Each Qdf In Dbs.QueryDefs
objWrite.WriteLine Qdf.Name
objWrite.WriteLine " " & Qdf.sql
Next Qdf
Set Dbs = Nothing
objWrite.Close
Set objWrite = Nothing
Set objFile = Nothing
End Sub
ついでにクエリのsqlも検索できるように書き出す。
- vbaのモジュールに書いてイミディエイトウィンドウで実行
Public Sub CreateAllControlSource()
Dim objFile As Object
Dim strProjectPath As String
Dim strFilePath As String
Dim objWrite As Object
Dim accObj As AccessObject
Dim ctl As Control
Dim Dbs As DAO.Database
Dim Qdf As DAO.QueryDef
Set objFile = CreateObject("Scripting.FileSystemObject")
'ファイルの書き出し
strProjectPath = CurrentProject.Path
strFilePath = objFile.BuildPath(strProjectPath, "WriteData.txt")
Set objWrite = objFile.OpenTextFile(strFilePath, 2, True)
objWrite.WriteLine "----------------- フォーム ---------------------"
'フォームを書き込み
For Each accObj In CurrentProject.AllForms
objWrite.WriteLine accObj.Name
' Debug.Print accObj.Name
DoCmd.OpenForm accObj.Name, acDesign, , , , acHidden
'コントロールを書き込み
objWrite.WriteLine " レコードソース " & Forms(accObj.Name).RecordSource
For Each ctl In Forms(accObj.Name).Controls
If ctl.ControlType = acTextBox Then
'コントロールソースの書き込み
objWrite.WriteLine " " & ctl.Name & " " & ctl.ControlSource
End If
' Debug.Print ctl.Name
Next ctl
DoCmd.Close acForm, accObj.Name
Next accObj
objWrite.WriteLine "----------------- レポート---------------------"
For Each accObj In CurrentProject.AllReports
' Debug.Print accObj.Name
objWrite.WriteLine accObj.Name
' Debug.Print accObj.Name
DoCmd.OpenReport accObj.Name, acDesign, , , , acHidden
'コントロールの書き込み
objWrite.WriteLine " レコードソース " & Reports(accObj.Name).RecordSource
For Each ctl In Reports(accObj.Name).Controls
If ctl.ControlType = acTextBox Then
'コントロールソースの書き込み
objWrite.WriteLine " " & ctl.Name & " " & ctl.ControlSource
End If
' Debug.Print ctl.Name
Next ctl
DoCmd.Close acReport, accObj.Name
Next accObj
'データベースセット
Set Dbs = CurrentDb
'クエリ分ループ
For Each Qdf In Dbs.QueryDefs
objWrite.WriteLine Qdf.Name
objWrite.WriteLine " " & Qdf.sql
Next Qdf
Set Dbs = Nothing
objWrite.Close
Set objWrite = Nothing
Set objFile = Nothing
End Sub
登録:
投稿 (Atom)