By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,777 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,777 IT Pros & Developers. It's quick & easy.

get Msysobject in Access 2003

P: 7
Dear Experts,

if we want to see msysobject in Access 2003, we can use "option" "tool" and check the System Object.

the question is ... i want update the "Option" "tool" with visual basic code in application...?
cos .. if i'm not check this option, then message error " Records cannot be read; no read permission on Msysobject" is rise

well... i m really appreciate for your help

thx 4 ur attention


-junis-
Nov 23 '06 #1
Share this Question
Share on Google+
8 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
This will set the View System Objects to true.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Application.SetOption "Show System Objects", True
  3.  
Mary


Dear Experts,

if we want to see msysobject in Access 2003, we can use "option" "tool" and check the System Object.

the question is ... i want update the "Option" "tool" with visual basic code in application...?
cos .. if i'm not check this option, then message error " Records cannot be read; no read permission on Msysobject" is rise

well... i m really appreciate for your help

thx 4 ur attention


-junis-
Nov 23 '06 #2

P: 7
thank Mary,

btw .. i confused to use your code in my code
there's my code

Expand|Select|Wrap|Line Numbers
  1.    Private Sub UpdateCboTable(ByVal sFileMDB As String)
  2.  
  3.         Me.CboTable.Items.Clear()
  4.  
  5.         strConn ="Provider=Microsoft.jet.oledb.4.0; data source= " & sFileMDB 
  6.         cn = New OleDb.OleDbConnection(strConn)
  7.         cn.Open()
  8.  
  9.         lSQL = "SELECT Name FROM  MSysObjects " & _
  10.                 " WHERE  (Left([Name],4) <> 'MSys')" & _
  11.                 " AND ([Type] In (1, 4, 6)) ORDER BY Name"
  12.  
  13.         cmd = cn.CreateCommand
  14.         cmd.CommandText = lSQL
  15.         Reader = cmd.ExecuteReader()
  16.  
  17.         Do While Reader.Read()
  18.             Me.CboTable.Items.Add(Reader.GetString(0))
  19.         Loop
  20.         Reader.Close()
  21.         cn = Nothing
  22.  
  23.     End Sub
  24.  
any idea with this code ...or maybe i have mistake ...

regards

-junis-

This will set the View System Objects to true.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Application.SetOption "Show System Objects", True
  3.  
Mary
Nov 23 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Expand|Select|Wrap|Line Numbers
  1. Private Sub UpdateCboTable(ByVal sFileMDB As String)
  2.  
  3. Me.CboTable.Items.Clear()
  4.  
  5. strConn ="Provider=Microsoft.jet.oledb.4.0; data source= " & sFileMDB 
  6. cn = New OleDb.OleDbConnection(strConn)
  7. cn.Open()
  8.  
  9. Application.SetOption "Show System Objects", True
  10.  
  11. lSQL = "SELECT Name FROM MSysObjects " & _
  12. " WHERE (Left([Name],4) <> 'MSys')" & _
  13. " AND ([Type] In (1, 4, 6)) ORDER BY Name"
  14.  
  15. cmd = cn.CreateCommand
  16. cmd.CommandText = lSQL
  17. Reader = cmd.ExecuteReader()
  18.  
  19. Do While Reader.Read()
  20. Me.CboTable.Items.Add(Reader.GetString(0))
  21. Loop
  22.  
  23. Application.SetOption "Show System Objects", False
  24.  
  25. Reader.Close()
  26. cn = Nothing
  27.  
  28. End Sub
  29.  
Try this ...
Nov 23 '06 #4

P: 7
i try that code ...
but i get error message

'SetOption' is not a member of 'System.Windows.Forms.Application'.
what i must do ...?
that i missed some Reference ?
Nov 23 '06 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
i try that code ...
but i get error message



what i must do ...?
that i missed some Reference ?
Are you running the code from Access or Visual Basic?
Nov 23 '06 #6

NeoPa
Expert Mod 15k+
P: 31,489
Junis,

I'm sorry to say this, but although all this is true & correct, I don't believe it will help you as you will still have problems with permissions on that object when it's all done :(.
Nov 23 '06 #7

Expert 5K+
P: 8,434
I'm sorry to say this, but although all this is true & correct, I don't believe it will help you as you will still have problems with permissions on that object when it's all done :(.
Here's a post I found on another forum (which I won't name, to avoid the wrath of the moderators :)) - it may be some help. A lot depends on what environment you are working in, I expect. Are we talking about VBA? VB5? VB6? VB.Net?

If you have permissions to manipulate MS Access database then open it under the the user name which you are using to access the database from VB. (If you don't have database secured then, you don't have to worry, just open MS Access database. Then do the following:

From the Pull Down menu select
1. Tools/Options
2. Select "View" tab and make System Objects checkbox selected
3. OK
4. Go Back to Pull Down Menu and Select˙
Tools/Security/User and Groups permissions
5. On Permissions TAB choose Table object type from the Combobox
6. Select MSysObjects table and give it permissions to read data and read design

Save all this and you VB connection will get the permissions to do what you want to do.

It works under DAO but I believe it will work under ADO to. I didn't have time to check ADO, sorry, too busy
Nov 23 '06 #8

P: 7
actually i running this code in VB.net

and i get some example with DAO (VB 6)... and its work (without changing permission)


btw ... thanks a lot (mary, neopa & Killer42)
maybe i can find this matter in another forum ...

regards
-junis-
Nov 24 '06 #9

Post your reply

Sign in to post your reply or Sign up for a free account.