using the system.mdw file makes it easier to write programs that leave the database locked after the program exits.
The following modification to the demo seems to overcomes the “Record(s) cannot be read; no read permission on MSysObjects” problem without needing to change the security on the database though Access Menus.
我看上面一段英文,好象修改system.mdw就可以获得读取这个表的权限了,但是我没看懂怎么做,各位高手看懂了吗?谢谢
改动是指在ACCESS中手动获取MsysObjects表的读取权限。
1. Open Microsoft Access
2. From the Tools menu, select the Options menu option
3. On the View tab, click the System Objects checkbox
4. Click OK to save your changes
5. From the Tools menu, select the Security -> User and Group Permissions menu option
6. Click the Permissions tab
7. Select the Table entry in the Object Type combo box
8. Select the Admin userid in the User/Group Name listbox
9. In the Object Name listbox, select the MSysObjects entry
10. In the Permissions group box, check the Read Data check box
这个好象与使用DAO和ADO访问关系不大啊,我在一个网站上发现下面一段程序但是看不大明白,高手能不能帮分析一下?
using the system.mdw file makes it easier to write programs that leave the database locked after the program exits.
The following modification to the demo seems to overcomes the “Record(s) cannot be read; no read permission on MSysObjects” problem without needing to change the security on the database though Access Menus.
use header #include "AFXDAO.H" to use the DAO functions and classes below
************************************************************************
In CAccessReportViewerDoc.cpp add function
void SetSystemDB( CString & strSystemMDB )
{
COleVariant varSystemDB( strSystemMDB, VT_BSTRT );
// Initialize DAO for MFC
AfxDaoInit( );
DAODBEngine* pDBEngine = AfxDaoGetEngine( );
ASSERT( pDBEngine != NULL );
// Call put_SystemDB method to set the
// system database for DAO engine
DAO_CHECK( pDBEngine->put_SystemDB( varSystemDB.bstrVal ) );
}
and modify function
BOOL CAccessReportViewerDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
//modify this to point to your system.mdw
CString strSystemDB =
_T( "C:\\Documents and Settings\\John\\Application Data\\Microsoft\\Access\\System.mdw" );
static bool bSetSystemDB=false;
if(bSetSystemDB==false)
{
SetSystemDB( strSystemDB );
bSetSystemDB=true;
}
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
m_pAccessReports = new CAccessReports(lpszPathName, TRUE);
return TRUE;
}
*********************************************************************************
In CAccessReportViewerDoc.cpp add and modify function
int CAccessReportViewerApp::ExitInstance()
{
// TODO: Add your specialized code here and/or call the base class
//terminates the DAO database engine
AfxDaoTerm( );
return CWinApp::ExitInstance();
}
他是怎么不通过ACCESS的菜单而自动获取这个表的权限的呢???