{"id":4982,"date":"2014-06-19T16:31:22","date_gmt":"2014-06-19T20:31:22","guid":{"rendered":"http:\/\/nycphantom.com\/journal\/?p=4982"},"modified":"2014-06-19T16:39:09","modified_gmt":"2014-06-19T20:39:09","slug":"ms-access-security","status":"publish","type":"post","link":"https:\/\/nycphantom.com\/journal\/?p=4982","title":{"rendered":"MS Access Security"},"content":{"rendered":"<p>Someone has finally accessed the database window intentionally at work. So I am taking extra steps to secure it, something I had hoped didn't happen.<\/p>\n<p>To hide access to the Database Window or Navigation Pane in 2007.<\/p>\n<p>Sources referred:<br \/>\n<a href=\"http:\/\/www.tek-tips.com\/viewthread.cfm?qid=925287\" target=\"_blank\">http:\/\/www.tek-tips.com\/viewthread.cfm?qid=925287<\/a><\/p>\n<p><a href=\"http:\/\/access.mvps.org\/access\/api\/api0069.htm\" target=\"_blank\">http:\/\/access.mvps.org\/access\/api\/api0069.htm<\/a><br \/>\n<a href=\"%20http:\/\/access.mvps.org\/access\/general\/gen0031.htm\" target=\"_blank\"> http:\/\/access.mvps.org\/access\/general\/gen0031.htm<\/a><\/p>\n<p><a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/office\/en-US\/0a34dbec-5078-4e16-b6a7-78f62c39f1bf\/vba-navigation-pane?forum=accessdev\" target=\"_blank\">http:\/\/social.msdn.microsoft.com\/Forums\/office\/en-US\/0a34dbec-5078-4e16-b6a7-78f62c39f1bf\/vba-navigation-pane?forum=accessdev<\/a><\/p>\n<p>-----------<\/p>\n<p>To show the database window, run<br \/>\nDocmd.SelectObject acTable, , True<\/p>\n<p>To Hide the database window, run<br \/>\nDocmd.SelectObject acTable, , True<br \/>\nDocmd.RunCommand acCmdWindowHide<\/p>\n<p>---------------------------<\/p>\n<p><em> You can use this function which will return True if the window is currently visible inside the MDI Client window of the application.<\/em><\/p>\n<pre><span class=\"CComment\">'***************** Code Start *****************\r\n' This code was originally written by Dev Ashish.\r\n' It is not to be altered or distributed,\r\n' except as part of an application.\r\n' You are free to use it in any application,\r\n' provided the copyright notice is left unchanged.\r\n'\r\n' Code Courtesy of\r\n' Dev Ashish\r\n'<\/span>\r\nPrivate Declare Function FindWindowEx _\r\n    Lib \"user32\" Alias \"FindWindowExA\" _\r\n    (ByVal hwndParent As Long, _\r\n    ByVal hwndChildAfter As Long, _\r\n    ByVal lpszClass As String, _\r\n    ByVal lpszWindow As String) _\r\n    As Long\r\n    \r\nPrivate Declare Function GetWindowLong _\r\n    Lib \"user32\" Alias \"GetWindowLongA\" _\r\n    (ByVal hWnd As Long, _\r\n    ByVal nIndex As Long) _\r\n    As Long\r\n\r\nPrivate Const GWL_STYLE = (-16)\r\nPrivate Const WS_VISIBLE = &amp;H10000000\r\n\r\nPublic Function fIsDBCVisible() As Boolean\r\n<span class=\"CComment\">'\r\n' Returns true if the Database container\r\n' window is currently visible\r\n'<\/span>\r\n    Dim lngStyle As Long\r\n    Dim hWnd As Long\r\n    Const WC_MDICLIENT = \"MDIClient\"\r\n    Const WC_DBC = \"Odb\"\r\n\r\n    <span class=\"CComment\">' Find the MDIClient window first<\/span>\r\n    hWnd = FindWindowEx(hWndAccessApp, 0, _\r\n                WC_MDICLIENT, vbNullString)\r\n    <span class=\"CComment\">' Find the db container window<\/span>\r\n    hWnd = FindWindowEx(hWnd, 0, WC_DBC, vbNullString)\r\n\r\n    If (hWnd) Then\r\n        <span class=\"CComment\">' retrieve the window style<\/span>\r\n        lngStyle = GetWindowLong(hWnd, GWL_STYLE)\r\n        fIsDBCVisible = ((lngStyle And WS_VISIBLE) = WS_VISIBLE)\r\n    End If\r\n    \r\nEnd Function\r\n<span class=\"CComment\">'***************** Code Start *****************<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Someone has finally accessed the database window intentionally at work. So I am taking extra steps to secure it, something I had hoped didn't happen. To hide access to the Database Window or Navigation Pane in 2007. Sources referred: http:\/\/www.tek-tips.com\/viewthread.cfm?qid=925287 &hellip; <a href=\"https:\/\/nycphantom.com\/journal\/?p=4982\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,3],"tags":[],"class_list":["post-4982","post","type-post","status-publish","format-standard","hentry","category-projects","category-technical"],"_links":{"self":[{"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/4982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4982"}],"version-history":[{"count":2,"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/4982\/revisions"}],"predecessor-version":[{"id":4984,"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/4982\/revisions\/4984"}],"wp:attachment":[{"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}