modifying tables and security

J

JB

I am working with an Access split db using security and RWOP queries. How
does one go about modifying the tables, e.g. adding a column, using vba code
or query without giving away the store? I tried using the standard code of
the sort

Set dbs = OpenDatabase("C:\Test.mdb")
Set tdf = dbs.TableDefs("tblTestAppend")
With tdf
.Fields.Append .CreateField("TextField", dbText)
End With
dbs.Close
Set dbs = Nothing

This only works if the user has modify design permission which means that
the db has no security at all. Is there so way to do the same thing without
giving the user any direct permissions on the tables. Something equivalent
to RWOP for queries
 
A

aatcbbtccctc

Just create a workspace using the credentials of a suitable higher
qualified user. The created workspace will have the permissions of that
(higher qualified) user. Then do what you need to do, via that
workspace (not the default one). Put this in an MDE, so a lower
qualified user can not just browse the source to see the username and
password of the higher qualified user.

(untested)

dim ws as workspace, db as database
set ws = createworkspace (, "BigJim", "s3cr3t")
' now ws has user BigJim's permissions.
set db = ws.opendatabase (...)
set tdf = db.tabledefs(...)
(and so on)

HTH,
TC
 
Top