How can we disable import of table link by VBA (1 Viewer)

jhkinter

New member
Local time
Today, 06:29
Joined
Nov 16, 2010
Messages
4
I set my table on server and front end with table link on user machine with vba log in code. However someone still can make blank database and import my table from server and table link from front end.

I user this code to hide table on server, and it's work (cannot see through Tool>Show hidden object. But for table link on front end, I dn't know how to write code.

Private Sub Command2_Click()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = CurrentDb
Set tdf = db.TableDefs("AcctCode")
tdf.Attributes = tdf.Attributes Or dbHiddenObject
Set tdf = db.TableDefs("CHART OF ACC_28102010")
tdf.Attributes = tdf.Attributes Or dbHiddenObject
End Sub

Are there any VBA code to hide or disable import of those table link.


Best Rgds
Veerachai
 

DCrake

Remembered
Local time
Today, 14:29
Joined
Jun 8, 2005
Messages
8,632
Another thing you can do is to password protect your back end and relink your tables in the front end. Then if anyone attempts to link to your back end they will need to supply the password.
 

jhkinter

New member
Local time
Today, 06:29
Joined
Nov 16, 2010
Messages
4
Another thing you can do is to password protect your back end and relink your tables in the front end. Then if anyone attempts to link to your back end they will need to supply the password.
Thks so much for your answer, by database password on back end, someone still can import link table from front end with no password needed and got data finally. Another point is database password hv third party program to recover.
Now i found the way frm some forums and below is coding just to share what I found.
However, I still need code to hide query further.

Function MakeHiddenAttachedTable(strDatabaseName As String, _
strTableName As String, strAttachedTableName As String)
Dim db As DAO.Database
Dim td As DAO.TableDef
Set db = CurrentDb
Set td = db.CreateTableDef(strAttachedTableName)
td.Connect = ";Database=" & strDatabaseName
td.SourceTableName = strTableName
db.TableDefs.Append td
td.Attributes = dbHiddenObject
Set td = Nothing
Set db = Nothing
End Function
 

kyoch

Registered User.
Local time
Today, 08:29
Joined
Mar 5, 2014
Messages
58
Does this work with Access 2013?

I'm looking to disable the import ability of tables and queries.
 

Users who are viewing this thread

Top Bottom