Results 1 to 7 of 7

Thread: Securing XML

  1. #1

    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:

        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?

  2. #2
    VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,709
    Location
    Modertor bump
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    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?

  4. #4
    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!

  5. #5
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,645
    hope this helps


    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
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  6. #6
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,645
    another:

    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
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  7. #7
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •