user level security for access database

Please discuss general Delphi programming topics here.

user level security for access database

Postby emad » July 12th, 2011, 3:16 pm

Hi.
I have an access database protected by user level security. I mean it has user name and password .
I created my database with access 2007(access 2000 file format) and connected to it by code successfully(by means of my security.mdw).
now i want to create my database by code.I use ADOX to create my database,but although I've assigned permissions to my tables but they opens by unauthorized users.anyone knows how can I protect may database by code in the user level.I emphasis when I create my database using access it works fine.
thanks a lot.
emad
Member
Member
 
Posts: 4
Joined: June 14th, 2011, 1:01 pm
Location: Iran,Isfahan,Naein

Re: user level security for access database

Postby emad » July 13th, 2011, 6:20 am

Hi.
I think I found the problem but i cant solve it.
problem is granting or revoking permissions to database object itself.
I use code like this:
Catalog1.Users['Admin'].SetPermissions('',adPermObjDatabase,adAccessRevoke, adRightMaximumAllowed,adInheritNone,Unassigned);
but it raise exception "Object is invalid or unknown to the provider."
does anyone know why I get this error message?
emad
Member
Member
 
Posts: 4
Joined: June 14th, 2011, 1:01 pm
Location: Iran,Isfahan,Naein

Re: user level security for access database

Postby emad » July 14th, 2011, 4:51 pm

HI.
Finally I solved problem myself.
rather using null string we should use null char.
I mean #0 rather than ''.
I wrote this comment to help everyone else that has same problem.
emad
Member
Member
 
Posts: 4
Joined: June 14th, 2011, 1:01 pm
Location: Iran,Isfahan,Naein

Re: user level security for access database

Postby Kambiz » July 15th, 2011, 12:42 am

Thanks for sharing the information!
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron