VCS_Controls.bas 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Option Compare Database
  2. '****
  3. '*
  4. '* VCS checks
  5. '*
  6. '****
  7. Sub diagnostic()
  8. Dim obj As Object
  9. Dim count As Integer
  10. Dim td As TableDef
  11. Dim qd As QueryDef
  12. Dim oFSO As Object
  13. Set oFSO = CreateObject("Scripting.FileSystemObject")
  14. Dim oFile As Object
  15. Set oFile = oFSO.CreateTextFile("c:\applis_parc\ztest\diag_" & CurrentProject.name & ".txt", ForAppending)
  16. oFile.WriteLine ("# tbl def")
  17. count = 0
  18. For Each td In CurrentDb.TableDefs
  19. 'Debug.Print td.Name
  20. oFile.WriteLine td.name
  21. count = count + 1
  22. Next
  23. Debug.Print "tbldef", count
  24. oFile.WriteLine ("# query def")
  25. count = 0
  26. For Each qd In CurrentDb.QueryDefs
  27. 'Debug.Print qd.Name
  28. oFile.WriteLine qd.name
  29. count = count + 1
  30. Next
  31. Debug.Print "queries", count
  32. oFile.WriteLine ("# reports")
  33. count = 0
  34. For Each obj In CurrentProject.AllReports()
  35. 'Debug.Print obj.Name
  36. oFile.WriteLine obj.name
  37. count = count + 1
  38. Next
  39. Debug.Print "reports", count
  40. oFile.WriteLine ("# forms")
  41. count = 0
  42. For Each obj In CurrentProject.AllForms()
  43. 'Debug.Print obj.Name
  44. oFile.WriteLine obj.name
  45. count = count + 1
  46. Next
  47. Debug.Print "forms", count
  48. oFile.WriteLine ("# macros")
  49. count = 0
  50. For Each obj In CurrentProject.AllMacros()
  51. 'Debug.Print obj.Name
  52. oFile.WriteLine obj.name
  53. count = count + 1
  54. Next
  55. Debug.Print "macros", count
  56. oFile.WriteLine ("# modules")
  57. count = 0
  58. For Each obj In CurrentProject.AllModules()
  59. oFile.WriteLine obj.name
  60. 'Debug.Print obj.Name
  61. count = count + 1
  62. Next
  63. Debug.Print "modules", count
  64. End Sub