P
Phil
I have a front-end that links to tables in a back-end database (plain and
ordinary MS-Access). For various reasons I can't just mark the back-end
database as read-only (which would easily solve my problem).
I do have a query-based solution that I can use (but I'm still not entirely
satisfied with it). I do a total query grouping by all the fields in the
remote table. This will show all the fields in the table but not allow the
user to edit the underlying table. The 2 problems with this is:
1) the performannce hit
2) the user needs to know to look for the "table" under the queries
I tried using the following code to create the link (works fine) and then
change it's permissions to make it read-only (not so good):
Dim db As database
Dim con As Container
Dim doc As Document
Dim newLink As TableDef
Set db = CurrentDb()
Set newLink = db.CreateTableDef(TableName)
newLink.Connect = ";DATABASE=" & dbPath & dbName
newLink.SourceTableName = TableName
db.TableDefs.Append newLink
Set con = db.Containers("Tables")
Set doc = con.Documents(TableName)
doc.permissions = dbSecRetrieveData
I can still do all sorts of damage to the underlying table (modify fields,
delete records, etc.).
I should make it clear: this database is completely open to the user (ie. no
forms to restrict access to any tables). I'm trying to protect the remote
table from being changed when the user simply opens up the table (sans form).
What am I missing?
ordinary MS-Access). For various reasons I can't just mark the back-end
database as read-only (which would easily solve my problem).
I do have a query-based solution that I can use (but I'm still not entirely
satisfied with it). I do a total query grouping by all the fields in the
remote table. This will show all the fields in the table but not allow the
user to edit the underlying table. The 2 problems with this is:
1) the performannce hit
2) the user needs to know to look for the "table" under the queries
I tried using the following code to create the link (works fine) and then
change it's permissions to make it read-only (not so good):
Dim db As database
Dim con As Container
Dim doc As Document
Dim newLink As TableDef
Set db = CurrentDb()
Set newLink = db.CreateTableDef(TableName)
newLink.Connect = ";DATABASE=" & dbPath & dbName
newLink.SourceTableName = TableName
db.TableDefs.Append newLink
Set con = db.Containers("Tables")
Set doc = con.Documents(TableName)
doc.permissions = dbSecRetrieveData
I can still do all sorts of damage to the underlying table (modify fields,
delete records, etc.).
I should make it clear: this database is completely open to the user (ie. no
forms to restrict access to any tables). I'm trying to protect the remote
table from being changed when the user simply opens up the table (sans form).
What am I missing?