用CB创建ACCESS数据库后MSysObjects的权限问题
现在用CB动态创建一个ACCESS数据库并对新建的数据库用程序添加表
在后期的应用中要对MSysObjects访问获得表名
SELECT NAME FROM MSysObjects WHERE TYPE=1
OleInitialize(NULL); Variant vCreateAccess; Procedure PCreateAccess("Create"); PCreateAccess << "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DBName + ".mdb"; vCreateAccess = CreateOleObject("ADOX.Catalog"); vCreateAccess.Exec(PCreateAccess ); OleUninitialize()
vCreateAccess.Exec(PCreateAccess);vCreateAccess.OlePropertyGet("Users", "Admin").OleFunction("SetPermissions", "MSysObjects ", 1, // adPermObjTable, 2, // adAccessSet, 0x10000000L );OleUninitialize();