-
Securing XML
I use an Access database to populate my XML details for a Word template Ribbon Bar.
This is the code that I use to access, in this case, the Labels for the various buttons, etc on the Ribbon:
Code:
Set dbRibbonData = OpenDatabase(Name:=inifileloc2)
'searches the Registry for the set language
myLanguage = GetSetting("GA", "Template Language", "Language")
'search the database in the 'Template_Labels' table in the 'language' field for the 'control.id' record
strSQL = "Select " & myLanguage & " FROM [Template_Labels] where [Field_Code] = '" & rxMyLabel & "'"
Set rdShippers = dbRibbonData.OpenRecordset(strSQL, dbOpenDynaset)
'return the value back to the Ribbon XML
On Error Resume Next
returnedVal = rdShippers.Fields(0)
rdShippers.Close
dbRibbonData.Close
If I were to password protect my Access database to stop people editing it, can I put a password in my code somewhere that will allow it to read the data which feeds back into the XML?
-
-
I'm sorry, but the above seems a very unreasonable way to explain why 'modertor' (sic) has been inserted in a reply of some kind. Bump what? To where? After all, it deals with a legitimate question about the Ribbon Bar. If it was wrong or in the wrong place a more helpful answer would have been, errr...more helpful?
-
This is a big grovelling apology to the Moderator. I didn't know what "bump" meant. I thought it meant I was being "bumped off" from the thread.
I now know he was being helpful in "bumping" it back into the readers' vision.
So sorry! :friends:
-
hope this helps
Code:
Public obDAO As DAO.Workspace, obDB As DAO.Database
Sub OpenConnection()
Set obDAO = DAO.DBEngine.Workspaces(0)
Set obDB = obDAO.OpenDatabase(strDBPath, False, False, ";pwd=" & DBPass & "")
ConnectionState = True
End Sub
Where strDBPath is the full path and file name that you want to open and DBPass is the active password
https://access-programmers.co.uk/for...d.php?t=178072
post #7
-
another:
Code:
Public Function OpenEncryptedDatabase()
Dim DB As DAO.Database
Dim rec As DAO.Recordset
Dim wrkspc As DAO.Workspace
Set wrkspc = Access.DBEngine(0)
Set DB = wrkspc.OpenDatabase("<your database here>", False, True, "MS Access;PWD=password")
Set rec = DB.OpenRecordset("select * from table1")
End Function
https://answers.microsoft.com/en-us/...c-68b599b31bf5
-
Thank you so much for those helpful answers. Will go away and try them out.
When I look at them, the results seem quite simple. But could I find them? Not a chance!
Thanks again!